Commit 8640f932 authored by Thomas Debesse's avatar Thomas Debesse

make -Werror and -pedantic-errors a cmake option named USE_WERROR

parent 4cf52cd2
...@@ -4,6 +4,7 @@ project(NetRadiant C CXX) ...@@ -4,6 +4,7 @@ project(NetRadiant C CXX)
option(BUILD_RADIANT "Build the GUI" ON) option(BUILD_RADIANT "Build the GUI" ON)
option(BUILD_CRUNCH "Build Crunch image support" OFF) option(BUILD_CRUNCH "Build Crunch image support" OFF)
option(USE_WERROR "Build with -Werror -pedantic-errors" OFF)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/install" CACHE PATH "..." FORCE) set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/install" CACHE PATH "..." FORCE)
...@@ -80,7 +81,7 @@ if (NOT WIN32) ...@@ -80,7 +81,7 @@ if (NOT WIN32)
addflags("-fvisibility=hidden") addflags("-fvisibility=hidden")
endif () endif ()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") if (USE_WERROR)
addflags("-Werror") addflags("-Werror")
addflags("-pedantic-errors") addflags("-pedantic-errors")
endif () endif ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment