Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-08-23 08:25:17


Author: jurko
Date: 2008-08-23 08:25:16 EDT (Sat, 23 Aug 2008)
New Revision: 48318
URL: http://svn.boost.org/trac/boost/changeset/48318

Log:
Updated Boost Build's project id handling so that if a project has an id attribute, this id will be automatically registered and usable from that same project just the same as if the id had been specified directly using the 'id' project rule parameter.

Part of the work by Steven Watanabe on fixing the Boost Build trac ticket #13 (http://zigzag.cs.msu.su/boost.build/ticket/13).
Text files modified:
   trunk/tools/build/v2/build/project.jam | 15 +++++++++++----
   1 files changed, 11 insertions(+), 4 deletions(-)

Modified: trunk/tools/build/v2/build/project.jam
==============================================================================
--- trunk/tools/build/v2/build/project.jam (original)
+++ trunk/tools/build/v2/build/project.jam 2008-08-23 08:25:16 EDT (Sat, 23 Aug 2008)
@@ -633,8 +633,14 @@
             self.build-dir = [ path.root
                 [ path.make $(specification) ] $(self.location) ] ;
         }
- else if ! $(attribute) in "id" "default-build" "location"
- "source-location" "parent" "projects-to-build" "project-root"
+ else if $(attribute) = "id"
+ {
+ id = [ path.root $(specification) / ] ;
+ project.register-id $(id) : $(self.project-module) ;
+ self.id = $(id) ;
+ }
+ else if ! $(attribute) in "default-build" "location" "parent"
+ "projects-to-build" "project-root" "source-location"
         {
             errors.error "Invalid project attribute '$(attribute)' specified"
                 "for project at '$(self.location)'" ;
@@ -873,8 +879,6 @@
         local attributes = [ project.attributes $(__name__) ] ;
         if $(id)
         {
- id = [ path.root $(id) / ] ;
- project.register-id $(id) : $(__name__) ;
            $(attributes).set id : $(id) ;
         }
 
@@ -906,6 +910,9 @@
             # or wrong consequences.
             if $(location) && $(location) = [ $(attributes).get project-root ]
             {
+ # Re-read the project id, since it might have been changed in
+ # the project's attributes.
+ id = [ $(attributes).get id ] ;
                 # This is Jamroot.
                 if $(id)
                 {


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