diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-11-03 09:58:13 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-11-03 09:58:24 +0100 |
commit | 9da1484e6c1bbd130a6b618f72efb0acf222e548 (patch) | |
tree | 1ad866c5b5420ba1b1eaba29216a50edc45cc0c8 | |
parent | 8563a6cc6bd11dcca87e77eb922252b7ddf532e0 (diff) |
cmake: can use default hidden visibility on apple
-rw-r--r-- | cmake/opentrack-macros.cmake | 8 | ||||
-rw-r--r-- | gui/CMakeLists.txt | 6 |
2 files changed, 10 insertions, 4 deletions
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() diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 7fec9a15..d34ea981 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -41,9 +41,11 @@ endif() set(c-props) set(l-props) -if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE) +if(CMAKE_COMPILER_IS_GNUCXX) set(c-props "-fvisibility=hidden -fvisibility-inlines-hidden") - set(l-props "-Wl,--as-needed") + if(NOT APPLE) + set(l-props "-Wl,--as-needed") + endif() endif() set_target_properties(opentrack PROPERTIES |