summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-01 13:20:35 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-01 13:20:35 +0100
commit53fc047667e6e7cf71be13504e003a074b6a83bf (patch)
tree3148a8a105468b429cba6543a5d14018017b2f40
parenta1ebe07fb572781ab7a9a7da07f6f6c93a6b7833 (diff)
gui: hidden symbol visibility by default
-rw-r--r--gui/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
index 158804c2..7fec9a15 100644
--- a/gui/CMakeLists.txt
+++ b/gui/CMakeLists.txt
@@ -39,4 +39,16 @@ if(LINUX)
target_link_libraries(opentrack procps)
endif()
+set(c-props)
+set(l-props)
+if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
+ set(c-props "-fvisibility=hidden -fvisibility-inlines-hidden")
+ set(l-props "-Wl,--as-needed")
+endif()
+
+set_target_properties(opentrack PROPERTIES
+ LINK_FLAGS "${l-props}"
+ COMPILE_FLAGS "${c-props}"
+)
+
install(TARGETS opentrack DESTINATION .)