diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-02-04 12:33:03 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-02-04 12:33:03 +0000 |
commit | cd34fc655d5bf4ed5d9425222b78a771b7a55294 (patch) | |
tree | 1192907b0dee5ecea635d63ccbcf8cd5d2ca75e3 /CMakeLists.txt | |
parent | Merge pull request #1663 (diff) | |
download | monero-cd34fc655d5bf4ed5d9425222b78a771b7a55294.tar.xz |
Use easylogging++'s stack trace facility where possible
This avoids using libunwind, which often causes trouble.
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cee3d8c97..454a462f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,17 +275,23 @@ 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. -if(APPLE OR (ARM AND STATIC)) +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(LIBUNWIND_LIBRARIES "") +elseif (ARM AND STATIC) set(DEFAULT_STACK_TRACE OFF) set(LIBUNWIND_LIBRARIES "") else() find_package(Libunwind) - if(LIBUNWIND_FOUND) - set(DEFAULT_STACK_TRACE ON) - else() - set(DEFAULT_STACK_TRACE OFF) - set(LIBUNWIND_LIBRARIES "") - endif() + if(LIBUNWIND_FOUND) + set(DEFAULT_STACK_TRACE ON) + else() + set(DEFAULT_STACK_TRACE OFF) + set(LIBUNWIND_LIBRARIES "") + endif() endif() option(STACK_TRACE "Install a hook that dumps stack on exception" ${DEFAULT_STACK_TRACE}) |