aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-03-19 21:48:36 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-03-19 21:48:36 +0000
commitfff238ec94ac6d45fc18c315d7bc590ddfaad63d (patch)
treed138554a5a13e650f45f3d8d4b8bd0c9c1748235 /CMakeLists.txt
parentMerge pull request #732 (diff)
downloadmonero-fff238ec94ac6d45fc18c315d7bc590ddfaad63d.tar.xz
Print stack trace upon exceptions
Useful for debugging users' logs
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9674404bb..ea1d5d7e5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -243,6 +243,14 @@ endif()
add_definitions("-DBLOCKCHAIN_DB=${BLOCKCHAIN_DB}")
+find_package(Libunwind)
+if(LIBUNWIND_FOUND)
+ message(STATUS "Using libunwind to provide stack traces")
+ add_definitions("-DHAVE_LIBUNWIND")
+else()
+ message(STATUS "Stack traces disabled")
+endif()
+
if (UNIX AND NOT APPLE)
# Note that at the time of this writing the -Wstrict-prototypes flag added below will make this fail
set(THREADS_PREFER_PTHREAD_FLAG ON)
@@ -274,6 +282,10 @@ if (BERKELEY_DB)
include_directories(${BDB_INCLUDE})
endif()
+# Final setup for libunwind
+include_directories(${LIBUNWIND_INCLUDE})
+link_directories(${LIBUNWIND_LIBRARY_DIRS})
+
if(MSVC)
add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline")