Commit c3e3c780 authored by Sergei Golubchik's avatar Sergei Golubchik

cmake: don't check for the compiler on every invocation of RESTRICT_SYMBOL_EXPORTS(),

do it only once
parent f171d3ff
......@@ -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)
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()
ENDIF()
ENDIF()
IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
ENDIF()
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment