Skip to content

Commit

Permalink
Fix build (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdill committed Jun 20, 2024
1 parent d652823 commit daa124a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
dotnet-version: 6.0.x

- name: build projects
run: dotnet build -c Release
run: dotnet build -c Release /p:BuildArch=${{ matrix.arch }}

- name: run tests
run: dotnet test Raylib-cs.Tests -c Release
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
dotnet-version: 6.0.x

- name: build projects
run: dotnet build -c Release
run: dotnet build -c Release /p:BuildArch=${{ matrix.arch }}

- name: run tests
run: dotnet test Raylib-cs.Tests -c Release
Expand Down
23 changes: 22 additions & 1 deletion Raylib-cs.Native/Raylib-cs.Native.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,39 @@
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
<NativeExt>so</NativeExt>
<NativePre>lib</NativePre>
<NativeArch>x64</NativeArch>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
<NativeExt>dylib</NativeExt>
<NativePre>lib</NativePre>
<NativeArch Condition="$(BuildArch) == ''">x86_x64</NativeArch>
<NativeArch Condition="$(BuildArch) != ''">$(BuildArch)</NativeArch>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<NativeExt>dll</NativeExt>
<NativePre>$(Configuration)/</NativePre>
<NativeArch Condition="$(BuildArch) == ''">x64</NativeArch>
<NativeArch Condition="$(BuildArch) != ''">$(BuildArch)</NativeArch>
</PropertyGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('OSX')) AND $(NativeArch) == 'arm64'">
<CMakeArgs Include="-D CMAKE_OSX_ARCHITECTURES=arm64" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('OSX')) AND $(NativeArch) == 'x86_64'">
<CMakeArgs Include="-D CMAKE_OSX_ARCHITECTURES=x86_64" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOsPlatform('Windows')) AND $(NativeArch) == 'win32'">
<CMakeArgs Include="-A win32" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOsPlatform('Windows')) AND $(NativeArch) == 'x64'">
<CMakeArgs Include="-A x64" />
</ItemGroup>

<ItemGroup>
<Content
Include="$(OutputPath)native/raylib/$(NativePre)raylib.$(NativeExt)"
Expand Down Expand Up @@ -49,7 +70,7 @@
DestinationFolder="$(BaseIntermediateOutputPath)"
OverwriteReadOnlyFiles="true"
Condition="!Exists('$(BaseIntermediateOutputPath)raylib-$(TargetRaylibTag)')" />

<Exec Command="cmake @(CMakeArgs, ' ') $(CMakeExtraArgs)"
Condition="!Exists('$(BaseIntermediateOutputPath)native/CMakeCache.txt')" />

Expand Down

0 comments on commit daa124a

Please sign in to comment.