Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2008-05-18 00:20:30


Author: vladimir_prus
Date: 2008-05-18 00:20:28 EDT (Sun, 18 May 2008)
New Revision: 45466
URL: http://svn.boost.org/trac/boost/changeset/45466

Log:
Allow to append to a "on target" variable.

Text files modified:
   branches/build/python_port/pybb.jam | 11 +++++++++--
   branches/build/python_port/python/boost/build/engine/engine.py | 13 ++++++++-----
   2 files changed, 17 insertions(+), 7 deletions(-)

Modified: branches/build/python_port/pybb.jam
==============================================================================
--- branches/build/python_port/pybb.jam (original)
+++ branches/build/python_port/pybb.jam 2008-05-18 00:20:28 EDT (Sun, 18 May 2008)
@@ -52,9 +52,16 @@
         $(action) $(targets) : $(sources) : $(properties) ;
     }
     
- rule set-target-variable ( targets + : variable : value * )
+ rule set-target-variable ( targets + : variable : value * : append ? )
     {
- $(variable) on $(targets) = $(value) ;
+ if $(append)
+ {
+ $(variable) on $(targets) += $(value) ;
+ }
+ else
+ {
+ $(variable) on $(targets) = $(value) ;
+ }
     }
 
     rule import-rules-from-parent ( parent-module : this-module : user-rules )

Modified: branches/build/python_port/python/boost/build/engine/engine.py
==============================================================================
--- branches/build/python_port/python/boost/build/engine/engine.py (original)
+++ branches/build/python_port/python/boost/build/engine/engine.py 2008-05-18 00:20:28 EDT (Sun, 18 May 2008)
@@ -62,7 +62,7 @@
             for source in sources:
                 self.do_add_dependency (target, source)
     
- def set_target_variable (self, targets, variable, value):
+ def set_target_variable (self, targets, variable, value, append=0):
         """ Sets a target variable.
 
         The 'variable' will be available to bjam when it decides
@@ -73,7 +73,7 @@
             targets = [targets]
 
         for target in targets:
- self.do_set_target_variable (target, variable, value)
+ self.do_set_target_variable (target, variable, value, append)
 
     def set_update_action (self, action_name, targets, sources, properties):
         """ Binds a target to the corresponding update action.
@@ -134,9 +134,12 @@
             raise "No action %s was registered" % action_name
         action(targets, sources, property_set)
 
- def do_set_target_variable (self, target, variable, value):
- bjam_interface.call("set-target-variable", target, variable, value)
-
+ def do_set_target_variable (self, target, variable, value, append):
+ if append:
+ bjam_interface.call("set-target-variable", target, variable, value, "true")
+ else:
+ bjam_interface.call("set-target-variable", target, variable, value)
+
     def do_add_dependency (self, target, source):
         bjam_interface.call("DEPENDS", target, source)
          


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