onnxruntime/csharp/src/Microsoft.AI.MachineLearning.Interop/Microsoft.AI.MachineLearning.Interop.csproj
Sheil Kumar 94c4c44bfc
Enable Microsoft.Ai.MachineLearning package to work on .NET5 down to 17763 Windows SDK (#7522)
* upgrade cswinrt and downgrade target framework

* fix sdk version references

* cswinrt 1.1.0

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-05-01 00:56:36 -07:00

49 lines
No EOL
2.2 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectName>Microsoft.AI.MachineLearning.Interop</ProjectName>
<TargetFramework>net5.0-windows10.0.17763.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Platform>Any CPU</Platform>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<OnnxRuntimeBuildDirectory Condition="'$(OnnxRuntimeBuildDirectory)'==''">..\..\..\build\Windows</OnnxRuntimeBuildDirectory>
<BuildOutputDir>$(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration)</BuildOutputDir>
<WindowsAIInteropOutputDir>$(BuildOutputDir)\Microsoft.AI.MachineLearning.Interop</WindowsAIInteropOutputDir>
<OutputPath>$(WindowsAIInteropOutputDir)</OutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="1.1.0" targetFramework="net5.0-windows10.0.17763.0" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.17763.1000" targetFramework="net5.0-windows10.0.17763.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Generated Files\" />
</ItemGroup>
<Target Name="GenerateProjection" BeforeTargets="DispatchToInnerBuilds;Build;CoreCompile">
<ConvertToAbsolutePath Paths="$(OnnxRuntimeBuildDirectory)">
<Output TaskParameter="AbsolutePaths" PropertyName="OnnxRuntimeBuildDirectoryAbs" />
</ConvertToAbsolutePath>
<ItemGroup>
<WindowsAIsWinMDs Include="$(OnnxRuntimeBuildDirectoryAbs)\$(Configuration)\Microsoft.AI.MachineLearning.winmd" />
<WindowsAIsWinMDs Include="$(OnnxRuntimeBuildDirectoryAbs)\$(Configuration)\Microsoft.AI.MachineLearning.Experimental.winmd" />
</ItemGroup>
<PropertyGroup>
<CsWinRTCommand>$(CsWinRTPath)cswinrt.exe -verbose -in local -in @(WindowsAIsWinMDs->'"%(FullPath)"', ' ') -out "$(ProjectDir)Generated Files" -include Microsoft.AI.MachineLearning</CsWinRTCommand>
</PropertyGroup>
<Message Text="Generating $(ProjectName) CS projection sources with command:" />
<Message Text="$(CsWinRTCommand)" />
<Exec Command="$(CsWinRTCommand)" />
<ItemGroup>
<Compile Include="$(ProjectDir)Generated Files/*.cs" Exclude="@(Compile)" />
</ItemGroup>
</Target>
</Project>