summaryrefslogtreecommitdiff
path: root/cmake/libutils.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/libutils.cmake')
-rw-r--r--cmake/libutils.cmake8
1 files changed, 3 insertions, 5 deletions
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
index 8fcfe294f17..636737b2083 100644
--- a/cmake/libutils.cmake
+++ b/cmake/libutils.cmake
@@ -308,17 +308,15 @@ INCLUDE(CheckCCompilerFlag)
SET(VISIBILITY_HIDDEN_FLAG)
-IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
+IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
+ SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
+ELSEIF(UNIX)
CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN)
IF(HAVE_VISIBILITY_HIDDEN)
SET(VISIBILITY_HIDDEN_FLAG "-fvisibility=hidden")
ENDIF()
ENDIF()
-IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
- SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
-ENDIF()
-
# We try to hide the symbols in yassl/zlib to avoid name clashes with
# other libraries like openssl.
FUNCTION(RESTRICT_SYMBOL_EXPORTS target)