@@ -9,6 +9,7 @@ require-b2 5.0.1 ;
9
9
import-search /boost/config/checks ;
10
10
import boost-stacktrace-features ;
11
11
import config : requires ;
12
+ import configure ;
12
13
import property ;
13
14
14
15
constant boost_dependencies_private :
@@ -63,9 +64,9 @@ explicit WinDbg ;
63
64
mp-run-simple has_windbg_cached.cpp : : : <library>Dbgeng <library>ole32 : WinDbgCached ;
64
65
explicit WinDbgCached ;
65
66
66
- rule build-stacktrace-feature ( name : props * )
67
+ rule build-stacktrace-noop ( props * )
67
68
{
68
- local enabled = [ property.select <boost.stacktrace.$(name) > : $(props) ] ;
69
+ local enabled = [ property.select <boost.stacktrace.noop > : $(props) ] ;
69
70
switch $(enabled:G=)
70
71
{
71
72
case "on" : return ;
@@ -79,14 +80,28 @@ lib boost_stacktrace_noop
79
80
: # requirements
80
81
<warnings>all
81
82
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
82
- # Enable build when explicitly requested
83
- <conditional>@$(build-stacktrace-feature noop)
83
+ <conditional>@build-stacktrace-noop
84
84
: # default build
85
85
: # usage-requirements
86
86
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
87
87
<define>BOOST_STACKTRACE_NO_LIB=1
88
88
;
89
89
90
+ rule build-stacktrace-backtrace ( props * )
91
+ {
92
+ local enabled = [ property.select <boost.stacktrace.backtrace> : $(props) ] ;
93
+ switch $(enabled:G=)
94
+ {
95
+ case "on" : return ;
96
+ case "off" : return <build>no ;
97
+ }
98
+
99
+ if ! [ configure.builds libbacktrace : $(props) : "boost.stacktrace.backtrace" ]
100
+ {
101
+ return <build>no ;
102
+ }
103
+ }
104
+
90
105
lib boost_stacktrace_backtrace
91
106
: # sources
92
107
../src/backtrace.cpp
@@ -95,8 +110,7 @@ lib boost_stacktrace_backtrace
95
110
<target-os>linux:<library>dl
96
111
<library>backtrace
97
112
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
98
- [ check-target-builds libbacktrace : : <build>no ]
99
- <conditional>@$(build-stacktrace-feature backtrace)
113
+ <conditional>@build-stacktrace-backtrace
100
114
: # default build
101
115
: # usage-requirements
102
116
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -114,6 +128,12 @@ rule build-stacktrace-addr2line ( props * )
114
128
115
129
# Disable by default on Windows when not using Cygwin
116
130
if <target-os>windows in $(props) && ! ( <target-os>cygwin in $(props) )
131
+ {
132
+ configure.log-library-search-result "boost.stacktrace.addr2line" : "no" ;
133
+ return <build>no ;
134
+ }
135
+
136
+ if ! [ configure.builds addr2line : $(props) : "boost.stacktrace.addr2line" ]
117
137
{
118
138
return <build>no ;
119
139
}
@@ -126,53 +146,94 @@ lib boost_stacktrace_addr2line
126
146
<warnings>all
127
147
<target-os>linux:<library>dl
128
148
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
129
- [ check-target-builds addr2line : : <build>no ]
130
149
<conditional>@build-stacktrace-addr2line
131
150
: # default build
132
151
: # usage-requirements
133
152
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
134
153
<define>BOOST_STACKTRACE_NO_LIB=1
135
154
;
136
155
156
+ rule build-stacktrace-basic ( props * )
157
+ {
158
+ local enabled = [ property.select <boost.stacktrace.basic> : $(props) ] ;
159
+ switch $(enabled:G=)
160
+ {
161
+ case "on" : return ;
162
+ case "off" : return <build>no ;
163
+ }
164
+
165
+ if [ configure.builds WinDbg : $(props) : "boost.stacktrace.basic" ]
166
+ {
167
+ return <build>no ;
168
+ }
169
+ }
170
+
137
171
lib boost_stacktrace_basic
138
172
: # sources
139
173
../src/basic.cpp
140
174
: # requirements
141
175
<warnings>all
142
176
<target-os>linux:<library>dl
143
177
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
144
- [ check-target-builds WinDbg : <build>no ]
145
- <conditional>@$(build-stacktrace-feature basic)
178
+ <conditional>@build-stacktrace-basic
146
179
: # default build
147
180
: # usage-requirements
148
181
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
149
182
<define>BOOST_STACKTRACE_NO_LIB=1
150
183
;
151
184
185
+ rule build-stacktrace-windbg ( props * )
186
+ {
187
+ local enabled = [ property.select <boost.stacktrace.windbg> : $(props) ] ;
188
+ switch $(enabled:G=)
189
+ {
190
+ case "on" : return ;
191
+ case "off" : return <build>no ;
192
+ }
193
+
194
+ if ! [ configure.builds WinDbg : $(props) : "boost.stacktrace.windbg" ]
195
+ {
196
+ return <build>no ;
197
+ }
198
+ }
199
+
152
200
lib boost_stacktrace_windbg
153
201
: # sources
154
202
../src/windbg.cpp
155
203
: # requirements
156
204
<warnings>all
157
205
<library>Dbgeng <library>ole32
158
206
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
159
- [ check-target-builds WinDbg : : <build>no ]
160
- <conditional>@$(build-stacktrace-feature windbg)
207
+ <conditional>@build-stacktrace-windbg
161
208
: # default build
162
209
: # usage-requirements
163
210
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
164
211
<define>BOOST_STACKTRACE_NO_LIB=1
165
212
;
166
213
214
+ rule build-stacktrace-windbg-cached ( props * )
215
+ {
216
+ local enabled = [ property.select <boost.stacktrace.windbg_cached> : $(props) ] ;
217
+ switch $(enabled:G=)
218
+ {
219
+ case "on" : return ;
220
+ case "off" : return <build>no ;
221
+ }
222
+
223
+ if ! [ configure.builds WinDbgCached : $(props) : "boost.stacktrace.windbg_cached" ]
224
+ {
225
+ return <build>no ;
226
+ }
227
+ }
228
+
167
229
lib boost_stacktrace_windbg_cached
168
230
: # sources
169
231
../src/windbg_cached.cpp
170
232
: # requirements
171
233
<warnings>all
172
234
<library>Dbgeng <library>ole32
173
235
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
174
- [ check-target-builds WinDbgCached : : <build>no ]
175
- <conditional>@$(build-stacktrace-feature windbg-cached)
236
+ <conditional>@build-stacktrace-windbg-cached
176
237
: # default build
177
238
: # usage-requirements
178
239
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -191,8 +252,10 @@ rule build-stacktrace-from-exception ( props * )
191
252
local arch = [ property.select <architecture> : $(props) ] ;
192
253
if $(arch) && ( $(arch:G=) != x86 )
193
254
{
255
+ configure.log-library-search-result "boost.stacktrace.from_exception" : "no" ;
194
256
return <build>no ;
195
257
}
258
+ configure.log-library-search-result "boost.stacktrace.from_exception" : "yes" ;
196
259
}
197
260
198
261
lib boost_stacktrace_from_exception
@@ -204,9 +267,6 @@ lib boost_stacktrace_from_exception
204
267
205
268
# Enable build when explicitly requested, or by default, when on x86
206
269
<conditional>@build-stacktrace-from-exception
207
-
208
- # Require usable libbacktrace on other platforms
209
- # [ check-target-builds libbacktrace : : <build>no ]
210
270
: # default build
211
271
: # usage-requirements
212
272
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
0 commit comments