diff --git a/CMakeLists.txt b/CMakeLists.txt index d6c4f087..299335eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,7 +250,12 @@ function(wtr_add_lib_target NAME OUTPUT_NAME SRC_SET INC_SET LIB_TYPE) set_property(TARGET "${NAME}" PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET "${NAME}" PROPERTY OUTPUT_NAME "${OUTPUT_NAME}") target_compile_options("${NAME}" PRIVATE "${COMPILE_OPTIONS}") - target_link_options("${NAME}" PRIVATE "${LINK_OPTIONS}") + if("${NAME}" STREQUAL "watcher-c-shared" AND LINUX) + message(STATUS "watcher-c-shared: Adding version script") + target_link_options("${NAME}" PRIVATE "${LINK_OPTIONS};-Wl,--version-script=${CMAKE_SOURCE_DIR}/watcher-c/libwatcher-c.version") + else() + target_link_options("${NAME}" PRIVATE "${LINK_OPTIONS}") + endif() target_link_libraries("${NAME}" PRIVATE "${LINK_LIBRARIES}") if(APPLE) set_property(TARGET "${NAME}" PROPERTY INSTALL_RPATH "/usr/local/lib") diff --git a/libwatcher-c.version b/libwatcher-c.version deleted file mode 100644 index 6fe03021..00000000 --- a/libwatcher-c.version +++ /dev/null @@ -1,4 +0,0 @@ -WATCHER_C { - global: wtr_* ; WTR_* ; - local: _Z* ; -}; diff --git a/watcher-c/libwatcher-c.version b/watcher-c/libwatcher-c.version new file mode 100644 index 00000000..ef471fb2 --- /dev/null +++ b/watcher-c/libwatcher-c.version @@ -0,0 +1,4 @@ +WATCHER_C { + global: wtr_* ; + local: * ; +};