diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-01-20 13:10:10 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-01-20 13:10:10 +0000 |
commit | ace4f2b0d4d542e3a835bcd4fad69205c5a73330 (patch) | |
tree | 40923146d2251085b17836870303a67e4988966c /cmake/modules/HandleLLVMOptions.cmake | |
parent | 8f35c13842187d23e7d10ec2e5f416d0363abf50 (diff) |
Don't use -fvisibility-inlines-hidden on mingw to try to avoid a lot of
warnings from gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules/HandleLLVMOptions.cmake')
-rw-r--r-- | cmake/modules/HandleLLVMOptions.cmake | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index 33d7d9abad..229127d832 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -89,11 +89,15 @@ if( LLVM_ENABLE_PIC ) 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() + 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) + 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() endif() |