Skip to content

Commit

Permalink
Option to disable boost_stacktrace_from_exception library build
Browse files Browse the repository at this point in the history
  • Loading branch information
apolukhin committed Feb 17, 2024
1 parent 906bb0b commit 95caaea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# http://www.boost.org/LICENSE_1_0.txt)
#

import feature ;
import ../../config/checks/config : requires ;

project
Expand All @@ -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
Expand Down Expand Up @@ -140,6 +142,9 @@ lib boost_stacktrace_from_exception
<target-os>linux:<library>dl
<target-os>windows:<build>no # not supported at the moment

# Command line option to disable build
<boost.stacktrace.from_exception>off:<build>no

# Require usable libbacktrace on other platforms
[ check-target-builds ../build//libbacktrace : : <build>no ]
: # default build
Expand Down
4 changes: 4 additions & 0 deletions doc/stacktrace.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -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]


Expand Down
5 changes: 4 additions & 1 deletion src/from_exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 95caaea

Please sign in to comment.