onnxruntime/csharp/src/Microsoft.AI.MachineLearning/Microsoft.AI.MachineLearning.targets
Tiago Koji Castro Shibata 9e68e98423
Add static CRT DLLs to Nuget package (#5661)
* Add static runtime yaml option

* Add to WAI Nuget build matrix

* Support empty build flags

* Add DML to x64

* Bundle static rt

* Bundle after Nugets are built

* Fix typo

* Skip static tests

* Pack test artifact only in x64 dynamic

* No DML static runtime

* Add Store static

* Revert "Add Store static"

This reverts commit 69133e5838.

* Static subfolder
2020-11-05 09:26:17 -08:00

39 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WindowsAI-Platform Condition="'$(Platform)' == 'Win32'">x86</WindowsAI-Platform>
<WindowsAI-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</WindowsAI-Platform>
</PropertyGroup>
<PropertyGroup>
<RuntimesDirectory Condition="'$(OutputType)' == 'AppContainerExe'">$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\uap</RuntimesDirectory>
<RuntimesDirectory Condition="'$(RuntimesDirectory)' == ''">$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\native</RuntimesDirectory>
<WindowsAIBinarySubfolder Condition="'$(UseWindowsMLStaticRuntime)' == 'true'">static\</WindowsAIBinarySubfolder>
<WindowsAIBinary>$(RuntimesDirectory)\$(WindowsAIBinarySubfolder)Microsoft.AI.MachineLearning.dll</WindowsAIBinary>
</PropertyGroup>
<PropertyGroup Condition="'$(DisableOnnxRuntimeDllCopy)' != 'true'">
<OnnxRuntimeBinary Condition="'$(OnnxRuntimeBinary)' == ''">$(RuntimesDirectory)\$(WindowsAIBinarySubfolder)onnxruntime.dll</OnnxRuntimeBinary>
</PropertyGroup>
<PropertyGroup Condition="'$(DisableDirectMLDllCopy)' != 'true'">
<DirectMLBinary Condition="'$(DirectMLBinary)' == ''">$(RuntimesDirectory)\directml.dll</DirectMLBinary>
</PropertyGroup>
<ItemGroup>
<Reference Include="$(MSBuildThisFileDirectory)\..\..\lib\uap\Microsoft.AI.MachineLearning.winmd">
<Implementation>$(WindowsAIBinary)</Implementation>
</Reference>
</ItemGroup>
<PropertyGroup Condition="'$(WindowsAI-Platform)' == x64 OR '$(WindowsAI-Platform)' == x86">
<MLBinaries>$(WindowsAIBinary);$(OnnxRuntimeBinary);$(DirectMLBinary)</MLBinaries>
</PropertyGroup>
<PropertyGroup Condition="'$(OutputType)' == 'AppContainerExe' OR '$(WindowsAI-Platform)' == arm OR '$(WindowsAI-Platform)' == arm64">
<MLBinaries>$(WindowsAIBinary);$(OnnxRuntimeBinary)</MLBinaries>
</PropertyGroup>
<ItemGroup>
<ReferenceCopyLocalPaths Include="$(MLBinaries)" />
</ItemGroup>
</Project>