diff --git a/src/build/build-request.jam b/src/build/build-request.jam index 8f26de0d3..2614b0615 100644 --- a/src/build/build-request.jam +++ b/src/build/build-request.jam @@ -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 diff --git a/src/build/property-set.jam b/src/build/property-set.jam index 283f3191c..4f85c049b 100644 --- a/src/build/property-set.jam +++ b/src/build/property-set.jam @@ -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__) ; diff --git a/src/build/targets.jam b/src/build/targets.jam index de3998c3e..ad740735c 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -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]) ] ; diff --git a/test/property_expansion.py b/test/property_expansion.py new file mode 100644 index 000000000..88f1495d3 --- /dev/null +++ b/test/property_expansion.py @@ -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 : 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() diff --git a/test/test_all.py b/test/test_all.py index 6bbcbfc2a..d3a3fde89 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -99,6 +99,7 @@ tests = [ "project_test1", "c_file", "inline", "conditionals2", + "property_expansion", ] if os.name == 'posix':