summaryrefslogtreecommitdiffstats
path: root/llvm/cmake
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-03-13 13:08:47 +0000
committerAlexey Samsonov <samsonov@google.com>2014-03-13 13:08:47 +0000
commitcd083fe151097a4c8cf128bdb7a40dd4b3498910 (patch)
tree8687ed22693df806c0e5e2c06b7e2b3163385d82 /llvm/cmake
parentef174305f9c38f25df53f88e54b6dc9b607deac7 (diff)
downloadbcm5719-llvm-cd083fe151097a4c8cf128bdb7a40dd4b3498910.tar.gz
bcm5719-llvm-cd083fe151097a4c8cf128bdb7a40dd4b3498910.zip
[CMake] Put -Werror to CMAKE_CXX_FLAGS instead of using add_llvm_definitions()
add_definitions shouldn't really be used for compiler flags, and the variable LLVM_DEFINITIONS is not appropriately used at the moment, e.g. it's not exported to LLVMConfig.cmake llvm-svn: 203792
Diffstat (limited to 'llvm/cmake')
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index d12d1c788f4..7e68bfbe96a 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -307,9 +307,7 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
check_cxx_compiler_flag("-Werror -Wnon-virtual-dtor" CXX_SUPPORTS_NON_VIRTUAL_DTOR_FLAG)
append_if(CXX_SUPPORTS_NON_VIRTUAL_DTOR_FLAG "-Wnon-virtual-dtor" CMAKE_CXX_FLAGS)
endif (LLVM_ENABLE_WARNINGS)
- if (LLVM_ENABLE_WERROR)
- add_llvm_definitions( -Werror )
- endif (LLVM_ENABLE_WERROR)
+ append_if(LLVM_ENABLE_WERROR "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
if (LLVM_ENABLE_CXX1Y)
check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)
append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS)
OpenPOWER on IntegriCloud