[llvm-commits] [llvm] r148530 - /llvm/trunk/cmake/modules/HandleLLVMOptions.cmake

Rafael Espindola rafael.espindola at gmail.com
Thu Jan 19 20:07:48 PST 2012


Author: rafael
Date: Thu Jan 19 22:07:48 2012
New Revision: 148530

URL: http://llvm.org/viewvc/llvm-project?rev=148530&view=rev
Log:
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.

Modified:
    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake

Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=148530&r1=148529&r2=148530&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Thu Jan 19 22:07:48 2012
@@ -88,6 +88,12 @@
     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()
 





More information about the llvm-commits mailing list