Microsoft.AI.MachineLearning.targets 2.32 KB
Newer Older
gaoqiong's avatar
gaoqiong committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?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>