Skip to content

Commit

Permalink
Merge pull request #2218 from mavlink/move-to-zlib-ng
Browse files Browse the repository at this point in the history
Move to zlib-ng which has better CMake support
  • Loading branch information
julianoes authored Feb 13, 2024
2 parents 675a5af + 5aead1e commit 65a8530
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (SUPERBUILD)

if(NOT BUILD_WITHOUT_CURL)
if(NOT IOS)
build_target(zlib)
build_target(zlib-ng)
endif()
build_target(curl)
endif()
Expand Down
36 changes: 36 additions & 0 deletions third_party/zlib-ng/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
cmake_minimum_required(VERSION 3.1)

project(external-zlib-ng)
include(ExternalProject)

list(APPEND CMAKE_ARGS
"-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}"
"-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}"
"-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}"
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
"-DBUILD_SHARED_LIBS=OFF"
"-DZLIB_COMPAT=ON"
"-DZLIB_ENABLE_TESTS=OFF"
"-DWITH_GTEST=OFF"
)

if(IOS)
list(APPEND CMAKE_ARGS
"-DPLATFORM=${PLATFORM}"
"-DDEPLOYMENT_TARGET=${DEPLOYMENT_TARGET}"
"-DENABLE_STRICT_TRY_COMPILE=${ENABLE_STRICT_TRY_COMPILE}"
)
endif()

message(STATUS "Preparing external project \"zlib-ng\" with args:")
foreach(CMAKE_ARG ${CMAKE_ARGS})
message(STATUS "-- ${CMAKE_ARG}")
endforeach()

ExternalProject_add(
zlib-ng
URL https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.6.tar.gz
PREFIX zlib-ng
CMAKE_ARGS "${CMAKE_ARGS}"
)

0 comments on commit 65a8530

Please sign in to comment.