From aafe55b1ff11d854518eb32010f13d5a8ef6cc4c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Jan 2005 15:48:52 +0000 Subject: [PATCH] Don't require Jamfile referred by 'use-project' to declare id equal to the one specified in 'use-project', or any id at all. [SVN r26844] --- v2/build/project.jam | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/v2/build/project.jam b/v2/build/project.jam index f1a84a7c8..e5392d11a 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -616,14 +616,18 @@ rule use ( id : location ) local saved-project = $(.current-project) ; local project-module = [ project.load $(location) ] ; local declared-id = [ project.attribute $(project-module) id ] ; - - if ! $(declared-id) + + if ! $(declared-id) || $(declared-id) != $(id) { - error "project loaded by 'use-project' has no project-id." ; - } - if $(declared-id) != $(id) - { - error project \"$(declared-id)\" at \"$(location)\" redeclared with id \"$(id)\". ; + # The project at 'location' either have no id or + # that id is not equal to the 'id' parameter. + if $($(id).jamfile-module) + && $($(id).jamfile-module) != $(project-module) + { + errors.user-error + "Attempt to redeclare already existing project id" ; + } + $(id).jamfile-module = $(project-module) ; } .current-project = $(saved-project) ; }