-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zlib: fix lib name in CMakeLists directly instead of fragile renaming #10771
Conversation
I detected other pull requests that are modifying zlib/all recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
This comment has been minimized.
This comment has been minimized.
Well, it may generate a different dll name for MinGW (it should be No change for msvc, but like MinGW, build files are not consistent upstream (less discrepancy after our patch, only import lib differs): see madler/zlib#652 |
Do you think we should honor import lib name from https://github.com/madler/zlib/blob/v1.2.12/win32/Makefile.msc#L16-L18 for Visual Studio ( |
Linux systems would just provide both by providing a symbolic link. FindZLIB.cmake looks for all names, but higher priority to I've not tested building packages with a shared zlib dependency, but can assume most autotools libraries will happily use If some dependency breaks, we can fix that dependency only by e.g. a patch or copying |
It's always
I'm not afraid by FindZLIB, it tests all flavors, even weird ones.
It would be |
I think we have 2 major possible issues:
IOW, there will always be risks. |
@madebr what about non-autotools projects? e.g. ffmpeg: https://github.com/FFmpeg/FFmpeg/blob/master/configure#L4585 |
For ffmpeg, I guess something like https://github.com/FFmpeg/FFmpeg/blob/710dce131fdb6c1ebec1f26a7a4173d82d828330/configure#L4585 should be patched dynamically like we do already for several handwritten Makefiles hardcoding a specific flavor of their dependencies. |
Same as for vcxproj: pray we don't need to do deep surgery. |
Removing the |
You have to recompile msvc debug binaries which have a dependency to zlib shared. |
There is a conan flag --build outdated --build cascade for this |
@SpaceIm The debug postfix shouldn't have been removed. It shouldn't be up to package maintainers to choose the output of the build. zlib uses a postfix, and thus, the conan package should too. |
zlib doesn't have a consistent naming convention for windows, and doesn't add a postfix in 2 build files among the 3 available for Visual Studio. For simplicity and to be able to fix original issue related to this PR, we follow Makefile.msvc convention of upstream project instead of conventions in its CMakeLists. See madler/zlib#652 Nobody should assume a specific zlib file name on Windows, it can be any of these names depending on which build file has been used: zlib.lib, zdll.lib, zlibstat.lib, zlibwapi.lib, zlibstatic.lib, zlibstaticd.lib, zlibd.lib |
@SpaceIm (sorry for image, they don't have a github apparently). In the context of conan consuming conan producing conan, I think it doesn't really matter. But I'm guessing we aren't alone in a "conan adoption" state where conan must live side-by-side our (horrible) legacy systems. It must integrate and "play ball" with other systems for the time being, until conan conquers the world ;) We can agree to disagree, but I strongly believe this was a mistake. Though maybe I don't understand the true motivation behind the change, it's breaking a lot of our builds. |
As I said, there is no convention in zlib repo, so you can't assume that a package manager would have used upstream CMakeList to build zlib. Upstream Makefile.msvc or MSBuild files produce different file names. Anyway, this PR didn't remove d postfix, it was already removed before as a post process during packaging. |
closes #10770
I don't know whether it was a good idea in the first place to rename zlibstatic on Windows, and remove d postfix for debug build type, but now it's done directly in CMakeLists with simple criteria (
zlib
for Windows,z
for other platforms).