[minizip-ng] Add zlib-ng feature for zlib compression#52636
Conversation
minizip-ng supports building against zlib-ng (via MZ_ZLIB_FLAVOR) instead of the original zlib. Add a `zlib-ng` feature that pulls in the zlib-ng port and selects the zlib-ng flavor explicitly, and pin the existing `zlib` feature to the zlib flavor (replacing the CMAKE_DISABLE_FIND_PACKAGE hack). Resolves microsoft#52615.
| ] | ||
| }, | ||
| "zlib-ng": { | ||
| "description": "Enables ZLIB compression using zlib-ng instead of zlib", |
There was a problem hiding this comment.
VCPKG has a no alternatives rule and this can't be used together with zlib.
There was a problem hiding this comment.
oh okay, I apologize or should we switch the default to zlib-ng?
There was a problem hiding this comment.
For me that'd make sense but it'd be a breaking changes so I guess it needs the maintainers to decide.
There was a problem hiding this comment.
not really, actually. At most, minizip-ng would link to zlib-ng (non-compat mode in the vcpkg port -> zng_* symbols) instead of zlib. Everyone running vcpkg install minizip-ng would suddenly get a different dependency (zlib-ng replacing zlib) out of nowhere
There was a problem hiding this comment.
Everyone running vcpkg install minizip-ng would suddenly get a different dependency (zlib-ng replacing zlib) out of nowhere
Yeah but that'd then conflict with other libs depending on normal zlib.
There was a problem hiding this comment.
seems like I'm going to close this PR. vcpkg actually wants an overlay port instead of changing the default upstream port, although zlib-ng is definitely better performance-wise.
but again thanks dude!
Fixes #52615.
minizip-ng (a project under the zlib-ng umbrella) can build its zlib compression against either the original zlib or zlib-ng, selected via the upstream MZ_ZLIB_FLAVOR option. Previously the port hard-depended on zlib and explicitly disabled zlib-ng detection.
This PR adds a
zlib-ngfeature that pulls in the zlib-ng port and selects the zlib-ng flavor, while pinning the existingzlibfeature to the zlib flavor. Pinning the flavor explicitly also lets us drop the CMAKE_DISABLE_FIND_PACKAGE_ZLIBNG workaround.Built and verified on x64-linux: the default (zlib) build links against zlib, and the new zlib-ng feature links against zlib-ng. Both configurations build successfully.