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)