diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-02-28 23:32:06 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-02-28 23:32:06 +0000 |
commit | 9993a3aebb27c5cac55429a23af2d2a0f129cb95 (patch) | |
tree | a6d7ba55042342df7c025027bedb4c583da2c492 /cmake/modules | |
parent | 1485455be0310c6b24f096823029e08867531016 (diff) | |
download | external_llvm-9993a3aebb27c5cac55429a23af2d2a0f129cb95.zip external_llvm-9993a3aebb27c5cac55429a23af2d2a0f129cb95.tar.gz external_llvm-9993a3aebb27c5cac55429a23af2d2a0f129cb95.tar.bz2 |
Enable -Wcovered-switch-default again, but add -Werror to the checks to make
sure we don't use it with compilers that don't support it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/HandleLLVMOptions.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index 496e8b3..0a5c02f 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -182,6 +182,10 @@ 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 ) + endif() endif (LLVM_ENABLE_WARNINGS) if (LLVM_ENABLE_WERROR) add_llvm_definitions( -Werror ) |