From e9e9f657d6dc66aada0b470b235ffc699b15d93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sat, 23 Aug 2008 12:25:16 +0000 Subject: [PATCH] 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). [SVN r48318] --- v2/build/project.jam | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/v2/build/project.jam b/v2/build/project.jam index f2771f1ec..2571dd7f5 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -633,8 +633,14 @@ class project-attributes 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 @@ module project-rules local attributes = [ project.attributes $(__name__) ] ; if $(id) { - id = [ path.root $(id) / ] ; - project.register-id $(id) : $(__name__) ; $(attributes).set id : $(id) ; } @@ -906,6 +910,9 @@ module project-rules # 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) {