aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorredfish <redfish@galactica.pw>2017-10-07 12:13:31 -0400
committerredfish <redfish@galactica.pw>2017-10-07 12:13:31 -0400
commit885c773af3bf1d5fa393006417c99e74bf336a28 (patch)
treecb82065b2821331fbe227d4fac561b4a50d209cc
parentMerge pull request #2548 (diff)
downloadmonero-885c773af3bf1d5fa393006417c99e74bf336a28.tar.xz
cmake: print which stack trace lib is used
To avoid the suprize of stack tracing being enabled but libunwind not being linked in.
-rw-r--r--CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f74f59e3..12b665f7a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -293,11 +293,13 @@ add_definitions("-DBLOCKCHAIN_DB=${BLOCKCHAIN_DB}")
# 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)
set(DEFAULT_STACK_TRACE OFF)
set(LIBUNWIND_LIBRARIES "")
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT MINGW)
set(DEFAULT_STACK_TRACE ON)
+ set(STACK_TRACE_LIB "easylogging++") # for diag output only
set(LIBUNWIND_LIBRARIES "")
elseif (ARM AND STATIC)
set(DEFAULT_STACK_TRACE OFF)
@@ -306,6 +308,7 @@ else()
find_package(Libunwind)
if(LIBUNWIND_FOUND)
set(DEFAULT_STACK_TRACE ON)
+ set(STACK_TRACE_LIB "libunwind") # for diag output only
else()
set(DEFAULT_STACK_TRACE OFF)
set(LIBUNWIND_LIBRARIES "")
@@ -315,7 +318,7 @@ endif()
option(STACK_TRACE "Install a hook that dumps stack on exception" ${DEFAULT_STACK_TRACE})
if(STACK_TRACE)
- message(STATUS "Stack trace on exception enabled")
+ message(STATUS "Stack trace on exception enabled (using ${STACK_TRACE_LIB})")
else()
message(STATUS "Stack trace on exception disabled")
endif()