summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich2023-07-27 09:07:54 +0000
committerJo-Philipp Wich2023-07-27 09:59:13 +0000
commitbc92a280186f9becc53c0f17e4e43cfbdeec7e7b (patch)
tree9a9aa8a6cd2f66d0c8d007411b61be66cd63fcd3
parentd433990c00e804593f253cc709b8fe901492b530 (diff)
downloadlibnl-tiny-bc92a280186f9becc53c0f17e4e43cfbdeec7e7b.tar.gz
build: allow passing SOVERSION value for dynamic library
In order to prepare for proper ABI handling in the OpenWrt package of libnl-tiny, add an option to specify the library SOVERSION value when invoking CMake. Let the library SOVERSION default to `1` as first ABI version as the library is stable and there's been no incompatible changes since it's inception in 2009. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c780c96..ef32dad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,12 @@ SET(SOURCES
socket.c
unl.c
)
+
+SET(SOVERSION 1 CACHE STRING "Override libnl-tiny library version")
+
ADD_LIBRARY(nl-tiny SHARED ${SOURCES})
+SET_TARGET_PROPERTIES(nl-tiny PROPERTIES SOVERSION ${SOVERSION})
+
ADD_LIBRARY(nl-tiny-static STATIC ${SOURCES})
SET_TARGET_PROPERTIES(nl-tiny-static PROPERTIES OUTPUT_NAME nl-tiny)