From a51efcc9743d09eb8b52647c2b860b2f66fc8eee Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 15 Mar 2026 22:16:27 +0100 Subject: [PATCH] Proper CMake setup for TRACY_CALLSTACK. --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f614d0d3..cfbfad50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,7 +117,7 @@ endmacro() set_option(TRACY_ENABLE "Enable profiling" ON) set_option(TRACY_ON_DEMAND "On-demand profiling" OFF) -set_option(TRACY_CALLSTACK "Enforce callstack collection for tracy regions" OFF) +set(TRACY_CALLSTACK "" CACHE STRING "Override the callstack collection depth for tracy zones") set_option(TRACY_NO_CALLSTACK "Disable all callstack related functionality" OFF) set_option(TRACY_NO_CALLSTACK_INLINES "Disables the inline functions in callstacks" OFF) set_option(TRACY_ONLY_LOCALHOST "Only listen on the localhost interface" OFF) @@ -144,6 +144,11 @@ set_option(TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT "Enable libbacktrace to suppor set_option(TRACY_DEBUGINFOD "Enable debuginfod support" OFF) set_option(TRACY_IGNORE_MEMORY_FAULTS "Ignore instrumentation errors from memory free events that do not have a matching allocation" OFF) +if(TRACY_CALLSTACK) + message(STATUS "TRACY_CALLSTACK: ${TRACY_CALLSTACK}") + target_compile_definitions(TracyClient PUBLIC TRACY_CALLSTACK=${TRACY_CALLSTACK}) +endif() + # advanced set_option(TRACY_VERBOSE "[advanced] Verbose output from the profiler" OFF) mark_as_advanced(TRACY_VERBOSE)