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.