mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-06-30 19:03:42 -04:00
Add Raylib-cs.Native project
This commit is contained in:
54
Raylib-cs.Native/Raylib-cs.Native.csproj
Normal file
54
Raylib-cs.Native/Raylib-cs.Native.csproj
Normal file
@ -0,0 +1,54 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
|
||||
<AssemblyName>Raylib-cs.Native</AssemblyName>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
|
||||
<NativeExt>so</NativeExt>
|
||||
<NativePre>lib</NativePre>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
|
||||
<NativeExt>dylib</NativeExt>
|
||||
<NativePre>lib</NativePre>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
|
||||
<NativeExt>dll</NativeExt>
|
||||
<NativePre>$(Configuration)/</NativePre>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content
|
||||
Include="$(IntermediateOutputPath)native/raylib/$(NativePre)raylib.$(NativeExt)"
|
||||
Link="%(Filename)%(Extension)"
|
||||
CopyToOutputDirectory="PreserveNewest"
|
||||
Condition="Exists('$(IntermediateOutputPath)native/raylib/$(NativePre)raylib.$(NativeExt)')" />
|
||||
<CMakeArgs Include="-B $(IntermediateOutputPath)native" />
|
||||
<CMakeArgs Include="-S $(IntermediateOutputPath)raylib-$(TargetRaylibTag)" />
|
||||
<CMakeArgs Include="-D CMAKE_BUILD_TYPE=$(Configuration)" />
|
||||
<CMakeArgs Include="-D BUILD_SHARED_LIBS=ON" />
|
||||
<CMakeArgs Include="-D BUILD_EXAMPLES=OFF" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="ConfigureNative" BeforeTargets="BuildNative" Condition="$(SkipLocalBuild) != true">
|
||||
<DownloadFile
|
||||
SourceUrl="https://github.com/raysan5/raylib/archive/refs/tags/$(TargetRaylibTag).zip"
|
||||
DestinationFolder="$(IntermediateOutputPath)"
|
||||
DestinationFileName="raylib.zip"
|
||||
Condition="!Exists('$(IntermediateOutputPath)raylib.zip')" />
|
||||
<Unzip
|
||||
SourceFiles="$(IntermediateOutputPath)raylib.zip"
|
||||
DestinationFolder="$(IntermediateOutputPath)"
|
||||
OverwriteReadOnlyFiles="true"
|
||||
Condition="!Exists('$(IntermediateOutputPath)raylib-$(TargetRaylibTag)')" />
|
||||
<Exec Command="cmake @(CMakeArgs, ' ') $(CMakeExtraArgs)"
|
||||
Condition="!Exists('$(IntermediateOutputPath)native/CMakeCache.txt')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildNative" BeforeTargets="BeforeBuild" Condition="$(SkipLocalBuild) != true">
|
||||
<Exec Command="cmake --build $(IntermediateOutputPath)native --config $(Configuration)" />
|
||||
</Target>
|
||||
</Project>
|
Reference in New Issue
Block a user