diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-07-09 22:30:04 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-07-09 22:30:04 +0200 |
commit | c3e3c78048d4f7ed373518a3b8684acc9be56b28 (patch) | |
tree | fbb342374a0a26457b2e5537ec2e032a8a92203e | |
parent | f171d3ff79bc44ebdb09cf0c9e0d38e9dc87155c (diff) | |
download | mariadb-git-c3e3c78048d4f7ed373518a3b8684acc9be56b28.tar.gz |
cmake: don't check for the compiler on every invocation of RESTRICT_SYMBOL_EXPORTS(),
do it only once
-rw-r--r-- | cmake/libutils.cmake | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index e161b67d25f..2da701d39b0 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -304,23 +304,22 @@ FUNCTION(GET_DEPENDEND_OS_LIBS target result) SET(${result} ${ret} PARENT_SCOPE) ENDFUNCTION() -# We try to hide the symbols in yassl/zlib to avoid name clashes with -# other libraries like openssl. -FUNCTION(RESTRICT_SYMBOL_EXPORTS target) - SET(VISIBILITY_HIDDEN_FLAG) +SET(VISIBILITY_HIDDEN_FLAG) - IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX) - CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN) - IF(HAVE_VISIBILITY_HIDDEN) - MESSAGE(STATUS "HAVE_VISIBILITY_HIDDEN") - SET(VISIBILITY_HIDDEN_FLAG "-fvisibility=hidden") - ENDIF() +IF(CMAKE_COMPILER_IS_GNUCXX AND 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() +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) IF(VISIBILITY_HIDDEN_FLAG) GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS) IF(NOT COMPILE_FLAGS) |