CMake: Add option to turn off debug output

This commit is contained in:
Jonas Kvinge 2024-09-03 23:41:49 +02:00
parent 8008ec895a
commit 2597a8faed
1 changed files with 7 additions and 0 deletions

View File

@ -84,6 +84,13 @@ add_compile_options(${COMPILE_OPTIONS})
if(CMAKE_BUILD_TYPE MATCHES "Release")
add_definitions(-DNDEBUG)
set(ENABLE_DEBUG_OUTPUT_DEFAULT OFF)
else()
set(ENABLE_DEBUG_OUTPUT_DEFAULT ON)
endif()
option(ENABLE_DEBUG_OUTPUT "Enable debug output" ${ENABLE_DEBUG_OUTPUT_DEFAULT})
if(NOT ENABLE_DEBUG_OUTPUT)
add_definitions(-DQT_NO_DEBUG_OUTPUT)
endif()