aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-06-21 09:30:56 +0200
committerRiccardo Spagni <ric@spagni.net>2016-06-21 09:30:56 +0200
commit03477063ba55232af62f66e5fada4006469a9a22 (patch)
tree2ca6fbec6f4573811789d908ebcfa136a81dcb7d
parentMerge pull request #865 (diff)
parentcommon: fix build without libunwind (diff)
downloadmonero-03477063ba55232af62f66e5fada4006469a9a22.tar.xz
Merge pull request #868
15c2b69 common: fix build without libunwind (moneromooo-monero) f72388c CMakeLists: fix build without libunwind (moneromooo-monero)
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/common/stack_trace.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09ca449d5..f9110250c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,6 +249,7 @@ if(LIBUNWIND_FOUND)
add_definitions("-DHAVE_LIBUNWIND")
else()
message(STATUS "Stack traces disabled")
+ set(LIBUNWIND_LIBRARIES "")
endif()
if (UNIX AND NOT APPLE)
diff --git a/src/common/stack_trace.cpp b/src/common/stack_trace.cpp
index 1a65ca656..2805e7604 100644
--- a/src/common/stack_trace.cpp
+++ b/src/common/stack_trace.cpp
@@ -28,8 +28,10 @@
#include "common/stack_trace.h"
#include "misc_log_ex.h"
+#ifdef HAVE_LIBUNWIND
#define UNW_LOCAL_ONLY
#include <libunwind.h>
+#endif
#include <cxxabi.h>
#include <dlfcn.h>
@@ -112,8 +114,6 @@ void log_stack_trace(const char *msg)
LOG_PRINT2(log, " " << std::setw(4) << level << std::setbase(16) << std::setw(20) << "0x" << ip << " " << (!status && dsym ? dsym : sym) << " + " << "0x" << off, LOG_LEVEL_0);
free(dsym);
}
-#else
-#warning libunwind disabled, no stack traces
#endif
}