From 58e54bfd65b3e45e135a672b5f3d19b878f0c44b Mon Sep 17 00:00:00 2001 From: Rene Guenon Date: Sun, 9 Aug 2026 22:51:53 +0400 Subject: [PATCH] cmake: disable stack traces by default for release builds --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6ce0fc53..9e773ef22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -506,7 +506,10 @@ endif() # Can't install hook in static build on OSX, because OSX linker does not support --wrap # On ARM, having libunwind package (with .so's only) installed breaks static link. # When possible, avoid stack tracing using libunwind in favor of using easylogging++. -if (APPLE OR NETBSD) +if (CMAKE_BUILD_TYPE_LOWER STREQUAL "release" AND NOT STACK_TRACE) + set(DEFAULT_STACK_TRACE OFF) + set(LIBUNWIND_LIBRARIES "") +elseif (APPLE OR NETBSD) set(DEFAULT_STACK_TRACE OFF) set(LIBUNWIND_LIBRARIES "") elseif (DEPENDS AND NOT LINUX)