forked from dotnet/machinelearning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support packages.config (dotnet#165)
Copy our native assemblies using MSBuild when a consumer is using NuGet packages.config, since NuGet doesn't do this automatically. Also, add an error when a project is not targeting x64. ML.NET only supports x64. Fix dotnet#93
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<!-- | ||
NuGet packages.config doesn't support native assemblies automatically, | ||
so copy the native assemblies to the output directory. | ||
--> | ||
<ItemGroup Condition="Exists('packages.config') OR | ||
Exists('$(MSBuildProjectName).packages.config') OR | ||
Exists('packages.$(MSBuildProjectName).config')"> | ||
<Content Include="$(MSBuildThisFileDirectory)\..\runtimes\win-x64\native\*.dll" | ||
Condition="'$(PlatformTarget)' == 'x64'"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<Visible>false</Visible> | ||
</Content> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<PropertyGroup> | ||
<EnableMLUnsupportedPlatformTargetCheck Condition="'$(EnableMLUnsupportedPlatformTargetCheck)' == ''">true</EnableMLUnsupportedPlatformTargetCheck> | ||
</PropertyGroup> | ||
|
||
<Target Name="_CheckForUnsupportedPlatformTarget" | ||
Condition="'$(EnableMLUnsupportedPlatformTargetCheck)' == 'true'" | ||
AfterTargets="_CheckForInvalidConfigurationAndPlatform"> | ||
|
||
<!-- | ||
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)' == '')" | ||
Text="Microsoft.ML currently supports 'x64' processor architectures. Please ensure your application is targeting 'x64'." /> | ||
</Target> | ||
|
||
</Project> |