diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d68eb801..435cdad3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -93,18 +93,17 @@ else() | |||
93 | message(STATUS "Supported C++ compiler features = ${CMAKE_CXX_COMPILE_FEATURES}") | 93 | message(STATUS "Supported C++ compiler features = ${CMAKE_CXX_COMPILE_FEATURES}") |
94 | endif() | 94 | endif() |
95 | 95 | ||
96 | option(DEBUG "Enable DEBUG level logging (default)" ON) | 96 | set(MIN_LOGGER_LEVEL "" CACHE STRING "Logging level to use (TRACE, DEBUG, INFO, WARNING, ERROR)") |
97 | if(DEBUG) | ||
98 | set(MIN_LOGGER_LEVEL DEBUG) | ||
99 | endif() | ||
100 | |||
101 | option(TRACE "Enable TRACE level logging (expensive, for network debugging)" OFF) | ||
102 | if(TRACE) | ||
103 | set(MIN_LOGGER_LEVEL TRACE) | ||
104 | endif() | ||
105 | |||
106 | if(MIN_LOGGER_LEVEL) | 97 | if(MIN_LOGGER_LEVEL) |
107 | add_definitions(-DMIN_LOGGER_LEVEL=LOGGER_LEVEL_${MIN_LOGGER_LEVEL}) | 98 | if(("${MIN_LOGGER_LEVEL}" STREQUAL "TRACE") OR |
99 | ("${MIN_LOGGER_LEVEL}" STREQUAL "DEBUG") OR | ||
100 | ("${MIN_LOGGER_LEVEL}" STREQUAL "INFO") OR | ||
101 | ("${MIN_LOGGER_LEVEL}" STREQUAL "WARNING") OR | ||
102 | ("${MIN_LOGGER_LEVEL}" STREQUAL "ERROR")) | ||
103 | add_definitions(-DMIN_LOGGER_LEVEL=LOGGER_LEVEL_${MIN_LOGGER_LEVEL}) | ||
104 | else() | ||
105 | message(FATAL_ERROR "Unknown value provided for MIN_LOGGER_LEVEL: \"${MIN_LOGGER_LEVEL}\", must be one of TRACE, DEBUG, INFO, WARNING or ERROR") | ||
106 | endif() | ||
108 | endif() | 107 | endif() |
109 | 108 | ||
110 | option(USE_IPV6 "Use IPv6 in tests" ON) | 109 | option(USE_IPV6 "Use IPv6 in tests" ON) |