Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48601 - trunk/tools/build/v2/build
From: jurko.gospodnetic_at_[hidden]
Date: 2008-09-04 22:40:03


Author: jurko
Date: 2008-09-04 22:40:03 EDT (Thu, 04 Sep 2008)
New Revision: 48601
URL: http://svn.boost.org/trac/boost/changeset/48601

Log:
Updated Boost Build to made adding a new derived target type not invalidate generator selection related cached viable source target type information but only update it as needed.

Text files modified:
   trunk/tools/build/v2/build/generators.jam | 37 ++++++++++++++++++++++++++++++++++++-
   trunk/tools/build/v2/build/type.jam | 3 ++-
   2 files changed, 38 insertions(+), 2 deletions(-)

Modified: trunk/tools/build/v2/build/generators.jam
==============================================================================
--- trunk/tools/build/v2/build/generators.jam (original)
+++ trunk/tools/build/v2/build/generators.jam 2008-09-04 22:40:03 EDT (Thu, 04 Sep 2008)
@@ -48,6 +48,7 @@
 import property-set ;
 import sequence ;
 import set ;
+import type ;
 import utility ;
 import virtual-target ;
 
@@ -58,12 +59,46 @@
 }
 
 
+# Updated cached viable source target type information as needed after a new
+# derived target type gets added. This is needed because if a target type is a
+# viable source target type for some generator then all of the target type's
+# derived target types are automatically viable as source target types for the
+# same generator. Does nothing if a non-derived target type is passed to it.
+#
+rule update-viable-source-target-type-cache-with-derived-type ( type )
+{
+ # TODO: There really ought be an interface to ask for a direct base target
+ # type without having to go through a list of all the base target types.
+ local all-base-types = [ type.all-bases $(type) ] ;
+ local base-type = $(all-base-types[2]) ;
+
+ if $(base-type)
+ {
+ for local g in $(.vstg-cached-generators)
+ {
+ if $(base-type) in $(.vstg.$(g))
+ {
+ .vstg.$(g) += $(type) ;
+ }
+ }
+
+ for local t in $(.vst-cached-types)
+ {
+ if $(base-type) in $(.vst.$(t))
+ {
+ .vst.$(t) += $(type) ;
+ }
+ }
+ }
+}
+
+
 # Clears cached viable source target type information except for target types
 # and generators with all source types listed as viable. Should be called when
 # something invalidates those cached values by possibly causing some new source
 # types to become viable.
 #
-rule invalidate-extendable-viable-source-target-type-cache ( )
+local rule invalidate-extendable-viable-source-target-type-cache ( )
 {
     local generators-with-cached-source-types = $(.vstg-cached-generators) ;
     .vstg-cached-generators = ;

Modified: trunk/tools/build/v2/build/type.jam
==============================================================================
--- trunk/tools/build/v2/build/type.jam (original)
+++ trunk/tools/build/v2/build/type.jam 2008-09-04 22:40:03 EDT (Thu, 04 Sep 2008)
@@ -87,7 +87,8 @@
         # performant but needs to be tested and implemented at a later time.
         if $(base-type)
         {
- generators.invalidate-extendable-viable-source-target-type-cache ;
+ generators.update-viable-source-target-type-cache-with-derived-type
+ $(type) ;
         }
     }
 }


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