summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-01-20 04:07:48 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-01-20 04:07:48 +0000
commitb28885057e381068fa109666d54a0e4cd6d68de6 (patch)
tree3e231acd875590a71970571052de69b8b58acb1e /cmake
parenta48678332b1345117fbddb1df5f120f01712ea1e (diff)
downloadllvm-b28885057e381068fa109666d54a0e4cd6d68de6.tar.gz
llvm-b28885057e381068fa109666d54a0e4cd6d68de6.tar.bz2
llvm-b28885057e381068fa109666d54a0e4cd6d68de6.tar.xz
cmake: pass -fvisibility-inlines-hidden if it is supported. In a
Release+Asserts build with -DBUILD_SHARED_LIBS=ON, the install directory goes from 72MB to 70MB. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index c316ab6333..33d7d9abad 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -88,6 +88,12 @@ if( LLVM_ENABLE_PIC )
else( SUPPORTS_FPIC_FLAG )
message(WARNING "-fPIC not supported.")
endif()
+
+ check_cxx_compiler_flag("-fvisibility-inlines-hidden" SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
+ if( SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG )
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility-inlines-hidden")
+ endif()
endif()
endif()