Open nieder opened 2 years ago
I am a bit hesitant as the feature was introduced in cmake 3.17 and that's the version that I have installed as latest on my system. Pretty new? I don't know about the current cmake support in the common distros around. May be that needs an ifelse() somehow ... and I am not sure if a liberal value is the way to go here. I will keep this patch open so that people are informed how to fix the mac issue if needed.
Latest upstream is 3.24.1. Don't know which distro is still carrying 3.17 (Debian stable is 3.18.4; Ubuntu Jammy is at 3.22), and 3.17 seems to have come out in 2020). This issue has been common when switching from autotools (libtool really) versioning to cmake versioning. Once the SOVERSION gets bumped in zziplib, then this will be moot.
To patch this locally, have any interfaces been added, removed, or changed between zziplib 0.13.62 and 0.13.72? This will help me figure out which way I should change MACHO_COMPATIBILITY_VERSION. Thanks.
Please finally fix this two-year-old issue.
On macOS, the old autotools release (tested with 0.13.62) creates the library libzzip-0.13.dylib with a compatibility_version of 14.0.0. But the cmake build (tested with 0.13.72) has a compatibility_version of 13.0.0. This means that anything linked against 0.13.62 will fail if zziplib is upgraded to 0.13.72 because the compat_version decreased.
Setting
MACHO_COMPATIBILITY_VERSION
to14.0.0
will fix this (or higher if new interfaces have been added between 0.13.62 and 0.13.72). This change does not affect the install_name (SOVERSION) of the library. And if the install_name for the libraries is ever increased, you can remove setting MACHO_COMPATIBILITY_VERSION because then SOVERSION will take precedence and it will a new one that autotools never saw.https://cmake.org/cmake/help/git-stage/prop_tgt/MACHO_COMPATIBILITY_VERSION.html
Sample code change in zzip/CMakeLists.txt (but needs to be done for the 4 libraries)