diff --git a/CMakeLists.txt b/CMakeLists.txt index b820935..e2add76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,13 @@ # Globally enable some compiler sanity add_compile_options(-fwrapv -fno-strict-aliasing -fsigned-char) -add_compile_options(-DMBED_CONF_MBED_TRACE_ENABLE=1) -add_compile_options(-DMBED_TRACE_MAX_LEVEL=TRACE_LEVEL_DEBUG) + +# Enable tracing if wanted, on by default +option(ENABLE_TRACING "Enable trace logging for debugging" ON) +if(ENABLE_TRACING) + add_compile_options(-DMBED_CONF_MBED_TRACE_ENABLE=1) + add_compile_options(-DMBED_TRACE_MAX_LEVEL=TRACE_LEVEL_DEBUG) +endif() # Create Tardis project project(Tardis)