File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ build_dependency_with_cmake (ZLIB
8585 -D BUILD_SHARED_LIBS =${ZLIB_BUILD_SHARED_LIBS}
8686 -D CMAKE_POSITION_INDEPENDENT_CODE =ON
8787 -D CMAKE_INSTALL_LIBDIR=lib
88+ # Fix for zlib breaking against cmake 4.0.
89+ # Remove when zlib is fixed to declare its own minimum high enough.
90+ -D CMAKE_POLICY_VERSION_MINIMUM=3.5
8891 ${ZLIB_BUILD_OPTIONS}
8992 )
9093
Original file line number Diff line number Diff line change @@ -44,13 +44,19 @@ check_is_enabled(ZLIBNG ENABLE_ZLIBNG)
4444check_is_enabled(ZLIB ALLOW_ZLIB)
4545
4646if (ENABLE_ZLIBNG)
47+ # For zlib <= 1.3.1, we can differentiate between whether
48+ # find_package(ZLIB ...) finds zlib-ng or zlib with the CONFIG
49+ # or PREFER_CONFIG options.
4750 if (ALLOW_ZLIB)
51+ # Prefer zlib-ng if it's available, but fail over to zlib if it isn't.
4852 checked_find_package (ZLIB PREFER_CONFIG REQUIRED)
4953 else ()
50- # This assumption will hold until zlib-1.3.2 is released.
5154 checked_find_package (ZLIB CONFIG REQUIRED)
5255 endif ()
5356else ()
57+ # Starting v1.3.2, zlib will export CMake configs; so once zlib-1.3.2+
58+ # starts shipping with distros, we will have to re-evaluate how (and if)
59+ # we support "ignoring" compatibility-mode-zlib-ng in favor of system zlib.
5460 checked_find_package (ZLIB REQUIRED)
5561endif ()
5662
You can’t perform that action at this time.
0 commit comments