mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-22 19:23:30 +00:00
Add build targets and props file for legacy csharp project support (#127)
* added the x64 condition in the targets file * need the reference node for managed dll * address review comments * fix the dll path * added back Link
This commit is contained in:
parent
19c630b87f
commit
a09a3d3aa5
3 changed files with 48 additions and 0 deletions
|
|
@ -63,6 +63,18 @@
|
|||
Pack="true"
|
||||
Visible="false"
|
||||
/>
|
||||
|
||||
<None Include="Microsoft.ML.OnnxRuntime.targets"
|
||||
PackagePath="\build\$(TargetFramework)"
|
||||
Pack="true"
|
||||
Visible="false"
|
||||
/>
|
||||
<None Include="Microsoft.ML.OnnxRuntime.props"
|
||||
PackagePath="\build\$(TargetFramework)"
|
||||
Pack="true"
|
||||
Visible="false"
|
||||
/>
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="ObtainPackageVersion" BeforeTargets="Build;Pack">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<ItemGroup Condition="Exists('packages.config') OR
|
||||
Exists('$(MSBuildProjectName).packages.config') OR
|
||||
Exists('packages.$(MSBuildProjectName).config')">
|
||||
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win10-x64\native\onnxruntime.dll"
|
||||
Condition="'$(PlatformTarget)' == 'x64'">
|
||||
<Link>onnxruntime.dll</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<Visible>false</Visible>
|
||||
</None>
|
||||
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win10-x64\native\mkldnn.dll"
|
||||
Condition="'$(PlatformTarget)' == 'x64'">
|
||||
<Link>mkldnn.dll</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<Visible>false</Visible>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="Microsoft_ML_OnnxRuntime_CheckPrerequisites" BeforeTargets="BeforeBuild">
|
||||
<!--
|
||||
Special case .NET Core portable applications. When building a portable .NET Core app,
|
||||
the PlatformTarget is empty, and you don't know until runtime (i.e. which dotnet.exe)
|
||||
what processor architecture will be used.
|
||||
-->
|
||||
<Error Condition="'$(PlatformTarget)' != 'x64' AND
|
||||
('$(OutputType)' == 'Exe' OR '$(OutputType)'=='WinExe') AND
|
||||
!('$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(PlatformTarget)' == '') AND
|
||||
'$(SuppressOnnxRuntimePlatformCompatibilityError)' != 'true'"
|
||||
Text="Microsoft.ML.OnnxRuntime only supports the x64 platform at this time."/>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
Loading…
Reference in a new issue