Boost logo

Boost-Build :

From: Pedro Ferreira (pedro.ferreira_at_[hidden])
Date: 2003-12-18 09:24:01


> Hmm... I'm getting picky again. Seems like now there are two places which
> iterate over target list and selected those of needed type. Maybe, it can
be
> done in one place?

Attached (Still relative to the original).

Pedro
 ------=_NextPart_000_0048_01C3C572.951152F0 Content-Type: text/plain;
name="patch.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="patch.txt"

Index: tools/stage.jam
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/cvs/Workspace/boost-build/tools/stage.jam,v
retrieving revision 1.4
retrieving revision 1.6
diff -u -r1.4 -r1.6
--- tools/stage.jam 15 Dec 2003 17:46:02 -0000 1.4
+++ tools/stage.jam 18 Dec 2003 14:21:38 -0000 1.6
@@ -93,6 +93,8 @@
$(self.project) ] ;
}
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
+ local include-types =3D [ $(property-set).get <include-type> ] ;
+=20=20=20=20=20=20=20=20
local result ;
for local i in $(source-targets)
{
@@ -139,8 +141,8 @@
=20=20=20=20=20=20=20=20=20=20=20=20=20
# FIXME: Since we can have <location> property, it might be be=
tter
# to use it to distinguish staged copies with different locati=
ons.
- for t in $(i2)
- {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
+ for t in [ select-included $(i2) : $(include-types) ]
+ {
$(t).set-path $(location) ;
result +=3D [ virtual-target.register $(t) ] ; =
=20=20=20=20
}=20=20=20=20=20=20=20=20=20=20=20=20
@@ -149,6 +151,24 @@
return $(result) ;
}=20=20=20
=20=20=20=20=20
+ rule select-included ( source-targets * : types-to-include * )
+ {
+ local result-targets ;
+ for local r in $(source-targets)
+ {
+ local ty =3D [ $(r).type ] ;=20=20=20=20=20=20=20=20
+ if $(ty)
+ {
+ if [ include-type $(ty) : $(types-to-include) ] =
=20=20=20=20=20=20=20
+ {
+ result-targets +=3D $(r) ;
+ }=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
+ }=20=20=20=20=20=20=20=20=20=20=20
+ }
+=20=20=20=20=20=20=20=20
+ return $(result-targets) ;
+ }
+=20=20=20=20
rule collect-targets ( targets * : types-to-include * )
{
# Find subvariants
@@ -168,18 +188,7 @@
=20=20=20=20=20=20=20=20=20
if $(types-to-include)
{
- local result2 ;
- for local r in $(result)
- {
- if [ $(r).type ]
- {
- if [ include-type [ $(r).type ] : $(types-to-include) =
]=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
- {
- result2 +=3D $(r) ;
- }=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
- }=20=20=20=20=20=20=20=20=20=20=20
- }=20=20=20=20=20=20=20=20=20=20=20
- return $(result2) ;
+ return [ select-included $(result) : $(types-to-include) ] ;
}
else
{
 ------=_NextPart_000_0048_01C3C572.951152F0--


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk