From: Jo-Philipp Wich Date: Thu, 27 Jul 2023 09:07:54 +0000 (+0200) Subject: build: allow passing SOVERSION value for dynamic library X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=bc92a280186f9becc53c0f17e4e43cfbdeec7e7b;p=project%2Flibnl-tiny.git 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 --- 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)