Skip to content

Commit dcb9b89

Browse files
committed
Add build targets for mono and legacy MSBuild (pre-PackageReference).
Also, rename native lib back to cimgui.dylib.
1 parent 78fe032 commit dcb9b89

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed
File renamed without changes.

src/ImGui.NET.SampleProgram.XNA/ImGui.NET.SampleProgram.XNA.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515

1616
<ItemGroup>
1717
<Content Include="$(RepositoryRootDirectory)/deps/cimgui/win-x64/cimgui.dll" CopyToOutputDirectory="PreserveNewest" />
18-
<Content Include="$(RepositoryRootDirectory)/deps/cimgui/osx-x64/libcimgui.dylib" CopyToOutputDirectory="PreserveNewest" />
19-
<Content Include="$(RepositoryRootDirectory)/deps/cimgui/linux-x64/cimgui.so" CopyToOutputDirectory="PreserveNewest" />
18+
<Content Include="$(RepositoryRootDirectory)/deps/cimgui/osx-x64/cimgui.dylib" CopyToOutputDirectory="PreserveNewest"
19+
Link="lib%(Filename)%(Extension)" />
20+
<Content Include="$(RepositoryRootDirectory)/deps/cimgui/linux-x64/cimgui.so" CopyToOutputDirectory="PreserveNewest"
21+
Link="lib%(Filename)%(Extension)" />
2022
</ItemGroup>
2123

2224
<ItemGroup>

src/ImGui.NET/ImGui.NET.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@
3030
<Pack>true</Pack>
3131
</Content>
3232
<Content Include="..\..\deps\cimgui\linux-x64\cimgui.so">
33-
<PackagePath>runtimes/linux-x64/native</PackagePath>
33+
<PackagePath>runtimes/linux-x64/native/libcimgui.so</PackagePath>
3434
<Pack>true</Pack>
3535
</Content>
36-
<Content Include="..\..\deps\cimgui\osx-x64\libcimgui.dylib">
37-
<PackagePath>runtimes/osx-x64/native</PackagePath>
36+
<Content Include="..\..\deps\cimgui\osx-x64\cimgui.dylib">
37+
<PackagePath>runtimes/osx-x64/native/libcimgui.dylib</PackagePath>
38+
<Pack>true</Pack>
39+
</Content>
40+
<Content Include="build\net40\ImGui.NET.targets">
41+
<PackagePath>build/net40/ImGui.NET.targets</PackagePath>
3842
<Pack>true</Pack>
3943
</Content>
4044
</ItemGroup>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<_IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</_IsWindows>
5+
<_IsMacOS Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</_IsMacOS>
6+
<_IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</_IsLinux>
7+
8+
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsMacOS)' == 'true' And ('$(Prefer32Bit)' == 'false' Or '$(PlatformTarget)' == 'x64')">osx-x64</_NativeRuntime>
9+
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsLinux)' == 'true' And ('$(Prefer32Bit)' == 'false' Or '$(PlatformTarget)' == 'x64')">linux-x64</_NativeRuntime>
10+
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsWindows)' == 'true' And ('$(Prefer32Bit)' == 'true' Or '$(PlatformTarget)' == 'x86')">win-x86</_NativeRuntime>
11+
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsWindows)' == 'true' And ('$(Prefer32Bit)' == 'false' Or '$(PlatformTarget)' == 'x64')">win-x64</_NativeRuntime>
12+
13+
<_NativeLibName Condition="'$(_NativeRuntime)' == 'win-x86' Or '$(_NativeRuntime)' == 'win-x64'">cimgui.dll</_NativeLibName>
14+
<_NativeLibName Condition="'$(_NativeRuntime)' == 'osx-x64'">libcimgui.dylib</_NativeLibName>
15+
<_NativeLibName Condition="'$(_NativeRuntime)' == 'linux-x64'">libcimgui.so</_NativeLibName>
16+
</PropertyGroup>
17+
<ItemGroup>
18+
<Content Condition="'$(_NativeRuntime)' != ''" Include="$(MSBuildThisFileDirectory)..\..\runtimes\$(_NativeRuntime)\native\$(_NativeLibName)">
19+
<Link>%(Filename)%(Extension)</Link>
20+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
21+
<Visible>False</Visible>
22+
</Content>
23+
</ItemGroup>
24+
</Project>

0 commit comments

Comments
 (0)