Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[submodule "external/libzip"]
path = external/libzip
url = https://github.com/nih-at/libzip.git
branch = master
branch = rel-1-5-1
[submodule "external/LibZipSharp"]
path = external/LibZipSharp
url = https://github.com/grendello/LibZipSharp.git
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ SOLUTION = Xamarin.Android.sln
TEST_TARGETS = build-tools/scripts/RunTests.targets
API_LEVEL ?=

ifeq ($(OS_NAME),Darwin)
export MACOSX_DEPLOYMENT_TARGET := 10.11
endif

ifneq ($(V),0)
MONO_OPTIONS += --debug
endif
Expand Down
2 changes: 1 addition & 1 deletion external/LibZipSharp
2 changes: 1 addition & 1 deletion external/libzip
Submodule libzip updated 551 files
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Content Include="$(XAInstallPrefix)xbuild\Xamarin\Android\libzip.3.0.dylib">
<Content Include="$(XAInstallPrefix)xbuild\Xamarin\Android\libzip.5.0.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/libzip-windows/libzip-windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />
<PropertyGroup>
<BuildDependsOnLocal Condition=" '$(HostOS)' == 'Darwin' ">
<BuildDependsOnLocal Condition=" '$(HostOS)' == 'Darwin' Or '$(HostOS)' == 'Linux' ">
ResolveReferences;
_BuildUnlessCached
</BuildDependsOnLocal>
Expand Down
21 changes: 17 additions & 4 deletions src/libzip-windows/libzip-windows.projitems
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(HostOS)' == 'Linux' ">
<CMakeBinary32>\usr\bin\cmake</CMakeBinary32>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why explicitly qualify cmake instead of relying on $PATH, as is done for macOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also build cmake as part of mxe and I want to be explicit that we run (we MUST run) the system one because it's the "native" one and we're configuring a cross build using a "native" toolchain (mingw). Linux currently doesn't build mxe (Ubuntu and friends) but it's not unlikely that some distro will need to build it for one reason or another. I don't want to have any ambiguities

<CMakeBinary64>$(CMakeBinary32)</CMakeBinary64>
<CMakeFlags32>-DCMAKE_TOOLCHAIN_FILE=$(MSBuildThisFileDirectory)\mingw-linux-32.cmake</CMakeFlags32>
<CMakeFlags64>-DCMAKE_TOOLCHAIN_FILE=$(MSBuildThisFileDirectory)\mingw-linux-64.cmake</CMakeFlags64>
</PropertyGroup>
<PropertyGroup Condition=" '$(HostOS)' == 'Darwin' ">
<CMakeBinary64>cmake</CMakeBinary64>
<CMakeBinary32>cmake</CMakeBinary32>
<CMakeCommonFlags>-DCMAKE_SYSTEM_NAME=Windows -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DBUILD_SHARED_LIBS=ON</CMakeCommonFlags>
<CMakeFlags32>$(CMakeCommonFlags) -DCMAKE_C_COMPILER=$(AndroidMxeFullPath)\bin\$(MingwCommandPrefix32)-gcc -DCMAKE_CXX_COMPILER=$(AndroidMxeFullPath)\bin\$(MingwCommandPrefix32)-g++ -DCMAKE_RC_COMPILER=$(AndroidMxeFullPath)\bin\$(MingwCommandPrefix32)-windres -DCMAKE_FIND_ROOT_PATH=$(AndroidMxeFullPath)\$(MingwCommandPrefix32)</CMakeFlags32>
<CMakeFlags64>$(CMakeCommonFlags) -DCMAKE_C_COMPILER=$(AndroidMxeFullPath)\bin\$(MingwCommandPrefix64)-gcc -DCMAKE_CXX_COMPILER=$(AndroidMxeFullPath)\bin\$(MingwCommandPrefix64)-g++ -DCMAKE_RC_COMPILER=$(AndroidMxeFullPath)\bin\$(MingwCommandPrefix64)-windres -DCMAKE_FIND_ROOT_PATH=$(AndroidMxeFullPath)\$(MingwCommandPrefix64)</CMakeFlags64>
</PropertyGroup>
<ItemGroup>
<_LibZipTarget Include="host-mxe-Win64" Condition="$(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win64:'))">
<CMake>$(AndroidMxeFullPath)\bin\x86_64-w64-mingw32.static-cmake</CMake>
<CMakeFlags></CMakeFlags>
<CMake>$(CMakeBinary64)</CMake>
<CMakeFlags>$(CMakeFlags64)</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>
<CMake>$(CMakeBinary32)</CMake>
<CMakeFlags>$(CMakeFlags32)</CMakeFlags>
<OutputLibrary>libzip.dll</OutputLibrary>
<OutputLibraryPath>lib/libzip.dll</OutputLibraryPath>
</_LibZipTarget>
Expand Down
20 changes: 20 additions & 0 deletions src/libzip-windows/mingw-linux-32.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(BUILD_SHARED_LIBS ON)
20 changes: 20 additions & 0 deletions src/libzip-windows/mingw-linux-64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(BUILD_SHARED_LIBS ON)
13 changes: 13 additions & 0 deletions src/libzip/CMakeCacheInitialOSX.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Force minimum macOS version to be 10.11 as this is the oldest version of the OS we support.
# Setting this on command line won't work, for some reason, so we override the value her
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "Minimum OS X deployment version" FORCE)

# This is necessary when cmake runs on a 10.11 system with Xcode 8.x installed in which case
# the headers (and SDK libraries) target a later version of macOS but the host OS might not
# have some functions found. `clonefile` is one of them - it was added in 10.12. Cmake will
# happily "detect" clonefile even though the *host* OS doesn't have it which results in the
# library being build but failing to load.
#
# Forcing a cache entry here will override the detection result, even though cmake will *still*
# show clonefile as found in the detection output.
set(HAVE_CLONEFILE "" CACHE INTERNAL "Force 10.11 compatibility on XA build bots" FORCE)
8 changes: 4 additions & 4 deletions src/libzip/libzip.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<ItemGroup>
<_LibZipTarget Include="host-Darwin" Condition="$(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':Darwin:'))">
<CMake>cmake</CMake>
<CMakeFlags>-DCMAKE_OSX_ARCHITECTURES=&quot;i386;x86_64&quot;</CMakeFlags>
<OutputLibrary>libzip.3.0.dylib</OutputLibrary>
<OutputLibraryPath>lib/libzip.3.0.dylib</OutputLibraryPath>
<CMakeFlags>-C$(MSBuildThisFileDirectory)/CMakeCacheInitialOSX.txt -DCMAKE_OSX_ARCHITECTURES=&quot;i386;x86_64&quot; -DBUILD_SHARED_LIBS=ON</CMakeFlags>
<OutputLibrary>libzip.5.0.dylib</OutputLibrary>
<OutputLibraryPath>lib/libzip.5.0.dylib</OutputLibraryPath>
</_LibZipTarget>
<_LibZipTarget Include="host-Linux" Condition="$(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':Linux:')) AND '$(_LinuxBuildLibZip)' == 'true' ">
<CMake>cmake</CMake>
<CMakeFlags></CMakeFlags>
<CMakeFlags>-DBUILD_SHARED_LIBS=ON</CMakeFlags>
<OutputLibrary>libzip.so</OutputLibrary>
<OutputLibraryPath>lib/libzip.so</OutputLibraryPath>
</_LibZipTarget>
Expand Down
2 changes: 1 addition & 1 deletion src/libzip/libzip.targets
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
Inputs="@(_LibZipTargetMakefile)"
Outputs="@(Content)">
<Exec
Command="make"
Command="make VERBOSE=1"
WorkingDirectory="$(IntermediateOutputPath)\%(_LibZipTarget.Identity)"
/>
<Copy
Expand Down