aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-18 17:41:47 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-18 17:41:47 +0100
commit04d3623c89afe60329dd1642cf4fc1b91311616b (patch)
treea0a434956d38ee1f104033e147f4326b17ffcaff /CMakeLists.txt
parent96acdaae8b1dc1839052df3b97526adfca8f64f5 (diff)
downloadrspamd-04d3623c89afe60329dd1642cf4fc1b91311616b.tar.gz
rspamd-04d3623c89afe60329dd1642cf4fc1b91311616b.zip
[Feature] Print stack trace on crash
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6526996a3..a3fe5bc2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,6 +64,7 @@ OPTION(ENABLE_COVERAGE "Build rspamd with code coverage options [default: OF
OPTION(ENABLE_FULL_DEBUG "Build rspamd with all possible debug [default: OFF]" OFF)
OPTION(ENABLE_UTILS "Build rspamd internal utils [default: OFF]" OFF)
OPTION(ENABLE_TORCH "Install torch7 with Rspamd [default: ON]" ON)
+OPTION(ENABLE_LIBUNWIND "Use libunwind to print crash traces [default: OFF]" OFF)
INCLUDE(FindArch.cmake)
TARGET_ARCHITECTURE(ARCH)
@@ -630,6 +631,12 @@ IF(ENABLE_JEMALLOC MATCHES "ON")
SET(WITH_JEMALLOC "1")
LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "-lpthread")
ENDIF()
+
+IF(ENABLE_LIBUNWIND MATCHES "ON")
+ ProcessPackage(LIBUNWIND LIBRARY unwind INCLUDE libunwind.h INCLUDE_SUFFIXES include/libunwind
+ ROOT ${LIBUNWIND_ROOT_DIR} MODULES libunwind)
+ SET(WITH_LIBUNWIND "1")
+ENDIF()
ProcessPackage(GTHREAD2 LIBRARY gthread-2.0 INCLUDE glib.h
INCLUDE_SUFFIXES include/glib include/glib-2.0
ROOT ${GLIB_ROOT_DIR} MODULES gthread-2.0>=2.28)
@@ -984,6 +991,7 @@ LIST(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSL_INCLUDE}")
CHECK_SYMBOL_EXISTS(SSL_set_tlsext_host_name "openssl/ssl.h" HAVE_SSL_TLSEXT_HOSTNAME)
CHECK_SYMBOL_EXISTS(dirfd "sys/types.h;unistd.h;dirent.h" HAVE_DIRFD)
CHECK_SYMBOL_EXISTS(fpathconf "sys/types.h;unistd.h" HAVE_FPATHCONF)
+CHECK_SYMBOL_EXISTS(sigaltstack "signal.h" HAVE_SIGALTSTACK)
IF(ENABLE_PCRE2 MATCHES "ON")
IF(HAVE_PCRE_JIT)