From 8640f93253a572e4e16cb0c183b0e4bebeb2640a Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 29 Oct 2018 00:09:46 +0100 Subject: [PATCH] make -Werror and -pedantic-errors a cmake option named USE_WERROR --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 () -- 2.39.2