Skip to content

Commit 5038ac5

Browse files
committed
Add additional vswhere locations and remove vswhere command-line stub.
Add vswhere roots for: * winget * scoop
1 parent bc1ee03 commit 5038ac5

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

SCons/Tool/MSCommon/vc.py

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@
5656
import SCons.Warnings
5757
from SCons.Tool import find_program_path
5858

59-
# import SCons.Script
60-
6159
from . import common
6260
from .common import CONFIG_CACHE, debug
6361
from .sdk import get_installed_sdks
@@ -920,6 +918,9 @@ def msvc_version_to_maj_min(msvc_version):
920918
os.path.expandvars(r"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"),
921919
os.path.expandvars(r"%ProgramFiles%\Microsoft Visual Studio\Installer"),
922920
os.path.expandvars(r"%ChocolateyInstall%\bin"),
921+
os.path.expandvars(r"%LOCALAPPDATA%\Microsoft\WinGet\Links"),
922+
os.path.expanduser(r"~\scoop\shims"),
923+
os.path.expandvars(r"%SCOOP%\shims"),
923924
]]
924925

925926
# normalize user-specified vswhere paths
@@ -964,27 +965,6 @@ def _vswhere_user_path(pval):
964965

965966
return vswhere_path
966967

967-
# normalized user-specified command-line vswhere path
968-
969-
# TODO: stub for command-line specification of vswhere
970-
_vswhere_path_cmdline = None
971-
972-
def _msvc_cmdline_vswhere():
973-
global _vswhere_path_cmdline
974-
975-
if _vswhere_path_cmdline == UNDEFINED:
976-
977-
vswhere_path = None
978-
vswhere_user = None
979-
980-
if vswhere_user:
981-
vswhere_path = _vswhere_user_path(vswhere_user)
982-
983-
_vswhere_path_cmdline = vswhere_path
984-
debug('vswhere_path=%s', vswhere_path)
985-
986-
return _vswhere_path_cmdline
987-
988968
# normalized default vswhere path
989969

990970
_vswhere_paths_processed = [
@@ -1018,10 +998,6 @@ def msvc_find_vswhere():
1018998
# For bug 3542: also accommodate not being on C: drive.
1019999
# NB: this gets called from testsuite on non-Windows platforms.
10201000
# Whether that makes sense or not, don't break it for those.
1021-
vswhere_path = _msvc_cmdline_vswhere()
1022-
if vswhere_path:
1023-
return
1024-
10251001
vswhere_path = None
10261002
for pf in VSWHERE_PATHS:
10271003
if os.path.exists(pf):
@@ -1078,10 +1054,6 @@ def _filter_vswhere_paths(env):
10781054
if vswhere_environ and vswhere_environ not in _VSWhere.seen_vswhere:
10791055
vswhere_paths.append(vswhere_environ)
10801056

1081-
vswhere_cmdline = _msvc_cmdline_vswhere()
1082-
if vswhere_cmdline and vswhere_cmdline not in _VSWhere.seen_vswhere:
1083-
vswhere_paths.append(vswhere_cmdline)
1084-
10851057
vswhere_default = _msvc_default_vswhere()
10861058
if vswhere_default and vswhere_default not in _VSWhere.seen_vswhere:
10871059
vswhere_paths.append(vswhere_default)

0 commit comments

Comments
 (0)