aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBalint Reczey <balint@balintreczey.hu>2013-03-02 22:11:26 +0000
committerBalint Reczey <balint@balintreczey.hu>2013-03-02 22:11:26 +0000
commit73aafe2bc4db3f0d0d98107d2b2e861f1dcbc543 (patch)
tree42b11dbce47d723876cbadf46e045f52ce70991a /CMakeLists.txt
parent5c05c9e0e1fef7699646bd50cfab66b4ff451874 (diff)
Make Solaris Studio hide internal shared library symbols by default
svn path=/trunk/; revision=48020
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d00a66be27..3cdce2ad81 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -218,8 +218,13 @@ check_c_compiler_flag(-fvisibility=hidden FVHIDDEN)
if((FVHIDDEN))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
else() # TODO add alternate compiler flags for hiding symbols
- message(WARNING "Hiding shared library symbols is not supported by the compiler."
+ check_c_compiler_flag(-xldscope=hidden FVHIDDEN)
+ if((FVHIDDEN))
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+ else()
+ message(WARNING "Hiding shared library symbols is not supported by the compiler."
" All shared library symbols will be exported.")
+ endif()
endif()
if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_GCC_CHECKS)