-
Notifications
You must be signed in to change notification settings - Fork 291
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
CMake: Add soversion to library files to generate proper symlinks #394
Conversation
0.1.2 is compatible with 0.1.3. Is this reflected by the sonames in this PR? |
I just read a bit more about sonames and it seems what I have done is not correct. The soname version should only change when incompatible changes are made, so as far as I see, we should only provide the |
Ideally the cmake variant should be in sync with the .so version in autoconf, have a look at: Maybe we could even come up with a configuration file where this can be set for both build systems. |
Using the MAJOR number will be in sync with the autotools:
output above is the same for autotools and cmake now. after last commit the following files are generated:
To have everything in sync we only need to adjust the version in |
While we're on 0.x, the x behaves like the major version. 0.2 will be incompatible with 0.1. |
okay, changed that, also removed the version from static library as these do not support a versioning concept. |
@@ -611,6 +611,10 @@ endif() | |||
# | |||
# :: Strict ABI | |||
# | |||
# Enabling the STRICT_ABI flag will generate and use an LD version script. | |||
# It ensures that the dynamic libraries (libtoxcore.so, libtoxav.so) only | |||
# export the symbols that are defined in their public API (tox.h and toxav.h, respectively). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break the line at 80 columns.
set_target_properties(${lib}_shared PROPERTIES | ||
OUTPUT_NAME ${lib} | ||
VERSION ${PROJECT_VERSION} | ||
# While on 0.x, the x behaves like the major version. 0.2 will be incompatible with 0.1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Reviewed 1 of 2 files at r1, 1 of 1 files at r4. Comments from Reviewable |
Rebase and squash the commits, then I'll merge. |
This part has been added in TokTok@67ac913 Took the commit message to provide a comment in the file.
As mentioned in TokTok#359 (comment) the current CMake build does not generate version symlinks for library .so files. This is because the version is not specified for library targets. See - https://cmake.org/cmake/help/v3.0/prop_tgt/SOVERSION.html#prop_tgt:SOVERSION - https://cmake.org/cmake/help/v3.0/prop_tgt/VERSION.html#prop_tgt:VERSION Use PROJECT_VERSION_MAJOR and MINOR for SOVERSION because api may break from 0.1 to 0.2 in the 0.x release cycle.
done. |
Reviewed 2 of 2 files at r5. Comments from Reviewable |
Reviewed 2 of 2 files at r5. cmake/ModulePackage.cmake, line 59 at r5 (raw file):
it sounds like CMake expects the https://cmake.org/cmake/help/v2.8.6/cmake.html#prop_tgt:VERSION Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. cmake/ModulePackage.cmake, line 59 at r5 (raw file): Previously, nurupo wrote…
Nevermind, CeBe seems to know better what he is doing. Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions. CMakeLists.txt, line 616 at r4 (raw file): Previously, iphydf wrote…
Done. cmake/ModulePackage.cmake, line 60 at r4 (raw file): Previously, iphydf wrote…
Done. cmake/ModulePackage.cmake, line 59 at r5 (raw file): Previously, nurupo wrote…
Done. Comments from Reviewable |
Reviewed 2 of 2 files at r5. Comments from Reviewable |
As mentioned in #359 (comment)
the current CMake build does not generate version symlinks for library .so files.
This is because the version is not specified for library targets.
See
I have usedupdated: changed this, see comments below.VERSION
instead ofSOVERSION
as this seems to becompatible with windows according to the docs linked above.
I have compared installed files with autotools build vs. cmake:
autotools:
cmake:
This change is