]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
make -Werror and -pedantic-errors a cmake option named USE_WERROR 106/head
authorThomas Debesse <dev@illwieckz.net>
Sun, 28 Oct 2018 23:09:46 +0000 (00:09 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sun, 4 Nov 2018 07:32:39 +0000 (08:32 +0100)
CMakeLists.txt

index 03d97f64c1ba3439bfb05e3ec14a2751d67537a1..e920fd6216c4e3522bedc5814d6d51c012e91015 100644 (file)
@@ -4,6 +4,7 @@ project(NetRadiant C CXX)
 
 option(BUILD_RADIANT "Build the GUI" ON)
 option(BUILD_CRUNCH "Build Crunch image support" OFF)
+option(USE_WERROR "Build with -Werror -pedantic-errors" OFF)
 
 if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
     set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/install" CACHE PATH "..." FORCE)
@@ -80,7 +81,7 @@ if (NOT WIN32)
     addflags("-fvisibility=hidden")
 endif ()
 
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+if (USE_WERROR)
     addflags("-Werror")
     addflags("-pedantic-errors")
 endif ()