Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64911 - trunk/tools/build/v2/build
From: ghost_at_[hidden]
Date: 2010-08-19 03:47:24


Author: vladimir_prus
Date: 2010-08-19 03:47:23 EDT (Thu, 19 Aug 2010)
New Revision: 64911
URL: http://svn.boost.org/trac/boost/changeset/64911

Log:
Handle conditional requirements in check-target-builds.

Text files modified:
   trunk/tools/build/v2/build/configure.jam | 11 +++++++----
   trunk/tools/build/v2/build/configure.py | 20 ++++++++++++--------
   2 files changed, 19 insertions(+), 12 deletions(-)

Modified: trunk/tools/build/v2/build/configure.jam
==============================================================================
--- trunk/tools/build/v2/build/configure.jam (original)
+++ trunk/tools/build/v2/build/configure.jam 2010-08-19 03:47:23 EDT (Thu, 19 Aug 2010)
@@ -191,18 +191,21 @@
     {
         # FIXME: this should not be hardcoded. Other checks might
         # want to consider different set of features as relevant.
- local toolset = [ property.select <toolset> : $(properties) ] ;
- local ps = [ property-set.create $(toolset) ] ;
+ local relevant = [ property.select <target-os> <toolset> <address-model> <architecture>
+ : $(properties) ] ;
+ local ps = [ property-set.create $(relevant) ] ;
         local t = [ targets.current ] ;
         local p = [ $(t).project ] ;
+ local choosen ;
         if [ configure.builds $(self.target) : $(p) : $(ps) : "$(self.target) builds" ]
         {
- return $(self.true-properties) ;
+ choosen = $(self.true-properties) ;
         }
         else
         {
- return $(self.false-properties) ;
+ choosen = $(self.false-properties) ;
         }
+ return [ property.evaluate-conditionals-in-context $(choosen) : $(properties) ] ;
     }
 }
 

Modified: trunk/tools/build/v2/build/configure.py
==============================================================================
--- trunk/tools/build/v2/build/configure.py (original)
+++ trunk/tools/build/v2/build/configure.py 2010-08-19 03:47:23 EDT (Thu, 19 Aug 2010)
@@ -130,21 +130,25 @@
 
     def __init__(self, target, true_properties, false_properties):
         self.target = target
- self.true_properties = property.create_from_strings(true_properties)
- self.false_properties = property.create_from_strings(false_properties)
+ self.true_properties = property.create_from_strings(true_properties, True)
+ self.false_properties = property.create_from_strings(false_properties, True)
 
     def check(self, ps):
         
         # FIXME: this should not be hardcoded. Other checks might
         # want to consider different set of features as relevant.
- toolset = ps.get_properties('toolset')[0]
- ps = property_set.create([toolset])
+ relevant = ps.get_properties('target-os') + \
+ ps.get_properties("toolset") + \
+ ps.get_properties("address-model") + \
+ ps.get_properties("architecture")
+ rps = property_set.create(relevant)
         t = get_manager().targets().current()
- p = t.project()
- if builds(self.target, p, ps, "%s builds" % self.target):
- return self.true_properties
+ p = t.project()
+ if builds(self.target, p, rps, "%s builds" % self.target):
+ choosen = self.true_properties
         else:
- return self.false_properties
+ choosen = self.false_properties
+ return property.evaluate_conditionals_in_context(choosen, ps)
 
 @bjam_signature((["target"], ["true_properties", "*"], ["false_properties", "*"]))
 def check_target_builds(target, true_properties, false_properties):


Boost-Commit 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