33 <PropertyGroup >
44 <LightningDBTargetRuntimeRelativePath Condition =" '$(LightningDBTargetRuntimeRelativePath)' == '' " >\..\</LightningDBTargetRuntimeRelativePath >
55 </PropertyGroup >
6- <Target Name =" LightningDBIncludeNativeDll" AfterTargets =" BeforeResolveReferences" >
7- <ItemGroup >
8- <None Include =" $(MSBuildThisFileDirectory)$(LightningDBTargetRuntimeRelativePath)runtimes\win-x86\native\*"
9- CopyToOutputDirectory =" PreserveNewest"
10- Condition =" '$([MSBuild]::IsOsPlatform(Windows))' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)'=='X86'" />
11- <None Include =" $(MSBuildThisFileDirectory)$(LightningDBTargetRuntimeRelativePath)runtimes\win-x64\native\*"
12- CopyToOutputDirectory =" PreserveNewest"
13- Condition =" '$([MSBuild]::IsOsPlatform(Windows))' And ('$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)'=='X64' OR '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)'=='Arm64')" />
14- <!-- ^^ This simply makes it easier to test for Mac M1 -> Parallels but needs -arch x64 explicitly set, currently there is no cross compile toolset for Win ARM for GCC -->
15- <None Include =" $(MSBuildThisFileDirectory)$(LightningDBTargetRuntimeRelativePath)runtimes\osx-arm64\native\*"
16- CopyToOutputDirectory =" PreserveNewest"
17- Condition =" '$([MSBuild]::IsOsPlatform(OSX))' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)'=='Arm64'" />
18- <None Include =" $(MSBuildThisFileDirectory)$(LightningDBTargetRuntimeRelativePath)runtimes\osx\native\*"
19- CopyToOutputDirectory =" PreserveNewest"
20- Condition =" '$([MSBuild]::IsOsPlatform(OSX))' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)'=='X64'" />
21- <None Include =" $(MSBuildThisFileDirectory)$(LightningDBTargetRuntimeRelativePath)runtimes\linux-arm\native\*"
22- CopyToOutputDirectory =" PreserveNewest"
23- Condition =" '$([MSBuild]::IsOsPlatform(Linux))' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)'=='Arm'" />
24- <None Include =" $(MSBuildThisFileDirectory)$(LightningDBTargetRuntimeRelativePath)runtimes\linux-arm64\native\*"
25- CopyToOutputDirectory =" PreserveNewest"
26- Condition =" '$([MSBuild]::IsOsPlatform(Linux))' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)'=='Arm64'" />
27- <None Include =" $(MSBuildThisFileDirectory)$(LightningDBTargetRuntimeRelativePath)runtimes\linux-x64\native\*"
28- CopyToOutputDirectory =" PreserveNewest"
29- Condition =" '$([MSBuild]::IsOsPlatform(Linux))' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)'=='X64'" />
30- </ItemGroup >
31- </Target >
6+ <Target Name =" LightningDBIncludeNativeDll" AfterTargets =" BeforeResolveReferences" >
7+ <PropertyGroup >
8+ <_LightningDBEffectiveRuntimeIdentifier >$(RuntimeIdentifier)</_LightningDBEffectiveRuntimeIdentifier >
9+
10+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$(PlatformTarget)' == 'x86' And '$([MSBuild]::IsOsPlatform(Windows))' == 'true'" >win-x86</_LightningDBEffectiveRuntimeIdentifier >
11+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$(PlatformTarget)' == 'x64' And '$([MSBuild]::IsOsPlatform(Windows))' == 'true'" >win-x64</_LightningDBEffectiveRuntimeIdentifier >
12+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$(PlatformTarget)' == 'ARM64' And '$([MSBuild]::IsOsPlatform(Windows))' == 'true'" >win-arm64</_LightningDBEffectiveRuntimeIdentifier >
13+
14+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$(PlatformTarget)' == 'x64' And '$([MSBuild]::IsOsPlatform(OSX))' == 'true'" >osx-x64</_LightningDBEffectiveRuntimeIdentifier >
15+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$(PlatformTarget)' == 'ARM64' And '$([MSBuild]::IsOsPlatform(OSX))' == 'true'" >osx-arm64</_LightningDBEffectiveRuntimeIdentifier >
16+
17+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$(PlatformTarget)' == 'x64' And '$([MSBuild]::IsOsPlatform(Linux))' == 'true'" >linux-x64</_LightningDBEffectiveRuntimeIdentifier >
18+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$(PlatformTarget)' == 'ARM' And '$([MSBuild]::IsOsPlatform(Linux))' == 'true'" >linux-arm</_LightningDBEffectiveRuntimeIdentifier >
19+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$(PlatformTarget)' == 'ARM64' And '$([MSBuild]::IsOsPlatform(Linux))' == 'true'" >linux-arm64</_LightningDBEffectiveRuntimeIdentifier >
20+
21+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$(Prefer32Bit)' == 'true' And '$([MSBuild]::IsOsPlatform(Windows))' == 'true'" >win-x86</_LightningDBEffectiveRuntimeIdentifier >
22+
23+ <_LightningDBUsingHostRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == ''" >true</_LightningDBUsingHostRuntimeIdentifier >
24+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$(NETCoreSdkRuntimeIdentifier)' != ''" >$(NETCoreSdkRuntimeIdentifier)</_LightningDBEffectiveRuntimeIdentifier >
25+
26+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$([MSBuild]::IsOsPlatform(Windows))' == 'true' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X86'" >win-x86</_LightningDBEffectiveRuntimeIdentifier >
27+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$([MSBuild]::IsOsPlatform(Windows))' == 'true' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64'" >win-x64</_LightningDBEffectiveRuntimeIdentifier >
28+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$([MSBuild]::IsOsPlatform(Windows))' == 'true' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'" >win-arm64</_LightningDBEffectiveRuntimeIdentifier >
29+
30+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$([MSBuild]::IsOsPlatform(OSX))' == 'true' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64'" >osx-x64</_LightningDBEffectiveRuntimeIdentifier >
31+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$([MSBuild]::IsOsPlatform(OSX))' == 'true' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'" >osx-arm64</_LightningDBEffectiveRuntimeIdentifier >
32+
33+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$([MSBuild]::IsOsPlatform(Linux))' == 'true' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64'" >linux-x64</_LightningDBEffectiveRuntimeIdentifier >
34+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$([MSBuild]::IsOsPlatform(Linux))' == 'true' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm'" >linux-arm</_LightningDBEffectiveRuntimeIdentifier >
35+ <_LightningDBEffectiveRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == '' And '$([MSBuild]::IsOsPlatform(Linux))' == 'true' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'" >linux-arm64</_LightningDBEffectiveRuntimeIdentifier >
36+
37+ <_LightningDBNativeAssetRuntimeIdentifier >$(_LightningDBEffectiveRuntimeIdentifier)</_LightningDBNativeAssetRuntimeIdentifier >
38+ <_LightningDBNativeAssetRuntimeIdentifier Condition =" '$(_LightningDBEffectiveRuntimeIdentifier)' == 'osx-x64'" >osx</_LightningDBNativeAssetRuntimeIdentifier >
39+ </PropertyGroup >
40+
41+ <!-- A RID-less library must not propagate a host-native file into a consuming app's cross-RID publish. -->
42+ <ItemGroup Condition =" '$(_LightningDBNativeAssetRuntimeIdentifier)' != '' And ('$(_LightningDBUsingHostRuntimeIdentifier)' != 'true' Or '$(OutputType)' != 'Library')" >
43+ <None Include =" $(MSBuildThisFileDirectory)$(LightningDBTargetRuntimeRelativePath)runtimes\$(_LightningDBNativeAssetRuntimeIdentifier)\native\*"
44+ CopyToOutputDirectory =" PreserveNewest" />
45+ </ItemGroup >
46+ </Target >
3247</Project >
0 commit comments