From fde4588dcb7e24038d9b68f7630668fcd34afbf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:08:08 +0100 Subject: [PATCH] Enable tracing in debug builds by default --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 408ed1880a..ee95085841 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,6 +134,12 @@ if(NANO_STACKTRACE_BACKTRACE) endif() option(NANO_TRACING "Enable trace logging" OFF) +# Check if the build type is Debug, and if so, enable NANO_TRACING by default +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(NANO_TRACING + ON + CACHE BOOL "Enable trace logging" FORCE) +endif() if(NANO_TRACING) message(STATUS "Using trace logging") add_compile_definitions(NANO_TRACING)