From: Duncan Bellamy Date: Thu, 12 Oct 2023 08:47:32 +0000 (+0000) Subject: [Minor] Make compiling with backward-cpp optional X-Git-Tag: 3.7.2~17^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6d16d5e9ef7bcd0e5c3cd841d1a5df139f301463;p=rspamd.git [Minor] Make compiling with backward-cpp optional --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e78a7ebfb..9f9c807e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,7 @@ OPTION(ENABLE_LIBUNWIND "Obsoleted [default: OFF]" OFF) OPTION(ENABLE_LUA_TRACE "Trace all Lua C API invocations [default: OFF]" OFF) OPTION(ENABLE_LUA_REPL "Enables Lua repl (requires C++11 compiler) [default: ON]" ON) OPTION(ENABLE_FASTTEXT "Link with FastText library [default: OFF]" OFF) +OPTION(ENABLE_BACKWARD "Build rspamd with backward-cpp stacktrace [default: ON]" ON) OPTION(SYSTEM_ZSTD "Use system zstd instead of bundled one [default: OFF]" OFF) OPTION(SYSTEM_FMT "Use system fmt instead of bundled one [default: OFF]" OFF) OPTION(SYSTEM_DOCTEST "Use system doctest instead of bundled one [default: OFF]" OFF) @@ -625,11 +626,18 @@ ADD_SUBDIRECTORY(contrib/libev) ADD_SUBDIRECTORY(contrib/kann) ADD_SUBDIRECTORY(contrib/fastutf8) ADD_SUBDIRECTORY(contrib/google-ced) -ADD_SUBDIRECTORY(contrib/backward-cpp) -message(STATUS "Backward-cpp config: ${BACKWARD_DEFINITIONS}") -if (BACKWARD_LIBRARIES) +IF (ENABLE_BACKWARD MATCHES "ON") + ADD_SUBDIRECTORY(contrib/backward-cpp) + message(STATUS "Backward-cpp config: ${BACKWARD_DEFINITIONS}") +ELSE () + set(BACKWARD_ENABLE) + macro(add_backward target) + # do nothing + endmacro() +ENDIF () +IF (BACKWARD_LIBRARIES) message(STATUS "Backward-cpp libraries: ${BACKWARD_LIBRARIES}") -endif() +ENDIF () IF (SYSTEM_FMT MATCHES "OFF") INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/fmt/include")