Skip to content

Commit b522488

Browse files
committed
Use BUILD_WITH_PEDANTIC_WARNINGS by default if CMAKE_BUILD_TYPE MATCHES DEBUG
1 parent 1e9996d commit b522488

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ else ()
2424
endif ()
2525
set(MATPLOT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
2626

27+
# Check if we are in debug mode
28+
if(CMAKE_BUILD_TYPE MATCHES DEBUG)
29+
set(DEBUG_MODE ON)
30+
set(NOT_DEBUG_MODE OFF)
31+
else()
32+
set(DEBUG_MODE OFF)
33+
set(NOT_DEBUG_MODE ON)
34+
endif()
35+
2736
#######################################################
2837
### Options ###
2938
#######################################################
@@ -36,9 +45,9 @@ option(BUILD_PACKAGE "Build package" ${MASTER_PROJECT})
3645
# How to build
3746
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
3847
option(BUILD_HIGH_RESOLUTION_WORLD_MAP "Compile the high resolution maps for geoplots" ON)
39-
option(BUILD_FOR_DOCUMENTATION_IMAGES "Bypass wait() commands and save figures as .svg at destruction" OFF)
48+
option(BUILD_FOR_DOCUMENTATION_IMAGES "Bypass show() commands and save figures as .svg at destruction" OFF)
4049
option(BUILD_EXPERIMENTAL_OPENGL_BACKEND "Compile target with the experimental OpenGL backend" OFF)
41-
option(BUILD_WITH_PEDANTIC_WARNINGS "Use pedantic warnings. This is useful for developers because many of these warnings will be in continuous integration anyway." OFF)
50+
option(BUILD_WITH_PEDANTIC_WARNINGS "Use pedantic warnings. This is useful for developers because many of these warnings will be in continuous integration anyway." ${DEBUG_MODE})
4251
option(BUILD_WITH_UTF8 "Accept utf-8 in MSVC by default." ON)
4352

4453
# Where to find dependencies

0 commit comments

Comments
 (0)