From a7f3c8a3c4a2a5e8a5b9d4c49ec4008d16fcc865 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Jul 2006 06:47:20 +0000 Subject: [PATCH] Make 'use-project' in user-config work. * build/project.jam (load-used-projects): New, extracted from 'load'. (load): Call 'load-used-projects' * build-system.jam: Call 'load-used-projects' for site-config and user-config. Thanks to Andrei Melnikov for the bug report. [SVN r34472] --- v2/build-system.jam | 3 ++- v2/build/project.jam | 30 ++++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/v2/build-system.jam b/v2/build-system.jam index c0747ff4b..e327d0b48 100755 --- a/v2/build-system.jam +++ b/v2/build-system.jam @@ -99,6 +99,7 @@ if ! $(ignore-config) } modules.load site-config : : $(path) ; + project.load-used-projects site-config ; } @@ -122,7 +123,7 @@ if ! $(ignore-config) } modules.load user-config : : $(user-path) ; - + project.load-used-projects user-config ; } diff --git a/v2/build/project.jam b/v2/build/project.jam index 32254750f..feecab007 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -76,22 +76,28 @@ rule load ( jamfile-location ) # to child projects from parent projects, we don't immediately # loading child projects when seing those attributes. Instead, # we record the minimal information that will be used only later. - - local used = [ modules.peek $(module-name) : .used-projects ] ; - import project ; - while $(used) - { - local id = $(used[1]) ; - local where = $(used[2]) ; - - project.use $(id) : [ path.root - [ path.make $(where) ] $(jamfile-location) ] ; - used = $(used[3-]) ; - } + load-used-projects $(module-name) ; } return $(module-name) ; } +rule load-used-projects ( module-name ) +{ + local used = [ modules.peek $(module-name) : .used-projects ] ; + local location = [ attribute $(module-name) location ] ; + import project ; + while $(used) + { + local id = $(used[1]) ; + local where = $(used[2]) ; + + project.use $(id) : [ path.root + [ path.make $(where) ] $(location) ] ; + used = $(used[3-]) ; + } +} + + # Note the use of character groups, as opposed to listing # 'Jamroot' and 'jamroot'. With the latter, we'd get duplicate # matches on windows and would have to eliminate duplicates.