Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83930 - trunk/tools/build/v2/build
From: steven_at_[hidden]
Date: 2013-04-16 14:40:52


Author: steven_watanabe
Date: 2013-04-16 14:40:52 EDT (Tue, 16 Apr 2013)
New Revision: 83930
URL: http://svn.boost.org/trac/boost/changeset/83930

Log:
Tiny optimization of generator.convert-multiple-sources-to-consumable-types.
Text files modified:
   trunk/tools/build/v2/build/generators.jam | 37 ++++++++++++++++++++++++++++++-------
   1 files changed, 30 insertions(+), 7 deletions(-)

Modified: trunk/tools/build/v2/build/generators.jam
==============================================================================
--- trunk/tools/build/v2/build/generators.jam (original)
+++ trunk/tools/build/v2/build/generators.jam 2013-04-16 14:40:52 EDT (Tue, 16 Apr 2013)
@@ -638,17 +638,40 @@
         local result ;
         # We process each source one-by-one, trying to convert it to a usable
         # type.
- for local source in $(sources)
+ if ! $(self.source-types)
         {
- local _c = [ convert-to-consumable-types $(project) : $(property-set)
- : $(source) : true ] ;
- if ! $(_c)
+ # Anything is acceptible
+ return $(sources) ;
+ }
+ else
+ {
+ local acceptible-types = [ sequence.unique
+ [ sequence.transform type.all-derived : $(self.source-types) ] ] ;
+ for local source in $(sources)
             {
- generators.dout [ indent ] " failed to convert " $(source) ;
+ if ! [ $(source).type ] in $(acceptible-types)
+ {
+ local transformed = [ generators.construct-types $(project)
+ : $(self.source-types) : $(property-set) : $(source) ] ;
+ for local t in $(transformed[2-])
+ {
+ if [ $(t).type ] in $(self.source-types)
+ {
+ result += $(t) ;
+ }
+ }
+ if ! $(transformed)
+ {
+ generators.dout [ indent ] " failed to convert " $(source) ;
+ }
+ }
+ else
+ {
+ result += $(source) ;
+ }
             }
- result += $(_c) ;
+ return [ sequence.unique $(result) ] ;
         }
- return $(result) ;
     }
 
     rule consume-directly ( 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