Skip to content

Commit

Permalink
Add build targets for mono and legacy MSBuild (pre-PackageReference).
Browse files Browse the repository at this point in the history
Also, rename native lib back to cimgui.dylib.
  • Loading branch information
mellinoe committed Mar 13, 2019
1 parent 78fe032 commit dcb9b89
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@

<ItemGroup>
<Content Include="$(RepositoryRootDirectory)/deps/cimgui/win-x64/cimgui.dll" CopyToOutputDirectory="PreserveNewest" />
<Content Include="$(RepositoryRootDirectory)/deps/cimgui/osx-x64/libcimgui.dylib" CopyToOutputDirectory="PreserveNewest" />
<Content Include="$(RepositoryRootDirectory)/deps/cimgui/linux-x64/cimgui.so" CopyToOutputDirectory="PreserveNewest" />
<Content Include="$(RepositoryRootDirectory)/deps/cimgui/osx-x64/cimgui.dylib" CopyToOutputDirectory="PreserveNewest"
Link="lib%(Filename)%(Extension)" />
<Content Include="$(RepositoryRootDirectory)/deps/cimgui/linux-x64/cimgui.so" CopyToOutputDirectory="PreserveNewest"
Link="lib%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 7 additions & 3 deletions src/ImGui.NET/ImGui.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@
<Pack>true</Pack>
</Content>
<Content Include="..\..\deps\cimgui\linux-x64\cimgui.so">
<PackagePath>runtimes/linux-x64/native</PackagePath>
<PackagePath>runtimes/linux-x64/native/libcimgui.so</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\..\deps\cimgui\osx-x64\libcimgui.dylib">
<PackagePath>runtimes/osx-x64/native</PackagePath>
<Content Include="..\..\deps\cimgui\osx-x64\cimgui.dylib">
<PackagePath>runtimes/osx-x64/native/libcimgui.dylib</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="build\net40\ImGui.NET.targets">
<PackagePath>build/net40/ImGui.NET.targets</PackagePath>
<Pack>true</Pack>
</Content>
</ItemGroup>
Expand Down
24 changes: 24 additions & 0 deletions src/ImGui.NET/build/net40/ImGui.NET.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</_IsWindows>
<_IsMacOS Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</_IsMacOS>
<_IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</_IsLinux>

<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsMacOS)' == 'true' And ('$(Prefer32Bit)' == 'false' Or '$(PlatformTarget)' == 'x64')">osx-x64</_NativeRuntime>
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsLinux)' == 'true' And ('$(Prefer32Bit)' == 'false' Or '$(PlatformTarget)' == 'x64')">linux-x64</_NativeRuntime>
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsWindows)' == 'true' And ('$(Prefer32Bit)' == 'true' Or '$(PlatformTarget)' == 'x86')">win-x86</_NativeRuntime>
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsWindows)' == 'true' And ('$(Prefer32Bit)' == 'false' Or '$(PlatformTarget)' == 'x64')">win-x64</_NativeRuntime>

<_NativeLibName Condition="'$(_NativeRuntime)' == 'win-x86' Or '$(_NativeRuntime)' == 'win-x64'">cimgui.dll</_NativeLibName>
<_NativeLibName Condition="'$(_NativeRuntime)' == 'osx-x64'">libcimgui.dylib</_NativeLibName>
<_NativeLibName Condition="'$(_NativeRuntime)' == 'linux-x64'">libcimgui.so</_NativeLibName>
</PropertyGroup>
<ItemGroup>
<Content Condition="'$(_NativeRuntime)' != ''" Include="$(MSBuildThisFileDirectory)..\..\runtimes\$(_NativeRuntime)\native\$(_NativeLibName)">
<Link>%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Visible>False</Visible>
</Content>
</ItemGroup>
</Project>

0 comments on commit dcb9b89

Please sign in to comment.