Skip to content

Commit

Permalink
[zlib-ng] Support zlib compatibility mode (#43147)
Browse files Browse the repository at this point in the history
Co-authored-by: Kai Pastor <[email protected]>
  • Loading branch information
donny-dont and dg0yt authored Jan 9, 2025
1 parent 1420fe2 commit 3a7ee56
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
14 changes: 13 additions & 1 deletion ports/zlib-ng/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ vcpkg_from_github(
HEAD_REF develop
)

# Set ZLIB_COMPAT in the triplet file to turn on
if(NOT DEFINED ZLIB_COMPAT)
set(ZLIB_COMPAT OFF)
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-DZLIB_FULL_VERSION=${ZLIB_FULL_VERSION}"
-DZLIB_ENABLE_TESTS=OFF
-DWITH_NEW_STRATEGIES=ON
-DZLIB_COMPAT=${ZLIB_COMPAT}
OPTIONS_RELEASE
-DWITH_OPTIM=ON
)
Expand Down Expand Up @@ -46,7 +52,13 @@ if(VCPKG_TARGET_IS_WINDOWS AND (NOT (VCPKG_LIBRARY_LINKAGE STREQUAL static AND V
endif()

vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/zlib-ng)

if(ZLIB_COMPAT)
set(_cmake_dir "ZLIB")
else()
set(_cmake_dir "zlib-ng")
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${_cmake_dir})

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/include"
Expand Down
1 change: 1 addition & 0 deletions ports/zlib-ng/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "zlib-ng",
"version": "2.2.3",
"port-version": 1,
"description": "zlib replacement with optimizations for 'next generation' systems",
"homepage": "https://github.com/zlib-ng/zlib-ng",
"license": "Zlib",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -10014,7 +10014,7 @@
},
"zlib-ng": {
"baseline": "2.2.3",
"port-version": 0
"port-version": 1
},
"zlmediakit": {
"baseline": "2024-09-29",
Expand Down
5 changes: 5 additions & 0 deletions versions/z-/zlib-ng.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8282d357a50be706405e9aed44a79a333a8e8af1",
"version": "2.2.3",
"port-version": 1
},
{
"git-tree": "ed44efd13b274af9870aaf05424d1f1b9558b230",
"version": "2.2.3",
Expand Down

0 comments on commit 3a7ee56

Please sign in to comment.