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 cd7be4b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ set (Seastar_DPDK_MACHINE
STRING
"Configure DPDK for this processor architecture (if `Seastar_DPDK` is enabled). It configures -march or -mcpu")

# Release version
set (Seastar_VERSION "22.11.0")

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

set (Seastar_ALLOC_FAILURE_INJECTION
Expand Down Expand Up @@ -780,6 +785,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 +1184,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 +1207,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 cd7be4b

Please sign in to comment.