onnxruntime/csharp/src/Microsoft.AI.MachineLearning/Microsoft.AI.MachineLearning.targets
Sheil Kumar ce1a9ca618
Fix Microsoft.AI.MachineLearning NuGet App failure with multiple binaries copied to same destination (#10076)
* Include onnxruntime binary when not using pacakge referene or uap app.

* Remove the lib\uap10.0 build from the nuget package - causing conflicts

* Add UWP test

* remove build files

* remove local change

* reset mimalloc and onnx-tensorrt

* change username to Microsoft

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-12-21 12:34:03 -08:00

41 lines
2.3 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="'$(PlatformTarget)' == 'x64'">$(Platform)</WindowsAI-Platform>
<WindowsAI-Platform Condition="'$(PlatformTarget)' == 'Win32' Or '$(PlatformTarget)' == 'x86'">x86</WindowsAI-Platform>
<WindowsAI-Platform Condition="'$(PlatformTarget)' == 'ARM'">$(Platform)</WindowsAI-Platform>
<WindowsAI-Platform Condition="'$(PlatformTarget)' == 'ARM64'">$(Platform)</WindowsAI-Platform>
</PropertyGroup>
<PropertyGroup>
<RuntimesDirectory>$(MSBuildThisFileDirectory)..\..\runtimes\win-$(WindowsAI-Platform)\_native</RuntimesDirectory>
<WindowsAIBinarySubfolder Condition="'$(UseWindowsMLStaticRuntime)' == 'true'">static\</WindowsAIBinarySubfolder>
<WindowsAIBinary>$(RuntimesDirectory)\$(WindowsAIBinarySubfolder)microsoft.ai.machinelearning.dll</WindowsAIBinary>
<WindowsAIWinMD>$(MSBuildThisFileDirectory)..\..\winmds\Microsoft.AI.MachineLearning.winmd</WindowsAIWinMD>
<WindowsAIExperimentalWinMD>$(MSBuildThisFileDirectory)..\..\winmds\Microsoft.AI.MachineLearning.Experimental.winmd</WindowsAIExperimentalWinMD>
<WindowsAIBinary>$([System.IO.Path]::GetFullPath($(WindowsAIBinary)))</WindowsAIBinary>
<WindowsAIWinMD>$([System.IO.Path]::GetFullPath($(WindowsAIWinMD)))</WindowsAIWinMD>
<WindowsAIExperimentalWinMD>$([System.IO.Path]::GetFullPath($(WindowsAIExperimentalWinMD)))</WindowsAIExperimentalWinMD>
</PropertyGroup>
<PropertyGroup Condition="'$(DisableOnnxRuntimeDllCopy)' != 'true'">
<OnnxRuntimeBinary>$(RuntimesDirectory)\$(WindowsAIBinarySubfolder)onnxruntime.dll</OnnxRuntimeBinary>
</PropertyGroup>
<ItemGroup>
<Reference Include="$(WindowsAIWinMD)">
<Implementation>$(WindowsAIBinary)</Implementation>
</Reference>
<Reference Include="$(WindowsAIExperimentalWinMD)">
<Implementation>$(WindowsAIBinary)</Implementation>
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(NuGetProjectStyle)' != 'PackageReference'">
<ReferenceCopyLocalPaths Include="$(WindowsAIBinary);" />
</ItemGroup>
<ItemGroup Condition="'$(NuGetProjectStyle)' != 'PackageReference' OR '$(TargetPlatformIdentifier)' == 'UAP'">
<ReferenceCopyLocalPaths Include="$(OnnxRuntimeBinary)" />
</ItemGroup>
</Project>