[CMake] Support -fvisibility-inlines-hidden when LLVM_ENABLE_PIC=Off

I'm unaware of any reasons why -fvisibility-inlines-hidden would depend on PIC, and since autoconf supports this flag without PIC, we should support it in CMake too.

llvm-svn: 253517
This commit is contained in:
Chris Bieneman 2015-11-18 22:49:26 +00:00
parent 6e644abd46
commit 6b43f1f40f
1 changed files with 6 additions and 7 deletions

View File

@ -181,16 +181,15 @@ if( LLVM_ENABLE_PIC )
# On Windows all code is PIC. MinGW warns if -fPIC is used.
else()
add_flag_or_print_warning("-fPIC" FPIC)
if( WIN32 OR CYGWIN)
# MinGW warns if -fvisibility-inlines-hidden is used.
else()
check_cxx_compiler_flag("-fvisibility-inlines-hidden" SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
append_if(SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG "-fvisibility-inlines-hidden" CMAKE_CXX_FLAGS)
endif()
endif()
endif()
if(NOT WIN32 AND NOT CYGWIN)
# MinGW warns if -fvisibility-inlines-hidden is used.
check_cxx_compiler_flag("-fvisibility-inlines-hidden" SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
append_if(SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG "-fvisibility-inlines-hidden" CMAKE_CXX_FLAGS)
endif()
if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
# TODO: support other platforms and toolchains.
if( LLVM_BUILD_32_BITS )