Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79967 - in trunk/tools/build/v2: . build
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-11 10:32:00


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

Log:
Boost Build cleanup - added a project.is-jamroot-module() rule (and an accompanying implementation detail project-attributes.is-jamroot() rule) to make testing whether a project module is a Jamroot module cleaner. As 'an example' updated the build-system.should-clean-project() rule to cleanly test for the Jamroot project module instead of assuming that Jamroot module is the one whose parent module is user-config. The old implementation was also incorrect since Jamroot may also have project-config as a parent.
Text files modified:
   trunk/tools/build/v2/build-system.jam | 4 ++--
   trunk/tools/build/v2/build/project.jam | 18 ++++++++++++++++++
   2 files changed, 20 insertions(+), 2 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:31:59 EDT (Sat, 11 Aug 2012)
@@ -513,10 +513,10 @@
         {
             r = true ;
         }
- else
+ else if ! [ project.is-jamroot-module $(project) ]
         {
             local parent = [ project.attribute $(project) parent-module ] ;
- if $(parent) && $(parent) != user-config
+ if $(parent)
             {
                 r = [ should-clean-project $(parent) : $(detected-projects) ] ;
             }

Modified: trunk/tools/build/v2/build/project.jam
==============================================================================
--- trunk/tools/build/v2/build/project.jam (original)
+++ trunk/tools/build/v2/build/project.jam 2012-08-11 10:31:59 EDT (Sat, 11 Aug 2012)
@@ -746,6 +746,16 @@
         return $(self.$(attribute)) ;
     }
 
+ # Returns whether these attributes belong to a Jamroot project module.
+ #
+ rule is-jamroot ( )
+ {
+ if $(self.location) && $(self.project-root) = $(self.location)
+ {
+ return true ;
+ }
+ }
+
     # Prints the project attributes.
     #
     rule print ( )
@@ -811,6 +821,14 @@
 }
 
 
+# Returns whether a project module is a Jamroot project module.
+#
+rule is-jamroot-module ( project )
+{
+ return [ $($(project).attributes).is-jamroot ] ;
+}
+
+
 # Returns the project target corresponding to the 'project-module'.
 #
 rule target ( project-module )


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