[compiler-rt] r202021 - [CMake] Introduce COMPILER_RT_ENABLE_WERROR option
Alexey Samsonov
samsonov at google.com
Mon Feb 24 03:22:39 PST 2014
Author: samsonov
Date: Mon Feb 24 05:22:39 2014
New Revision: 202021
URL: http://llvm.org/viewvc/llvm-project?rev=202021&view=rev
Log:
[CMake] Introduce COMPILER_RT_ENABLE_WERROR option
Modified:
compiler-rt/trunk/CMakeLists.txt
Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=202021&r1=202020&r2=202021&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Mon Feb 24 05:22:39 2014
@@ -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)
More information about the llvm-commits
mailing list