1- <Project xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
2-
3- <!-- Property to Resolve RuntimeIdentifier -->
4- <PropertyGroup >
5- <!-- If no RuntimeIdentifier is set, use an empty string to fallback to all native libraries -->
6- <ResolvedRuntimeIdentifier Condition =" '$(RuntimeIdentifier)' == ''" >win-x64</ResolvedRuntimeIdentifier >
7- </PropertyGroup >
8-
9- <!-- Debug Messages for Diagnostic Purposes -->
10- <Target Name =" LogRuntimeIdentifier" BeforeTargets =" Build" >
11- <Message Text =" RuntimeIdentifier: '$(RuntimeIdentifier)'" Importance =" high" />
12- <Message Text =" ResolvedRuntimeIdentifier: '$(ResolvedRuntimeIdentifier)'" Importance =" high" />
13- </Target >
14-
15- <!-- Copy Native Libraries -->
16- <Target Name =" CopyNativeLibraries" AfterTargets =" Build" >
17- <ItemGroup >
18- <!-- If ResolvedRuntimeIdentifier is 'all', include native libraries from all runtimes -->
19- <NativeLibs Include =" $(MSBuildThisFileDirectory)..\runtimes\win-x64\native\*" Condition =" '$(ResolvedRuntimeIdentifier)' == 'all'" />
20- <NativeLibs Include =" $(MSBuildThisFileDirectory)..\runtimes\win-x86\native\*" Condition =" '$(ResolvedRuntimeIdentifier)' == 'all'" />
21- <NativeLibs Include =" $(MSBuildThisFileDirectory)..\runtimes\linux-x64\native\*" Condition =" '$(ResolvedRuntimeIdentifier)' == 'all'" />
22- <NativeLibs Include =" $(MSBuildThisFileDirectory)..\runtimes\linux-x86\native\*" Condition =" '$(ResolvedRuntimeIdentifier)' == 'all'" />
23- <NativeLibs Include =" $(MSBuildThisFileDirectory)..\runtimes\linux-arm64\native\*" Condition =" '$(ResolvedRuntimeIdentifier)' == 'all'" />
24- <NativeLibs Include =" $(MSBuildThisFileDirectory)..\runtimes\win-arm64\native\*" Condition =" '$(ResolvedRuntimeIdentifier)' == 'all'" />
25- <!-- If a RuntimeIdentifier is set, include only from that specific runtime -->
26- <NativeLibs Include =" $(MSBuildThisFileDirectory)..\runtimes\$(ResolvedRuntimeIdentifier)\native\*" Condition =" '$(ResolvedRuntimeIdentifier)' != 'all'" />
27- </ItemGroup >
28-
29- <!-- Log the native libraries that are being copied -->
30- <Message Text =" Native libraries to copy: @(NativeLibs)" Importance =" high" />
31-
32- <!-- Perform the copy to the output directory -->
33- <Copy
34- SourceFiles =" @(NativeLibs)"
35- DestinationFolder =" $(OutputPath)"
36- SkipUnchangedFiles =" true" />
37- </Target >
38-
1+ <Project >
2+ <Target Name =" CopyNativeLibraries" AfterTargets =" Build" >
3+ <ItemGroup >
4+ <NativeLibs Include =" $(MSBuildThisFileDirectory)..\runtimes\$(RuntimeIdentifier)\native\*.*" />
5+ </ItemGroup >
6+ <Copy SourceFiles =" @(NativeLibs)" DestinationFolder =" $(OutputPath)" Condition =" Exists('%(NativeLibs.FullPath)')" />
7+ </Target >
398</Project >
0 commit comments