Skip to content

Commit

Permalink
build: add soname to shared libraries
Browse files Browse the repository at this point in the history
Use API level as soname to enable applications to select
and link agains shared libraries based on their SO versions.
  • Loading branch information
bkmgit committed Oct 28, 2024
1 parent 47c52cb commit d46ec1d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ set (Seastar_DPDK_MACHINE

project (Seastar
VERSION 1.0
DESCRIPTION "Event driven asynchronous programming framework"
HOMEPAGE_URL "http://seastar.io/"
LANGUAGES CXX)

set (Seastar_ALLOC_FAILURE_INJECTION
Expand Down Expand Up @@ -780,6 +782,11 @@ add_library (seastar
src/websocket/server.cc
)

# Shared library soname
set_target_properties(seastar PROPERTIES
VERSION ${Seastar_API_LEVEL}
SOVERSION ${Seastar_API_LEVEL})

# We disable _FORTIFY_SOURCE because it generates false positives with longjmp() (src/core/thread.cc)
set_source_files_properties(src/core/thread.cc
PROPERTIES COMPILE_FLAGS -U_FORTIFY_SOURCE)
Expand Down Expand Up @@ -1174,6 +1181,10 @@ if (Seastar_INSTALL OR Seastar_TESTING)
src/testing/seastar_test.cc
src/testing/test_runner.cc)

set_target_properties(seastar_testing PROPERTIES
VERSION ${Seastar_API_LEVEL}
SOVERSION ${Seastar_API_LEVEL})

add_library (Seastar::seastar_testing ALIAS seastar_testing)

target_compile_definitions (seastar_testing
Expand All @@ -1193,6 +1204,9 @@ if (Seastar_INSTALL OR Seastar_TESTING)
include/seastar/testing/perf_tests.hh
tests/perf/perf_tests.cc
tests/perf/linux_perf_event.cc)
set_target_properties(seastar_perf_testing PROPERTIES
VERSION ${Seastar_API_LEVEL}
SOVERSION ${Seastar_API_LEVEL})
add_library (Seastar::seastar_perf_testing ALIAS seastar_perf_testing)
target_compile_definitions (seastar_perf_testing
PRIVATE ${Seastar_PRIVATE_COMPILE_DEFINITIONS})
Expand Down

0 comments on commit d46ec1d

Please sign in to comment.