Updated the .targets file to a new set of copy rules:
- always copy, unless ShouldIncludeNativeSkiaSharp=True - copy all platforms on AnyCPU
This commit is contained in:
Родитель
fb593a0f08
Коммит
8ecf8370ea
|
@ -2,19 +2,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<!-- if ShouldIncludeNativeSkiaSharp == False then don't include the native libSkiaSharp -->
|
||||
<!-- if IsLibraryOutputType == True then don't copy the native files as they will be copied by the app -->
|
||||
<PropertyGroup>
|
||||
<!-- set the variable to true whenever they should be -->
|
||||
<IsLibraryOutputType Condition=" '$(IsLibraryOutputType)' == '' and '$(OutputType)' == 'Library' ">True</IsLibraryOutputType>
|
||||
<ShouldIncludeNativeSkiaSharp Condition=" '$(ShouldIncludeNativeSkiaSharp)' == '' and '$(IsLibraryOutputType)' != 'True' ">True</ShouldIncludeNativeSkiaSharp>
|
||||
|
||||
<!-- set the final values based on the variables -->
|
||||
<IsLibraryOutputType Condition=" '$(IsLibraryOutputType)' == '' ">False</IsLibraryOutputType>
|
||||
<ShouldIncludeNativeSkiaSharp Condition=" '$(ShouldIncludeNativeSkiaSharp)' == '' and '$(IsLibraryOutputType)' == 'True' ">False</ShouldIncludeNativeSkiaSharp>
|
||||
<ShouldIncludeNativeSkiaSharp Condition=" '$(ShouldIncludeNativeSkiaSharp)' == '' ">True</ShouldIncludeNativeSkiaSharp>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- add the native x86 Windows library -->
|
||||
<ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(Platform)' == 'x86' and '$(OS)' != 'Unix' ">
|
||||
<ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(PlatformTarget)' == 'x86' and '$(OS)' != 'Unix' ">
|
||||
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x86\native\libSkiaSharp.dll">
|
||||
<Link>libSkiaSharp.dll</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
|
@ -22,19 +15,24 @@
|
|||
</ItemGroup>
|
||||
|
||||
<!-- add the native x64 Windows library -->
|
||||
<ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(Platform)' == 'x64' and '$(OS)' != 'Unix' ">
|
||||
<ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(PlatformTarget)' == 'x64' and '$(OS)' != 'Unix' ">
|
||||
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x64\native\libSkiaSharp.dll">
|
||||
<Link>libSkiaSharp.dll</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- make sure Windows is x86 or x64 -->
|
||||
<Target Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(Platform)' != 'x64' and '$(Platform)' != 'x86' and '$(OS)' != 'Unix' "
|
||||
Name="CheckSkiaPlatforms"
|
||||
BeforeTargets="Build">
|
||||
<Error Text="The Platform needs to be either x64 or x86 to support Skia in Windows." />
|
||||
</Target>
|
||||
<!-- copy both native Windows libraries for Any CPU -->
|
||||
<ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(PlatformTarget)' != 'x64' and '$(PlatformTarget)' != 'x86' and '$(OS)' != 'Unix' ">
|
||||
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x86\native\libSkiaSharp.dll">
|
||||
<Link>x86\libSkiaSharp.dll</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x64\native\libSkiaSharp.dll">
|
||||
<Link>x64\libSkiaSharp.dll</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- add the native OSX library -->
|
||||
<ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(OS)' == 'Unix' ">
|
||||
|
|
Загрузка…
Ссылка в новой задаче