summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-11-30 17:42:30 +0000
committerChris Bieneman <beanz@apple.com>2015-11-30 17:42:30 +0000
commit0a706dcdaa20c0121087e3cad8092454e11b3857 (patch)
treefc0ff83e2eb81e40d5e42381aa42136dcfac2913 /cmake
parent9d959f3940db211065a7b3123db39ab44a726c22 (diff)
[CMake] Add -fvisibility-inlines-hidden if the compiler supports it.
This results in a significant reduction in the size of the sanitizer libraries. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254308 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/config-ix.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 07d285c75..24bb7e34b 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -30,6 +30,12 @@ check_cxx_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG)
check_cxx_compiler_flag(-msse3 COMPILER_RT_HAS_MSSE3_FLAG)
check_cxx_compiler_flag(-std=c99 COMPILER_RT_HAS_STD_C99_FLAG)
+if(NOT WIN32 AND NOT CYGWIN)
+ # MinGW warns if -fvisibility-inlines-hidden is used.
+ check_cxx_compiler_flag("-fvisibility-inlines-hidden" COMPILER_RT_HAS_FVISIBILITY_INLINES_HIDDEN_FLAG)
+ append_string_if(COMPILER_RT_HAS_FVISIBILITY_INLINES_HIDDEN_FLAG "-fvisibility-inlines-hidden" CMAKE_CXX_FLAGS)
+endif()
+
check_cxx_compiler_flag(/GR COMPILER_RT_HAS_GR_FLAG)
check_cxx_compiler_flag(/GS COMPILER_RT_HAS_GS_FLAG)
check_cxx_compiler_flag(/MT COMPILER_RT_HAS_MT_FLAG)