From 2597a8faedd84c5f9a085eade20452deeb0a600d Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 3 Sep 2024 23:41:49 +0200 Subject: [PATCH] CMake: Add option to turn off debug output --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f464c5c2d..bf56fb7ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()