Skip to content

Commit

Permalink
toolset.using preserves current project
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras committed Aug 20, 2024
1 parent 3c0f563 commit 27b5f32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/build/project.jam
Original file line number Diff line number Diff line change
Expand Up @@ -1276,8 +1276,6 @@ module project-rules
{
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
Expand All @@ -1290,13 +1288,6 @@ module project-rules
$(9) : $(10) : $(11) : $(12) : $(13) : $(14) : $(15) : $(16) : $(17)
: $(18) : $(19) ;
modules.poke : BOOST_BUILD_PATH : $(x) ;

# The above might have clobbered .current-project in case it caused a
# new project instance to be created (which would then automatically
# 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 : $(saved-project) ;
}

rule import ( * : * : * )
Expand Down
9 changes: 9 additions & 0 deletions src/build/toolset.jam
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,18 @@ if --ignore-toolset-requirements in [ modules.peek : ARGV ]
#
rule using ( toolset-module : * )
{
local saved-project = [ modules.peek project : .current-project ] ;

import $(toolset-module) ;
$(toolset-module).init $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9)
;

# The above might have clobbered .current-project in case it caused a
# new project instance to be created (which would then automatically
# 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 : $(saved-project) ;
}


Expand Down

0 comments on commit 27b5f32

Please sign in to comment.