85 行
3.6 KiB
XML
85 行
3.6 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
<PropertyGroup>
|
|
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
|
|
<OutputPath>bin\Release</OutputPath>
|
|
<DocumentationFile>ComputeSharp.Dynamic.xml</DocumentationFile>
|
|
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
|
</PropertyGroup>
|
|
|
|
<!-- Enable trimming support on .NET 6 -->
|
|
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
|
|
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
|
<IsTrimmable>true</IsTrimmable>
|
|
</PropertyGroup>
|
|
|
|
<!-- Reference to the main non-dynamic library-->
|
|
<ItemGroup>
|
|
<ProjectReference Include="..\ComputeSharp\ComputeSharp.csproj" />
|
|
</ItemGroup>
|
|
|
|
<!-- Shared project with .NET Standard 2.0 polyfills for Dxc -->
|
|
<Import Condition="'$(TargetFramework)' == 'netstandard2.0'" Project="..\TerraFX.Interop.Windows.Dynamic\TerraFX.Interop.Windows.Dynamic.projitems" Label="Shared" />
|
|
|
|
<Choose>
|
|
|
|
<!-- When building locally for x64/ARM64 (using the project through a project reference),
|
|
just copy the right native libraries to the output directory, with no subfolders. -->
|
|
<When Condition="'$(Platform)' == 'x64'">
|
|
<ItemGroup>
|
|
<None Include="Libraries\x64\dxcompiler.dll"
|
|
Link="dxcompiler.dll"
|
|
Visible="False"
|
|
CopyToOutputDirectory="PreserveNewest" />
|
|
<None Include="Libraries\x64\dxil.dll"
|
|
Link="dxil.dll"
|
|
Visible="False"
|
|
CopyToOutputDirectory="PreserveNewest" />
|
|
</ItemGroup>
|
|
</When>
|
|
<When Condition="'$(Platform)' == 'ARM64'">
|
|
<ItemGroup>
|
|
<None Include="Libraries\arm64\dxcompiler.dll"
|
|
Link="dxcompiler.dll"
|
|
Visible="False"
|
|
CopyToOutputDirectory="PreserveNewest" />
|
|
<None Include="Libraries\arm64\dxil.dll"
|
|
Link="dxil.dll"
|
|
Visible="False"
|
|
CopyToOutputDirectory="PreserveNewest" />
|
|
</ItemGroup>
|
|
</When>
|
|
|
|
<!-- When no RID is specified, it means the NuGet package is being packed. In this
|
|
case, copy all native libraries to the right runtimes/<RID>/native directory,
|
|
which will automatically be used by NuGet to deploy the right libs to consumers.
|
|
Still keep the link target to get the libraries to be copied to the output, which
|
|
allows them to be found even when running the library locally in Any CPU. This will
|
|
make life easier for developers using a project reference with an incorrect configuration,
|
|
while still not causing any change in the final NuGet package (Link isn't looked up there). -->
|
|
<Otherwise>
|
|
<ItemGroup>
|
|
<None Include="Libraries\x64\dxcompiler.dll"
|
|
Link="runtimes\win-x64\native\dxcompiler.dll"
|
|
Visible="False"
|
|
CopyToOutputDirectory="PreserveNewest"
|
|
PackFolder="runtimes\win-x64\native" />
|
|
<None Include="Libraries\x64\dxil.dll"
|
|
Link="runtimes\win-x64\native\dxil.dll"
|
|
Visible="False"
|
|
CopyToOutputDirectory="PreserveNewest"
|
|
PackFolder="runtimes\win-x64\native" />
|
|
<None Include="Libraries\arm64\dxcompiler.dll"
|
|
Link="runtimes\win-arm64\native\dxcompiler.dll"
|
|
Visible="False"
|
|
CopyToOutputDirectory="PreserveNewest"
|
|
PackFolder="runtimes\win-arm64\native" />
|
|
<None Include="Libraries\arm64\dxil.dll"
|
|
Link="runtimes\win-arm64\native\dxil.dll"
|
|
Visible="False"
|
|
CopyToOutputDirectory="PreserveNewest"
|
|
PackFolder="runtimes\win-arm64\native" />
|
|
</ItemGroup>
|
|
</Otherwise>
|
|
</Choose>
|
|
</Project>
|