summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-02-24 11:22:39 +0000
committerAlexey Samsonov <samsonov@google.com>2014-02-24 11:22:39 +0000
commit264be480e49c8ae6ad5f0f640b47b544fc9a549b (patch)
tree0f68b97e30249568cf162c8b087928ab2b97d117 /CMakeLists.txt
parentcc46830bce8155eaca25e596d21de5cbdd7f3dc2 (diff)
[CMake] Introduce COMPILER_RT_ENABLE_WERROR option
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index be78f9eb3..6deba556a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,6 +40,8 @@ if (NOT COMPILER_RT_STANDALONE_BUILD)
set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests."
${LLVM_INCLUDE_TESTS})
+ option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered"
+ ${LLVM_ENABLE_WERROR})
# Use just-built Clang to compile/link tests.
set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
set(COMPILER_RT_TEST_COMPILER_ID Clang)
@@ -50,6 +52,7 @@ else()
set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH
"Path where built compiler-rt libraries should be installed.")
option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF)
+ option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF)
# Use a host compiler to compile/link tests.
set(COMPILER_RT_TEST_COMPILER ${CMAKE_C_COMPILER})
set(COMPILER_RT_TEST_COMPILER_ID ${CMAKE_C_COMPILER_ID})
@@ -215,6 +218,10 @@ pythonize_bool(COMPILER_RT_DEBUG)
#================================
include(config-ix)
+if(COMPILER_RT_ENABLE_WERROR)
+ add_definitions(-Werror)
+endif()
+
# Provide some common commmandline flags for Sanitizer runtimes.
append_if(SANITIZER_COMMON_CFLAGS COMPILER_RT_HAS_FPIC_FLAG -fPIC)
append_if(SANITIZER_COMMON_CFLAGS COMPILER_RT_HAS_FNO_BUILTIN_FLAG -fno-builtin)