Skip to content
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

Merged
merged 2 commits into from
Jan 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@ 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).
#
################################################################################

function(make_version_script header ns lib)
Expand Down
8 changes: 7 additions & 1 deletion cmake/ModulePackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ function(add_module lib)

if(ENABLE_SHARED)
add_library(${lib}_shared SHARED ${ARGN})
set_target_properties(${lib}_shared PROPERTIES OUTPUT_NAME ${lib})
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. Change this, when releasing 1.0!
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
)
install(TARGETS ${lib}_shared DESTINATION "lib")
endif()
if(ENABLE_STATIC)
Expand Down