fix: Fix backtrace usage (#1932)

This commit is contained in:
Sergey Kuznetsov
2025-02-27 14:26:51 +00:00
committed by GitHub
parent 918a92eeee
commit b909b8879d
2 changed files with 9 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
if (Boost_STACKTRACE_FOUND)
if ("${san}" STREQUAL "")
target_compile_definitions(clio_options INTERFACE BOOST_STACKTRACE_LINK)
target_compile_definitions(clio_options INTERFACE BOOST_STACKTRACE_USE_BACKTRACE)
find_package(libbacktrace REQUIRED CONFIG)
@@ -7,4 +7,5 @@ else ()
# capabilities and there are conflicts. In any case, this makes sure Clio code knows that backtrace is not available.
# See relevant conan profiles for sanitizers where we disable stacktrace in Boost explicitly.
target_compile_definitions(clio_options INTERFACE CLIO_WITHOUT_STACKTRACE)
message(STATUS "Sanitizer enabled, disabling stacktrace")
endif ()

View File

@@ -38,21 +38,15 @@ target_sources(
newconfig/ValueView.cpp
)
target_link_libraries(
clio_util
PUBLIC Boost::headers
dl
fmt::fmt
openssl::openssl
xrpl::libxrpl
Threads::Threads
clio_options
)
if (!san)
target_link_libraries(clio_util PUBLIC Boost::stacktrace_backtrace libbacktrace::libbacktrace)
# This must be above the target_link_libraries call otherwise backtrace doesn't work
if ("${san}" STREQUAL "")
target_link_libraries(clio_util PUBLIC Boost::stacktrace_backtrace dl libbacktrace::libbacktrace)
endif ()
target_link_libraries(
clio_util PUBLIC Boost::headers fmt::fmt openssl::openssl xrpl::libxrpl Threads::Threads clio_options
)
# FIXME: needed on gcc-12, clang-16 and AppleClang for now (known boost 1.82 issue for some compilers)
#
# For some reason cmake doesn't propagate the compile definitions from clio_options so we need to add them here