diff options
author | Joe Abbey <jabbey@arxan.com> | 2012-11-26 02:02:08 +0000 |
---|---|---|
committer | Joe Abbey <jabbey@arxan.com> | 2012-11-26 02:02:08 +0000 |
commit | d6a93075a1058072e3b2525d26b3516404a7cef4 (patch) | |
tree | d5f4699ce0dbdc9c94229ac1e436d8dc555fa42d /cmake/modules | |
parent | 250ab62a62754ed99e66f81611f0f6db6e92e0a3 (diff) |
Removing SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
Adding CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
This is to handle the wackiness on a Mac host where cmake detects:
CMAKE_CXX_COMPILER == "/usr/bin/c++"
CMAKE_C_COMPILER == "/usr/bin/gcc"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/HandleLLVMOptions.cmake | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index b5f96e8f71..ca07c5c361 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -3,6 +3,7 @@ # selections. include(AddLLVMDefinitions) +include(CheckCCompilerFlag) if( CMAKE_COMPILER_IS_GNUCXX ) set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON) @@ -194,9 +195,13 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE ) if (LLVM_ENABLE_PEDANTIC) add_llvm_definitions( -pedantic -Wno-long-long ) endif (LLVM_ENABLE_PEDANTIC) - check_cxx_compiler_flag("-Werror -Wcovered-switch-default" SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG) - if( SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG ) - add_llvm_definitions( -Wcovered-switch-default ) + check_cxx_compiler_flag("-Werror -Wcovered-switch-default" CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG) + if( CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG ) + set( CMAKE_CXX_FlAGS "${CMAKE_CXX_FLAGS} -Wcovered-switch-default" ) + endif() + check_c_compiler_flag("-Werror -Wcovered-switch-default" C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG) + if( C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG ) + set( CMAKE_C_FlAGS "${CMAKE_C_FLAGS} -Wcovered-switch-default" ) endif() endif (LLVM_ENABLE_WARNINGS) if (LLVM_ENABLE_WERROR) |