2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-11 11:42:14 +00:00

Fix BB38 (composite properties expansion buggy).

* new/build-request.jam
  (expand-no-defaults): Don't expand composites.

* new/targets.jam
  (main-target.generate): Expand composites.

* test/property_expansion.py: New test.


[SVN r19240]
This commit is contained in:
Vladimir Prus
2003-07-21 05:55:42 +00:00
parent 35aa067d95
commit 1a7819fe34
5 changed files with 48 additions and 4 deletions

View File

@@ -32,9 +32,7 @@ rule expand-no-defaults ( property-sets * )
# Now combine all of the expanded property-sets
local product = [ x-product $(expanded-property-sets) : $(feature-space) ] ;
return [
sequence.transform apply-to-property-set feature.expand-composites
: $(product) ] ;
return $(product) ;
}
# implementaiton of x-product, below

View File

@@ -104,7 +104,17 @@ local rule property-set ( raw-properties * )
}
return $(self.refined.$(ps)) ;
}
rule expand-composites ( )
{
if ! $(self.composites)
{
self.composites = [ property-set.create
[ feature.expand-composites $(self.raw) ] ] ;
}
return $(self.composites) ;
}
rule evaluate-conditionals ( context ? )
{
context ?= $(__name__) ;

View File

@@ -412,6 +412,7 @@ rule main-target ( name : project )
local result ;
for local p in $(all-property-sets)
{
p = [ $(p).expand-composites ] ;
p = [ $(p).add-defaults ] ;
local r = [ generate-really $(p) ] ;
usage-requirements = [ $(usage-requirements).add $(r[1]) ] ;

View File

@@ -0,0 +1,34 @@
#!/usr/bin/python
# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
from BoostBuild import Tester, List
# Test that free property inside
t = Tester()
t.write("project-root.jam", """
project ;
variant debug-AA : debug : <define>AA ;
alias all : hello ;
exe hello : hello.cpp ;
explicit hello ;
""")
t.write("hello.cpp", """
#ifdef AA
int main()
{
return 0;
}
#endif
""")
t.run_build_system("debug-AA")
t.cleanup()

View File

@@ -99,6 +99,7 @@ tests = [ "project_test1",
"c_file",
"inline",
"conditionals2",
"property_expansion",
]
if os.name == 'posix':