From e60bfeb89f209bf9a30603cbbd8fcc7618fe24a4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 13 Sep 2023 14:30:18 +0100 Subject: [PATCH] [Minor] Fix linux deps --- contrib/backward-cpp/BackwardConfig.cmake | 15 ++++--- contrib/backward-cpp/CMakeLists.txt | 53 +---------------------- debian/control | 2 +- rpm/rspamd.spec | 2 +- 4 files changed, 13 insertions(+), 59 deletions(-) diff --git a/contrib/backward-cpp/BackwardConfig.cmake b/contrib/backward-cpp/BackwardConfig.cmake index a982adcd6..594f5db68 100644 --- a/contrib/backward-cpp/BackwardConfig.cmake +++ b/contrib/backward-cpp/BackwardConfig.cmake @@ -31,15 +31,20 @@ set(STACK_WALKING_BACKTRACE FALSE CACHE BOOL set(STACK_WALKING_LIBUNWIND FALSE CACHE BOOL "Use libunwind for stack walking") -set(STACK_DETAILS_AUTO_DETECT TRUE CACHE BOOL +set(STACK_DETAILS_AUTO_DETECT FALSE CACHE BOOL "Auto detect backward's stack details dependencies") set(STACK_DETAILS_BACKTRACE_SYMBOL FALSE CACHE BOOL "Use backtrace from (e)glibc for symbols resolution") set(STACK_DETAILS_DW FALSE CACHE BOOL "Use libdw to read debug info") -set(STACK_DETAILS_BFD FALSE CACHE BOOL - "Use libbfd to read debug info") +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(STACK_DETAILS_BFD TRUE CACHE BOOL + "Use libbfd to read debug info") +else() + set(STACK_DETAILS_BFD FALSE CACHE BOOL + "Use libbfd to read debug info") +endif() set(STACK_DETAILS_DWARF FALSE CACHE BOOL "Use libdwarf/libelf to read debug info") @@ -79,7 +84,7 @@ if (STACK_WALKING_LIBUNWIND) # Disable other unwinders if libunwind is found set(STACK_WALKING_UNWIND FALSE) - set(STACK_WALKING_BACKTRACE FALSE) + set(STACK_WALKING_BACKTRACE FALSE) endif() if (${STACK_DETAILS_AUTO_DETECT}) @@ -241,7 +246,7 @@ if (NOT TARGET Backward::Backward) ) if(BACKWARD_HAS_EXTERNAL_LIBRARIES) set_target_properties(Backward::Backward PROPERTIES - INTERFACE_LINK_LIBRARIES "${BACKWARD_LIBRARIES}" + INTERFACE_LINK_LIBRARIES "${BACKWARD_LIBRARIES}" ) endif() endif() diff --git a/contrib/backward-cpp/CMakeLists.txt b/contrib/backward-cpp/CMakeLists.txt index 97327ccd1..038c50516 100644 --- a/contrib/backward-cpp/CMakeLists.txt +++ b/contrib/backward-cpp/CMakeLists.txt @@ -85,55 +85,4 @@ if(BACKWARD_SHARED) endif() add_library(backward ${libtype} backward.cpp) target_compile_definitions(backward PUBLIC ${BACKWARD_DEFINITIONS}) -target_include_directories(backward PUBLIC ${BACKWARD_INCLUDE_DIRS}) - -############################################################################### -# TESTS -############################################################################### - -if(BACKWARD_TESTS) - enable_testing() - - add_library(test_main OBJECT test/_test_main.cpp) - - macro(backward_add_test src) - get_filename_component(name ${src} NAME_WE) - set(test_name "test_${name}") - - add_executable(${test_name} ${src} ${ARGN} $) - - target_link_libraries(${test_name} PRIVATE Backward::Backward) - - add_test(NAME ${name} COMMAND ${test_name}) - endmacro() - - # Tests without backward.cpp - set(TESTS - test - stacktrace - rectrace - select_signals - ) - - foreach(test ${TESTS}) - backward_add_test(test/${test}.cpp) - endforeach() - - # Tests with backward.cpp - set(TESTS - suicide - ) - - foreach(test ${TESTS}) - backward_add_test(test/${test}.cpp ${BACKWARD_ENABLE}) - endforeach() -endif() - -install( - FILES "backward.hpp" - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -) -install( - FILES "BackwardConfig.cmake" - DESTINATION ${CMAKE_INSTALL_LIBDIR}/backward -) +target_include_directories(backward PUBLIC ${BACKWARD_INCLUDE_DIRS}) \ No newline at end of file diff --git a/debian/control b/debian/control index 1ae3c0b44..1ef10c0ad 100644 --- a/debian/control +++ b/debian/control @@ -13,7 +13,7 @@ Build-Depends: cmake, libsqlite3-dev, libssl-dev (>= 1.0), libunwind-dev | libunwind-13-dev, - libdwarf-dev, + binutils-dev, perl, ragel, zlib1g-dev diff --git a/rpm/rspamd.spec b/rpm/rspamd.spec index 0d640dfcf..c2c028d37 100644 --- a/rpm/rspamd.spec +++ b/rpm/rspamd.spec @@ -65,7 +65,7 @@ BuildRequires: pcre2-devel BuildRequires: ragel BuildRequires: sqlite-devel BuildRequires: systemd -BuildRequires: libdwarf-devel +BuildRequires: binutils-devel Requires(pre): shadow-utils Requires(post): systemd Requires(preun): systemd -- 2.39.5