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.

llvm-svn: 148530
This commit is contained in:
Rafael Espindola 2012-01-20 04:07:48 +00:00
parent a32bfbeeda
commit 5258ab885b
1 changed files with 6 additions and 0 deletions

View File

@ -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()