Skip to content

Commit 2ec4bac

Browse files
authored
Cleanup Jamfile.v2 and make separate rules for each feature check (#204)
1 parent 7e22b77 commit 2ec4bac

File tree

1 file changed

+19
-30
lines changed

1 file changed

+19
-30
lines changed

build/Jamfile.v2

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ explicit WinDbgCached ;
6666
rule build-stacktrace-noop ( props * )
6767
{
6868
local enabled = [ property.select <boost.stacktrace.noop> : $(props) ] ;
69-
switch $(enabled:G=)
69+
if $(enabled:G=) = "off"
7070
{
71-
case "on" : return ;
72-
case "off" : return <build>no ;
71+
return <build>no ;
7372
}
7473
}
7574

@@ -79,7 +78,6 @@ lib boost_stacktrace_noop
7978
: # requirements
8079
<warnings>all
8180
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
82-
# Enable build when explicitly requested
8381
<conditional>@build-stacktrace-noop
8482
: # default build
8583
: # usage-requirements
@@ -90,10 +88,9 @@ lib boost_stacktrace_noop
9088
rule build-stacktrace-backtrace ( props * )
9189
{
9290
local enabled = [ property.select <boost.stacktrace.backtrace> : $(props) ] ;
93-
switch $(enabled:G=)
91+
if $(enabled:G=) = "off"
9492
{
95-
case "on" : return ;
96-
case "off" : return <build>no ;
93+
return <build>no ;
9794
}
9895
}
9996

@@ -105,8 +102,8 @@ lib boost_stacktrace_backtrace
105102
<target-os>linux:<library>dl
106103
<library>backtrace
107104
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
108-
[ check-target-builds libbacktrace : : <build>no ]
109105
<conditional>@build-stacktrace-backtrace
106+
[ check-target-builds libbacktrace : : <build>no ]
110107
: # default build
111108
: # usage-requirements
112109
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -116,10 +113,9 @@ lib boost_stacktrace_backtrace
116113
rule build-stacktrace-addr2line ( props * )
117114
{
118115
local enabled = [ property.select <boost.stacktrace.addr2line> : $(props) ] ;
119-
switch $(enabled:G=)
116+
if $(enabled:G=) = "off"
120117
{
121-
case "on" : return ;
122-
case "off" : return <build>no ;
118+
return <build>no ;
123119
}
124120

125121
# Disable by default on Windows when not using Cygwin
@@ -136,8 +132,8 @@ lib boost_stacktrace_addr2line
136132
<warnings>all
137133
<target-os>linux:<library>dl
138134
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
139-
[ check-target-builds addr2line : : <build>no ]
140135
<conditional>@build-stacktrace-addr2line
136+
[ check-target-builds addr2line : : <build>no ]
141137
: # default build
142138
: # usage-requirements
143139
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -147,10 +143,9 @@ lib boost_stacktrace_addr2line
147143
rule build-stacktrace-basic ( props * )
148144
{
149145
local enabled = [ property.select <boost.stacktrace.basic> : $(props) ] ;
150-
switch $(enabled:G=)
146+
if $(enabled:G=) = "off"
151147
{
152-
case "on" : return ;
153-
case "off" : return <build>no ;
148+
return <build>no ;
154149
}
155150
}
156151

@@ -161,8 +156,8 @@ lib boost_stacktrace_basic
161156
<warnings>all
162157
<target-os>linux:<library>dl
163158
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
164-
[ check-target-builds WinDbg : <build>no ]
165159
<conditional>@build-stacktrace-basic
160+
[ check-target-builds WinDbg : <build>no ]
166161
: # default build
167162
: # usage-requirements
168163
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -172,10 +167,9 @@ lib boost_stacktrace_basic
172167
rule build-stacktrace-windbg ( props * )
173168
{
174169
local enabled = [ property.select <boost.stacktrace.windbg> : $(props) ] ;
175-
switch $(enabled:G=)
170+
if $(enabled:G=) = "off"
176171
{
177-
case "on" : return ;
178-
case "off" : return <build>no ;
172+
return <build>no ;
179173
}
180174
}
181175

@@ -186,8 +180,8 @@ lib boost_stacktrace_windbg
186180
<warnings>all
187181
<library>Dbgeng <library>ole32
188182
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
189-
[ check-target-builds WinDbg : : <build>no ]
190183
<conditional>@build-stacktrace-windbg
184+
[ check-target-builds WinDbg : : <build>no ]
191185
: # default build
192186
: # usage-requirements
193187
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -197,10 +191,9 @@ lib boost_stacktrace_windbg
197191
rule build-stacktrace-windbg-cached ( props * )
198192
{
199193
local enabled = [ property.select <boost.stacktrace.windbg_cached> : $(props) ] ;
200-
switch $(enabled:G=)
194+
if $(enabled:G=) = "off"
201195
{
202-
case "on" : return ;
203-
case "off" : return <build>no ;
196+
return <build>no ;
204197
}
205198
}
206199

@@ -211,8 +204,8 @@ lib boost_stacktrace_windbg_cached
211204
<warnings>all
212205
<library>Dbgeng <library>ole32
213206
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
214-
[ check-target-builds WinDbgCached : : <build>no ]
215207
<conditional>@build-stacktrace-windbg-cached
208+
[ check-target-builds WinDbgCached : : <build>no ]
216209
: # default build
217210
: # usage-requirements
218211
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
@@ -222,10 +215,9 @@ lib boost_stacktrace_windbg_cached
222215
rule build-stacktrace-from-exception ( props * )
223216
{
224217
local enabled = [ property.select <boost.stacktrace.from_exception> : $(props) ] ;
225-
switch $(enabled:G=)
218+
if $(enabled:G=) = "off"
226219
{
227-
case "on" : return ;
228-
case "off" : return <build>no ;
220+
return <build>no ;
229221
}
230222

231223
local arch = [ property.select <architecture> : $(props) ] ;
@@ -244,9 +236,6 @@ lib boost_stacktrace_from_exception
244236

245237
# Enable build when explicitly requested, or by default, when on x86
246238
<conditional>@build-stacktrace-from-exception
247-
248-
# Require usable libbacktrace on other platforms
249-
# [ check-target-builds libbacktrace : : <build>no ]
250239
: # default build
251240
: # usage-requirements
252241
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1

0 commit comments

Comments
 (0)