diff --git a/v2/build/project.jam b/v2/build/project.jam index c939e7021..5751dfa8f 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -907,6 +907,8 @@ module project-rules import project ; import toolset ; + local saved-project = [ modules.peek project : .current-project ] ; + # Temporarily change the search path so the module referred to by # 'using' can be placed in the same directory as Jamfile. User will # expect the module to be found even though the directory is not in @@ -925,7 +927,7 @@ module project-rules # get set as the 'current' project). Restore the correct value so any # main targets declared after this do not get mapped to the loaded # module's project. - modules.poke project : .current-project : [ project.target $(caller) ] ; + modules.poke project : .current-project : $(saved-project) ; } rule import ( * : * : * )