From 9da1484e6c1bbd130a6b618f72efb0acf222e548 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 3 Nov 2015 09:58:13 +0100 Subject: cmake: can use default hidden visibility on apple --- cmake/opentrack-macros.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmake') diff --git a/cmake/opentrack-macros.cmake b/cmake/opentrack-macros.cmake index 9be09397..d84f9175 100644 --- a/cmake/opentrack-macros.cmake +++ b/cmake/opentrack-macros.cmake @@ -53,9 +53,13 @@ macro(opentrack_library n dir) target_link_libraries(${n} opentrack-api opentrack-compat) endif() target_link_libraries(${n} ${MY_QT_LIBS}) - if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE AND NOT opentrack-foolib_NO-LINKER-SCRIPT) + if(CMAKE_COMPILER_IS_GNUCXX AND NOT opentrack-foolib_NO-LINKER-SCRIPT) + set(l-flags) + if(NOT APPLE) + set(l-flags "-Wl,--as-needed -Wl,--version-script=\"${CMAKE_SOURCE_DIR}/opentrack-compat/${version-script}-version-script.txt\"") + endif() set_target_properties(${n} PROPERTIES - LINK_FLAGS "${opentrack-foolib_LINK} ${opentrack-foolib_GNU-LINK} -Wl,--as-needed -Wl,--version-script=\"${CMAKE_SOURCE_DIR}/opentrack-compat/${version-script}-version-script.txt\"" + LINK_FLAGS "${opentrack-foolib_LINK} ${opentrack-foolib_GNU-LINK} ${l-flags}" COMPILE_FLAGS "${opentrack-foolib_COMPILE} ${opentrack-foolib_GNU-COMPILE} -fvisibility=hidden -fvisibility-inlines-hidden" ) else() -- cgit v1.2.3