diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f3f604b4..d50e29dff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,11 @@ else() endif() if(NOT MSVC) - set(CMAKE_CXX_FLAGS "-Wall -Werror -g -Wextra -Wshadow -pedantic ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "-Wall -g -Wextra -Wshadow -pedantic ${CMAKE_CXX_FLAGS}") + option(DONT_INJECT_WERROR "Don't inject '-Werror' into the C++ compiler flags" OFF) + if(NOT DONT_INJECT_WERROR) + set(CMAKE_CXX_FLAGS "-Werror ${CMAKE_CXX_FLAGS}") + endif(NOT DONT_INJECT_WERROR) if(CMAKE_VERSION VERSION_LESS 3.1) set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") else()