|
| 1 | +<Project> |
| 2 | + |
| 3 | + <PropertyGroup> |
| 4 | + <!-- If the RuntimeIdentifier is explicitly specified. Use the specified target platform. --> |
| 5 | + <BenchmarkDotNetTargetPlatform>$(RuntimeIdentifier)</BenchmarkDotNetTargetPlatform> |
| 6 | + </PropertyGroup> |
| 7 | + |
| 8 | + <PropertyGroup Condition="'$(BenchmarkDotNetTargetPlatform)' == ''"> |
| 9 | + <!-- If RuntimeIdentifier is not specified Use current build platform --> |
| 10 | + <!-- List of runtimes supported by Gee.External.Capstone: https://github.com/9ee1/Capstone.NET/tree/master/Gee.External.Capstone/runtimes --> |
| 11 | + <BenchmarkDotNetTargetPlatform Condition="$([MSBuild]::IsOSPlatform('Linux'))">linux</BenchmarkDotNetTargetPlatform> |
| 12 | + <BenchmarkDotNetTargetPlatform Condition="$([MSBuild]::IsOSPlatform('Windows'))">win</BenchmarkDotNetTargetPlatform> |
| 13 | + <BenchmarkDotNetTargetPlatform Condition="$([MSBuild]::IsOSPlatform('OSX'))">osx</BenchmarkDotNetTargetPlatform> |
| 14 | + |
| 15 | + <BenchmarkDotNetTargetPlatform Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64'">$(BenchmarkDotNetTargetPlatform)-x64</BenchmarkDotNetTargetPlatform> |
| 16 | + <BenchmarkDotNetTargetPlatform Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X86'">$(BenchmarkDotNetTargetPlatform)-x86</BenchmarkDotNetTargetPlatform> |
| 17 | + <BenchmarkDotNetTargetPlatform Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm'">$(BenchmarkDotNetTargetPlatform)-arm</BenchmarkDotNetTargetPlatform> |
| 18 | + <BenchmarkDotNetTargetPlatform Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'">$(BenchmarkDotNetTargetPlatform)-arm64</BenchmarkDotNetTargetPlatform> |
| 19 | + </PropertyGroup> |
| 20 | + |
| 21 | + <Target Name="FilterBenchmarkDotNetPackageAssets" AfterTargets="ResolvePackageAssets"> |
| 22 | + <!-- Remove `runtimes/{RuntimeIdentifier}` files that is not matched to target platform. --> |
| 23 | + <ItemGroup Condition="'$(BenchmarkDotNetTargetPlatform)' != '' AND $(BenchmarkDotNetTargetPlatform) != 'all'"> |
| 24 | + <RuntimeTargetsCopyLocalItems Remove="@(RuntimeTargetsCopyLocalItems)" |
| 25 | + Condition="'%(RuntimeTargetsCopyLocalItems.NuGetPackageId)' == 'Gee.External.Capstone' AND '%(RuntimeTargetsCopyLocalItems.RuntimeIdentifier)' != '$(BenchmarkDotNetTargetPlatform)'" /> |
| 26 | + </ItemGroup> |
| 27 | + |
| 28 | + <!-- Remove unnecessary satellite assemblies. --> |
| 29 | + <ItemGroup> |
| 30 | + <ResourceCopyLocalItems Remove="@(ResourceCopyLocalItems)" |
| 31 | + Condition="'%(ResourceCopyLocalItems.NuGetPackageId)' == 'Microsoft.CodeAnalysis.Common' OR '%(ResourceCopyLocalItems.NuGetPackageId)' == 'Microsoft.CodeAnalysis.CSharp'"/> |
| 32 | + </ItemGroup> |
| 33 | + </Target> |
| 34 | +</Project> |
0 commit comments