From 95caaeaf9997d4626adace17e46fcd1081e8eac7 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Sat, 17 Feb 2024 10:26:49 +0300 Subject: [PATCH] Option to disable boost_stacktrace_from_exception library build --- build/Jamfile.v2 | 5 +++++ doc/stacktrace.qbk | 4 ++++ src/from_exception.cpp | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 6f4eec5..bafe644 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -5,6 +5,7 @@ # http://www.boost.org/LICENSE_1_0.txt) # +import feature ; import ../../config/checks/config : requires ; project @@ -20,6 +21,7 @@ lib gcc_s ; lib Dbgeng ; lib ole32 ; +feature.feature boost.stacktrace.from_exception : on off : optional propagated ; local LIBBACKTRACE_PATH = [ modules.peek : LIBBACKTRACE_PATH ] ; lib backtrace @@ -140,6 +142,9 @@ lib boost_stacktrace_from_exception linux:dl windows:no # not supported at the moment + # Command line option to disable build + off:no + # Require usable libbacktrace on other platforms [ check-target-builds ../build//libbacktrace : : no ] : # default build diff --git a/doc/stacktrace.qbk b/doc/stacktrace.qbk index d31e888..30d43cf 100644 --- a/doc/stacktrace.qbk +++ b/doc/stacktrace.qbk @@ -186,6 +186,10 @@ consumption of the application, as the exceptions now additionally store traces. At runtime switch boost::stacktrace::this_thread::set_capture_stacktraces_at_throw() allows to disable/enable capturing and storing traces in exceptions. +To disable the `boost_stacktrace_from_exception` library builds the +`boost.stacktrace.from_exception=off` option, for example +`./b2 boost.stacktrace.from_exception=off`. + [endsect] diff --git a/src/from_exception.cpp b/src/from_exception.cpp index 676a748..33dbe58 100644 --- a/src/from_exception.cpp +++ b/src/from_exception.cpp @@ -32,7 +32,10 @@ \ Define `BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK` to \ suppress this error if the library would not be used with libc++ \ - runtime (for example, would be used with GCC's runtime). + runtime (for example, it would be only used with GCC runtime). \ + \ + Otherwise, disable the boost_stacktrace_from_exception library build \ + (for example by `./b2 boost.stacktrace.from_exception=off` option). #endif