Skip to content

Commit 24ced35

Browse files
committed
Better diagnostics and faster configure times
1 parent 2ec4bac commit 24ced35

File tree

1 file changed

+46
-15
lines changed

1 file changed

+46
-15
lines changed

build/Jamfile.v2

+46-15
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require-b2 5.0.1 ;
99
import-search /boost/config/checks ;
1010
import boost-stacktrace-features ;
1111
import config : requires ;
12+
import configure ;
1213
import property ;
1314

1415
constant boost_dependencies_private :
@@ -66,9 +67,10 @@ explicit WinDbgCached ;
6667
rule build-stacktrace-noop ( props * )
6768
{
6869
local enabled = [ property.select <boost.stacktrace.noop> : $(props) ] ;
69-
if $(enabled:G=) = "off"
70+
switch $(enabled:G=)
7071
{
71-
return <build>no ;
72+
case "on" : return ;
73+
case "off" : return <build>no ;
7274
}
7375
}
7476

@@ -88,7 +90,13 @@ lib boost_stacktrace_noop
8890
rule build-stacktrace-backtrace ( props * )
8991
{
9092
local enabled = [ property.select <boost.stacktrace.backtrace> : $(props) ] ;
91-
if $(enabled:G=) = "off"
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" ]
92100
{
93101
return <build>no ;
94102
}
@@ -103,7 +111,6 @@ lib boost_stacktrace_backtrace
103111
<library>backtrace
104112
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
105113
<conditional>@build-stacktrace-backtrace
106-
[ check-target-builds libbacktrace : : <build>no ]
107114
: # default build
108115
: # usage-requirements
109116
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -113,13 +120,20 @@ lib boost_stacktrace_backtrace
113120
rule build-stacktrace-addr2line ( props * )
114121
{
115122
local enabled = [ property.select <boost.stacktrace.addr2line> : $(props) ] ;
116-
if $(enabled:G=) = "off"
123+
switch $(enabled:G=)
117124
{
118-
return <build>no ;
125+
case "on" : return ;
126+
case "off" : return <build>no ;
119127
}
120128

121129
# Disable by default on Windows when not using Cygwin
122130
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" ]
123137
{
124138
return <build>no ;
125139
}
@@ -133,7 +147,6 @@ lib boost_stacktrace_addr2line
133147
<target-os>linux:<library>dl
134148
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
135149
<conditional>@build-stacktrace-addr2line
136-
[ check-target-builds addr2line : : <build>no ]
137150
: # default build
138151
: # usage-requirements
139152
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -143,7 +156,13 @@ lib boost_stacktrace_addr2line
143156
rule build-stacktrace-basic ( props * )
144157
{
145158
local enabled = [ property.select <boost.stacktrace.basic> : $(props) ] ;
146-
if $(enabled:G=) = "off"
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" ]
147166
{
148167
return <build>no ;
149168
}
@@ -157,7 +176,6 @@ lib boost_stacktrace_basic
157176
<target-os>linux:<library>dl
158177
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
159178
<conditional>@build-stacktrace-basic
160-
[ check-target-builds WinDbg : <build>no ]
161179
: # default build
162180
: # usage-requirements
163181
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -167,7 +185,13 @@ lib boost_stacktrace_basic
167185
rule build-stacktrace-windbg ( props * )
168186
{
169187
local enabled = [ property.select <boost.stacktrace.windbg> : $(props) ] ;
170-
if $(enabled:G=) = "off"
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" ]
171195
{
172196
return <build>no ;
173197
}
@@ -181,7 +205,6 @@ lib boost_stacktrace_windbg
181205
<library>Dbgeng <library>ole32
182206
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
183207
<conditional>@build-stacktrace-windbg
184-
[ check-target-builds WinDbg : : <build>no ]
185208
: # default build
186209
: # usage-requirements
187210
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -191,7 +214,13 @@ lib boost_stacktrace_windbg
191214
rule build-stacktrace-windbg-cached ( props * )
192215
{
193216
local enabled = [ property.select <boost.stacktrace.windbg_cached> : $(props) ] ;
194-
if $(enabled:G=) = "off"
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" ]
195224
{
196225
return <build>no ;
197226
}
@@ -205,7 +234,6 @@ lib boost_stacktrace_windbg_cached
205234
<library>Dbgeng <library>ole32
206235
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
207236
<conditional>@build-stacktrace-windbg-cached
208-
[ check-target-builds WinDbgCached : : <build>no ]
209237
: # default build
210238
: # usage-requirements
211239
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -215,16 +243,19 @@ lib boost_stacktrace_windbg_cached
215243
rule build-stacktrace-from-exception ( props * )
216244
{
217245
local enabled = [ property.select <boost.stacktrace.from_exception> : $(props) ] ;
218-
if $(enabled:G=) = "off"
246+
switch $(enabled:G=)
219247
{
220-
return <build>no ;
248+
case "on" : return ;
249+
case "off" : return <build>no ;
221250
}
222251

223252
local arch = [ property.select <architecture> : $(props) ] ;
224253
if $(arch) && ( $(arch:G=) != x86 )
225254
{
255+
configure.log-library-search-result "boost.stacktrace.from_exception" : "no" ;
226256
return <build>no ;
227257
}
258+
configure.log-library-search-result "boost.stacktrace.from_exception" : "yes" ;
228259
}
229260

230261
lib boost_stacktrace_from_exception

0 commit comments

Comments
 (0)