Skip to content

Commit

Permalink
[libzip-windows] use libzip.dll and zlib.dll from NuGet
Browse files Browse the repository at this point in the history
When bumping libzip in dotnet#874 or dotnet#863 libzip is no longer building under
mxe. We can switch to using the NuGet packages instead.

Also switched to using `<Content />` to link in the files, which works
better if `<ProjectReference />` is used with `libzip-windows.mdproj`.
  • Loading branch information
jonathanpeppers committed Sep 19, 2017
1 parent 763959e commit 45f54bf
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 50 deletions.
16 changes: 0 additions & 16 deletions build-tools/libzip-windows/libzip-windows.mdproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,7 @@
<OutputPath>$(XAInstallPrefix)xbuild\Xamarin\Android\</OutputPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />
<PropertyGroup>
<BuildDependsOnLocal Condition=" '$(HostOS)' == 'Darwin' ">
ResolveReferences;
_BuildUnlessCached
</BuildDependsOnLocal>
</PropertyGroup>
<Import Project="libzip-windows.props" />
<Import Project="libzip-windows.projitems" />
<Import Project="libzip-windows.targets" />
<Import Project="..\libzip\libzip.targets" />
<ItemGroup>
<ProjectReference Include="..\android-toolchain\android-toolchain.mdproj" Condition=" '$(HostOS)' != 'Windows' ">
<Project>{8FF78EB6-6FC8-46A7-8A15-EBBA9045C5FA}</Project>
<Name>android-toolchain</Name>
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Target Name="Build" DependsOnTargets="$(BuildDependsOnLocal)" Condition=" '$(HostOS)' != 'Windows' " />
<Target Name="Clean" />
</Project>
41 changes: 17 additions & 24 deletions build-tools/libzip-windows/libzip-windows.projitems
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<_LibZipTarget Include="host-mxe-Win64" Condition="$(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win64:'))">
<CMake>$(AndroidMxeFullPath)\bin\x86_64-w64-mingw32.static-cmake</CMake>
<CMakeFlags></CMakeFlags>
<OutputLibrary>x64/libzip.dll</OutputLibrary>
<OutputLibraryPath>lib/libzip.dll</OutputLibraryPath>
</_LibZipTarget>
<_LibZipTarget Include="host-mxe-Win32" Condition="$(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win32:'))">
<CMake>$(AndroidMxeFullPath)\bin\i686-w64-mingw32.static-cmake</CMake>
<CMakeFlags></CMakeFlags>
<OutputLibrary>libzip.dll</OutputLibrary>
<OutputLibraryPath>lib/libzip.dll</OutputLibraryPath>
</_LibZipTarget>
<_NuGetBinary Include="..\..\external\LibZipSharp\bin\$(OS)\$(Configuration)\libzip.dll">
<Destination>libzip.dll</Destination>
</_NuGetBinary>
<_NuGetBinary Include="..\..\external\LibZipSharp\bin\$(OS)\$(Configuration)\zlib.dll">
<Destination>zlib.dll</Destination>
</_NuGetBinary>
<_NuGetBinary Include="..\..\external\LibZipSharp\bin\$(OS)\$(Configuration)\x64\libzip.dll">
<Destination>x64\libzip.dll</Destination>
</_NuGetBinary>
<_NuGetBinary Include="..\..\external\LibZipSharp\bin\$(OS)\$(Configuration)\x64\zlib.dll">
<Destination>x64\zlib.dll</Destination>
</_NuGetBinary>
<None Include="packages.config" />
<Content Include="..\..\packages\libzip.redist.1.1.2.7\build\native\bin\Win32\v140\Release\zip.dll">
<Link>libzip.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\bin\v140\Win32\Release\dynamic\cdecl\zlib.dll">
<Link>zlib.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\..\packages\libzip.redist.1.1.2.7\build\native\bin\x64\v140\Release\zip.dll">
<Link>x64\libzip.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\bin\v140\x64\Release\dynamic\cdecl\zlib.dll">
<Link>x64\zlib.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
10 changes: 0 additions & 10 deletions build-tools/libzip-windows/libzip-windows.targets
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Build"
Condition=" '$(HostOS)' == 'Windows' "
Inputs="@(_NuGetBinary)"
Outputs="@(_NuGetBinary->'$(OutputPath)%(Destination)')">
<Copy
SourceFiles="@(_NuGetBinary)"
DestinationFiles="@(_NuGetBinary->'$(OutputPath)%(Destination)')"
SkipUnchangedFiles="True"
/>
</Target>
</Project>
5 changes: 5 additions & 0 deletions build-tools/libzip-windows/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="libzip.redist" version="1.1.2.7" />
<package id="grpc.dependencies.zlib.redist" version="1.2.8.10" />
</packages>

0 comments on commit 45f54bf

Please sign in to comment.