2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00

Fix msvc initialization. When version is specified, look in default paths

before looking in PATH.


[SVN r23363]
This commit is contained in:
Vladimir Prus
2004-07-06 07:36:26 +00:00
parent 288a60a94b
commit 1911daa129
2 changed files with 27 additions and 7 deletions

View File

@@ -109,13 +109,14 @@ rule check-init-parameters ( toolset : * )
# to find the tool using it's name, the PATH, and additional path.
# This rule returns the command to be used when invoking the tool. If we can't
# find the tool, a warning is issued.
# If 'path-last' is specified, path is checked after 'additional-paths'.
rule get-invocation-command (
toolset : tool : user-provided-command * : additional-paths * )
toolset : tool : user-provided-command * : additional-paths * : path-last ? )
{
local command ;
if ! $(user-provided-command)
{
command = [ common.find-tool $(tool) : $(additional-paths) ] ;
command = [ common.find-tool $(tool) : $(additional-paths) : path-last ] ;
if ! $(command)
{
ECHO "warning: toolset $(toolset) initialization: can't find tool $(tool)" ;
@@ -161,16 +162,33 @@ rule get-absolute-tool-path ( command )
# If found in additional paths, returns full name. If there are several possibilities,
# returns them all.
# Otherwise, returns empty string.
rule find-tool ( name : additional-paths * )
# If 'path-last' is specified, path is checked after 'additional-paths'.
rule find-tool ( name : additional-paths * : path-last ? )
{
local m = [ GLOB [ modules.peek : PATH Path path ] : $(name) $(name).exe ] ;
local m ;
if $(path-last)
{
m = [ path.glob $(additional-paths) : $(name) $(name).exe ] ;
}
else
{
m = [ GLOB [ modules.peek : PATH Path path ] : $(name) $(name).exe ] ;
}
if $(m)
{
return $(name) ;
}
else
{
return [ path.glob $(additional-paths) : $(name) $(name).exe ] ;
if $(path-last)
{
return [ GLOB [ modules.peek : PATH Path path ] : $(name) $(name).exe ] ;
}
else
{
return [ path.glob $(additional-paths) : $(name) $(name).exe ] ;
}
}
}

View File

@@ -73,9 +73,11 @@ rule init (
local condition = [ common.check-init-parameters msvc :
version $(version) ] ;
# If version is specified, we try to search first in default paths,
# and only then in PATH.
command = [ common.get-invocation-command msvc : cl.exe : $(command)
: [ default-paths $(version) ] ] ;
: [ default-paths $(version) ] : $(version) ] ;
if $(command)
{