Skip to content

Commit fdf5222

Browse files
committed
Make the library modular usable.
1 parent a33e198 commit fdf5222

File tree

4 files changed

+63
-14
lines changed

4 files changed

+63
-14
lines changed

build.jam

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright René Ferdinand Rivera Morell 2023
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE_1_0.txt or copy at
4+
# http://www.boost.org/LICENSE_1_0.txt)
5+
6+
import project ;
7+
8+
project /boost/stacktrace
9+
: common-requirements
10+
<source>/boost/array//boost_array
11+
<source>/boost/config//boost_config
12+
<source>/boost/container_hash//boost_container_hash
13+
<source>/boost/core//boost_core
14+
<source>/boost/predef//boost_predef
15+
<source>/boost/static_assert//boost_static_assert
16+
<source>/boost/type_traits//boost_type_traits
17+
<source>/boost/winapi//boost_winapi
18+
<include>include
19+
;
20+
21+
explicit
22+
[ alias boost_stacktrace_noop : build//boost_stacktrace_noop ]
23+
[ alias boost_stacktrace_backtrace : build//boost_stacktrace_backtrace ]
24+
[ alias boost_stacktrace_addr2line : build//boost_stacktrace_addr2line ]
25+
[ alias boost_stacktrace_basic : build//boost_stacktrace_basic ]
26+
[ alias boost_stacktrace_windbg : build//boost_stacktrace_windbg ]
27+
[ alias boost_stacktrace_windbg_cached : build//boost_stacktrace_windbg_cached ]
28+
[ alias boost_stacktrace : boost_stacktrace_noop ]
29+
[ alias all :
30+
boost_stacktrace_noop
31+
boost_stacktrace_backtrace
32+
boost_stacktrace_addr2line
33+
boost_stacktrace_basic
34+
boost_stacktrace_windbg
35+
boost_stacktrace_windbg_cached
36+
test
37+
]
38+
;
39+
40+
call-if : boost-library stacktrace
41+
: install
42+
boost_stacktrace_addr2line
43+
boost_stacktrace_backtrace
44+
boost_stacktrace_basic
45+
boost_stacktrace_from_exception
46+
boost_stacktrace_noop
47+
boost_stacktrace_windbg
48+
boost_stacktrace_windbg_cached
49+
;

build/Jamfile.v2

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

8+
require-b2 5.0.1 ;
9+
import-search /boost/config/checks ;
10+
import config : requires ;
811
import feature ;
9-
import ../../config/checks/config : requires ;
1012

1113
project
12-
: source-location .
1314
: requirements
1415
[ requires cxx11_rvalue_references ]
1516
: default-build
@@ -76,7 +77,7 @@ lib boost_stacktrace_backtrace
7677
<target-os>linux:<library>dl
7778
<library>backtrace
7879
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
79-
[ check-target-builds ../build//libbacktrace : : <build>no ]
80+
[ check-target-builds libbacktrace : : <build>no ]
8081
: # default build
8182
: # usage-requirements
8283
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -89,7 +90,7 @@ lib boost_stacktrace_addr2line
8990
<warnings>all
9091
<target-os>linux:<library>dl
9192
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
92-
[ check-target-builds ../build//addr2line : : <build>no ]
93+
[ check-target-builds addr2line : : <build>no ]
9394
: # default build
9495
: # usage-requirements
9596
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -102,7 +103,7 @@ lib boost_stacktrace_basic
102103
<warnings>all
103104
<target-os>linux:<library>dl
104105
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
105-
[ check-target-builds ../build//WinDbg : <build>no ]
106+
[ check-target-builds WinDbg : <build>no ]
106107
: # default build
107108
: # usage-requirements
108109
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -115,7 +116,7 @@ lib boost_stacktrace_windbg
115116
<warnings>all
116117
<library>Dbgeng <library>ole32
117118
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
118-
[ check-target-builds ../build//WinDbg : : <build>no ]
119+
[ check-target-builds WinDbg : : <build>no ]
119120
: # default build
120121
: # usage-requirements
121122
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -128,7 +129,7 @@ lib boost_stacktrace_windbg_cached
128129
<warnings>all
129130
<library>Dbgeng <library>ole32
130131
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
131-
[ check-target-builds ../build//WinDbgCached : : <build>no ]
132+
[ check-target-builds WinDbgCached : : <build>no ]
132133
: # default build
133134
: # usage-requirements
134135
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -146,10 +147,8 @@ lib boost_stacktrace_from_exception
146147
<boost.stacktrace.from_exception>off:<build>no
147148

148149
# Require usable libbacktrace on other platforms
149-
[ check-target-builds ../build//libbacktrace : : <build>no ]
150+
[ check-target-builds libbacktrace : : <build>no ]
150151
: # default build
151152
: # usage-requirements
152153
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
153154
;
154-
155-
boost-install boost_stacktrace_noop boost_stacktrace_backtrace boost_stacktrace_addr2line boost_stacktrace_basic boost_stacktrace_windbg boost_stacktrace_windbg_cached boost_stacktrace_from_exception ;

example/user_config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)
66

7-
#define BOOST_USER_CONFIG <libs/stacktrace/example/user_config.hpp>
7+
#define BOOST_USER_CONFIG <example/user_config.hpp>
88

99
#include <boost/array.hpp>
1010
#include <exception> // std::set_terminate, std::abort

test/Jamfile.v2

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

8-
import ../../config/checks/config : requires ;
8+
import config : requires ;
99

1010
lib dl : : <link>shared ;
1111
lib gcc_s ;
@@ -31,6 +31,7 @@ project
3131
<warnings>all
3232
<test-info>always_show_run_output
3333
<visibility>hidden
34+
<include>..
3435
;
3536

3637
local FORCE_SYMBOL_EXPORT = <target-os>freebsd:<linkflags>"-rdynamic" <target-os>solaris:<linkflags>"-Bdynamic" <target-os>aix:<linkflags>"-rdynamic"
@@ -203,12 +204,12 @@ for local p in [ glob ../example/*.cpp ]
203204
local additional_dependency = ;
204205
if $(target_name) = "terminate_handler"
205206
{
206-
additional_dependency = <library>/boost/filesystem//boost_filesystem <library>/boost/system//boost_system <target-os>linux:<library>rt ;
207+
additional_dependency = <library>/boost/filesystem//boost_filesystem <library>/boost/system//boost_system <target-os>linux:<library>rt <library>/boost/interprocess//boost_interprocess ;
207208
}
208209

209210
if $(target_name) = "throwing_st"
210211
{
211-
additional_dependency = [ requires rtti ] ;
212+
additional_dependency = [ requires rtti ] <library>/boost/exception//boost_exception ;
212213
}
213214

214215
stacktrace_tests += [ run $(p) : : : <debug-symbols>on $(LINKSHARED_BT) $(additional_dependency) : backtrace_$(p2[1]:B) ] ;

0 commit comments

Comments
 (0)