diff options
author | Vladislav Vaintroub <wlad@sun.com> | 2010-01-06 12:31:35 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@sun.com> | 2010-01-06 12:31:35 +0000 |
commit | 400f9587c5cb93baa9e06a5e18dacd9bc996a282 (patch) | |
tree | 94715ef3b957143c6cd19bedde5c4a241df9eb21 /cmake | |
parent | 9fe3b669369fce42e1b8bec3864e5f148b45b575 (diff) | |
parent | 3701208a2e890d42aabc678a2a5d4ea539941b36 (diff) | |
download | mariadb-git-400f9587c5cb93baa9e06a5e18dacd9bc996a282.tar.gz |
Do not use fvisibility flag if GCC does not support it
(i.e if gcc version < 4)
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/libutils.cmake | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index 5198cd3a898..e4b4e980b00 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -279,12 +279,15 @@ ENDFUNCTION() MACRO(RESTRICT_SYMBOL_EXPORTS target) IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX) - GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS) - IF(NOT COMPILE_FLAGS) - # Avoid COMPILE_FLAGS-NOTFOUND - SET(COMPILE_FLAGS) + CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN) + IF(HAVE_VISIBILITY_HIDDEN) + GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS) + IF(NOT COMPILE_FLAGS) + # Avoid COMPILE_FLAGS-NOTFOUND + SET(COMPILE_FLAGS) + ENDIF() + SET_TARGET_PROPERTIES(${target} PROPERTIES + COMPILE_FLAGS "${COMPILE_FLAGS} -fvisibility=hidden") ENDIF() - SET_TARGET_PROPERTIES(${target} PROPERTIES - COMPILE_FLAGS "${COMPILE_FLAGS} -fvisibility=hidden") ENDIF() ENDMACRO() |