From: Thomas Debesse Date: Sun, 28 Oct 2018 23:09:46 +0000 (+0100) Subject: make -Werror and -pedantic-errors a cmake option named USE_WERROR X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8640f93253a572e4e16cb0c183b0e4bebeb2640a;p=xonotic%2Fnetradiant.git make -Werror and -pedantic-errors a cmake option named USE_WERROR --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 03d97f64..e920fd62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ()