zlib: reflect correct library name on Windows mingw #26165
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Changes to recipe: zlib
Motivation
Close #14440
Details
Fix an issue where if zlib is built with clang on msys2/clang64 - the library in cpp_info does not match the generated files
Note that this is a legacy bug as a result of zlib: fix lib name in CMakeLists directly instead of fragile renaming #10771, perhaps to work around a Conan limitation at the time. Nowadays we wouldn't accept a recipe that modifies the generated library files, and cpp_info should merely reflect the generated files - but we also can't undo that now, because renaming libraries across recipe revisions would cause widespread issues.
Note that as a result of the aforementioned PR, windows + msys2/clang + zlib with shared=True will not build - no attempt is made in this PR to fix this.
tested on Windows to work with:
msvc
(shared and static)clang-cl
from an msvc installation (shared and static)gcc14
mingw (shared and static)clang19
msys2 (static only, for shared lld does not accept--version-script
)