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 | 42e94d11a199e50f01a95cccb438bee73e9b06c6 (patch) | |
tree | 5737dc630722275972f36c5f98223d89bd814f05 /llvm/cmake | |
parent | 0f70a6f51e7e98c83cf245e358a465d3c32c13a1 (diff) | |
download | bcm5719-llvm-42e94d11a199e50f01a95cccb438bee73e9b06c6.tar.gz bcm5719-llvm-42e94d11a199e50f01a95cccb438bee73e9b06c6.zip |
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.
llvm-svn: 151665
Diffstat (limited to 'llvm/cmake')
-rw-r--r-- | llvm/cmake/modules/HandleLLVMOptions.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 496e8b3f546..0a5c02f5ba5 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/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 ) |