Skip to content

Commit 95caaea

Browse files
committed
Option to disable boost_stacktrace_from_exception library build
1 parent 906bb0b commit 95caaea

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

build/Jamfile.v2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# http://www.boost.org/LICENSE_1_0.txt)
66
#
77

8+
import feature ;
89
import ../../config/checks/config : requires ;
910

1011
project
@@ -20,6 +21,7 @@ lib gcc_s ;
2021
lib Dbgeng ;
2122
lib ole32 ;
2223

24+
feature.feature boost.stacktrace.from_exception : on off : optional propagated ;
2325

2426
local LIBBACKTRACE_PATH = [ modules.peek : LIBBACKTRACE_PATH ] ;
2527
lib backtrace
@@ -140,6 +142,9 @@ lib boost_stacktrace_from_exception
140142
<target-os>linux:<library>dl
141143
<target-os>windows:<build>no # not supported at the moment
142144

145+
# Command line option to disable build
146+
<boost.stacktrace.from_exception>off:<build>no
147+
143148
# Require usable libbacktrace on other platforms
144149
[ check-target-builds ../build//libbacktrace : : <build>no ]
145150
: # default build

doc/stacktrace.qbk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ consumption of the application, as the exceptions now additionally store traces.
186186
At runtime switch boost::stacktrace::this_thread::set_capture_stacktraces_at_throw()
187187
allows to disable/enable capturing and storing traces in exceptions.
188188

189+
To disable the `boost_stacktrace_from_exception` library builds the
190+
`boost.stacktrace.from_exception=off` option, for example
191+
`./b2 boost.stacktrace.from_exception=off`.
192+
189193
[endsect]
190194

191195

src/from_exception.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
\
3333
Define `BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK` to \
3434
suppress this error if the library would not be used with libc++ \
35-
runtime (for example, would be used with GCC's runtime).
35+
runtime (for example, it would be only used with GCC runtime). \
36+
\
37+
Otherwise, disable the boost_stacktrace_from_exception library build \
38+
(for example by `./b2 boost.stacktrace.from_exception=off` option).
3639

3740
#endif
3841

0 commit comments

Comments
 (0)