From bc92a280186f9becc53c0f17e4e43cfbdeec7e7b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 27 Jul 2023 11:07:54 +0200 Subject: [PATCH] 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 --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) 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) -- 2.30.2