diff --git a/cmake/deps/Boost.cmake b/cmake/deps/Boost.cmake index 80c652f0ac..3b4e165dcf 100644 --- a/cmake/deps/Boost.cmake +++ b/cmake/deps/Boost.cmake @@ -55,13 +55,20 @@ endif() # stack-use-after-scope errors. BOOST_USE_UCONTEXT ensures the ucontext backend # is selected (fcontext does not support ASAN annotations). # These defines must match what Boost was compiled with (see conan/profiles/sanitizers). -# TSAN also requires the ucontext backend so that Boost.Context uses -# POSIX ucontext (not fcontext assembly) for fiber switching. This -# allows TSAN to properly track context switches and avoids false positives. -# These defines must match what Boost was compiled with (see conan/profiles/sanitizers). -if(enable_asan OR enable_tsan) +if(enable_asan) target_compile_definitions( xrpl_boost INTERFACE BOOST_USE_ASAN BOOST_USE_UCONTEXT ) endif() + +# TSAN also requires the ucontext backend so that Boost.Context uses +# POSIX ucontext (not fcontext assembly) for fiber switching. This +# allows TSAN to properly track context switches and avoids false positives. +# These defines must match what Boost was compiled with (see conan/profiles/sanitizers). +if(enable_tsan) + target_compile_definitions( + xrpl_boost + INTERFACE BOOST_USE_TSAN BOOST_USE_UCONTEXT + ) +endif()