Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79968 - trunk/tools/build/v2
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-11 10:45:37


Author: jurko
Date: 2012-08-11 10:45:36 EDT (Sat, 11 Aug 2012)
New Revision: 79968
URL: http://svn.boost.org/trac/boost/changeset/79968

Log:
Boost Build cleanup - build-system.jam module's should-clean-project() rule simplified by not requiring a separate list of built projects only to use that list for marking those projects as needing to be cleaned. Now instead of building this list we directly mark those projects as needing to be cleaned.
Text files modified:
   trunk/tools/build/v2/build-system.jam | 30 ++++++++++++------------------
   1 files changed, 12 insertions(+), 18 deletions(-)

Modified: trunk/tools/build/v2/build-system.jam
==============================================================================
--- trunk/tools/build/v2/build-system.jam (original)
+++ trunk/tools/build/v2/build-system.jam 2012-08-11 10:45:36 EDT (Sat, 11 Aug 2012)
@@ -122,15 +122,14 @@
     # The cleaning is tricky. Say, if user says 'bjam --clean foo' where 'foo'
     # is a directory, then we want to clean targets which are in 'foo' as well
     # as those in any children Jamfiles under foo but not in any unrelated
- # Jamfiles. To achieve this we collect a list of projects under which
- # cleaning is allowed - those explicitly detected as targets for this build
- # system run.
- local project-modules ;
+ # Jamfiles. To achieve this we first mark all projects explicitly detected
+ # as targets for this build system run as needing to be cleaned.
     for local t in $(targets)
     {
         if [ class.is-a $(t) : project-target ]
         {
- project-modules += [ $(t).project-module ] ;
+ local project = [ $(t).project-module ] ;
+ .should-clean-project.$(project) = true ;
         }
     }
 
@@ -151,8 +150,7 @@
         # whether directly or by belonging to one of the removed projects.
         local p = [ $(t).project ] ;
         if [ $(t).action ] && ( $(t) in $(targets-to-clean) ||
- [ should-clean-project [ $(p).project-module ] : $(project-modules)
- ] )
+ [ should-clean-project [ $(p).project-module ] ] )
         {
             to-clean += $(t) ;
         }
@@ -499,26 +497,22 @@
 
 
 # Returns whether the given project (identifed by its project module) should be
-# cleaned because it or any of its parent projects have been detected as a
-# target for the current build system run. Expects the given list of detected
-# projects not to change between invocations or else the implemented result
-# caching might not work correctly.
+# cleaned because it or any of its parent projects have already been marked as
+# needing to be cleaned in this build. As an optimization, will explicitly mark
+# all encountered project needing to be cleaned in case thay have not already
+# been marked so.
 #
-local rule should-clean-project ( project : detected-projects * )
+local rule should-clean-project ( project )
 {
     if ! $(.should-clean-project.$(project))
     {
         local r ;
- if $(project) in $(detected-projects)
- {
- r = true ;
- }
- else if ! [ project.is-jamroot-module $(project) ]
+ if ! [ project.is-jamroot-module $(project) ]
         {
             local parent = [ project.attribute $(project) parent-module ] ;
             if $(parent)
             {
- r = [ should-clean-project $(parent) : $(detected-projects) ] ;
+ r = [ should-clean-project $(parent) ] ;
             }
         }
         .should-clean-project.$(project) = $(r) ;


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