SERVER-115917 set specific Visual Studio and MSVC install version (#46060)
GitOrigin-RevId: da5d24e95be0a4ee771a64250acefb7f6f274940
This commit is contained in:
parent
5393ef6c93
commit
0963bb7875
26
SConstruct
26
SConstruct
@ -1260,9 +1260,22 @@ env_vars.Add(
|
||||
default=version_data['githash'],
|
||||
)
|
||||
|
||||
VSINSTALLDIR = 'C:/Program Files/Microsoft Visual Studio/2022/Professional'
|
||||
MSVC_TOOLSET_VERSION = "14.31.31103"
|
||||
|
||||
env_vars.Add('MSVC_USE_SCRIPT', help='Sets the script used to setup Visual Studio.',
|
||||
default=f'{VSINSTALLDIR}/VC/Auxiliary/Build/vcvarsall.bat')
|
||||
|
||||
env_vars.Add('VSINSTALLDIR', help='The path where Visual Studio is installed.',
|
||||
default=VSINSTALLDIR)
|
||||
|
||||
env_vars.Add('MSVC_USE_SCRIPT_ARGS', help='Sets the script used to setup Visual Studio.',
|
||||
default=f'x64 -vcvars_ver={MSVC_TOOLSET_VERSION}')
|
||||
|
||||
env_vars.Add(
|
||||
'MSVC_USE_SCRIPT',
|
||||
help='Sets the script used to setup Visual Studio.',
|
||||
'MSVC_TOOLSET_VERSION',
|
||||
help='Sets the full toolset version of Visual C++ to use.',
|
||||
default=MSVC_TOOLSET_VERSION,
|
||||
)
|
||||
|
||||
env_vars.Add(
|
||||
@ -1271,12 +1284,6 @@ env_vars.Add(
|
||||
default="14.3",
|
||||
)
|
||||
|
||||
env_vars.Add(
|
||||
'MSVC_TOOLSET_VERSION',
|
||||
help='Sets the full toolset version of Visual C++ to use.',
|
||||
default="14.31.31103",
|
||||
)
|
||||
|
||||
env_vars.Add(
|
||||
'LINKFLAGS_COMPILER_EXEC_PREFIX',
|
||||
help='Specify the search path to be injected into the LINKFLAGS',
|
||||
@ -1647,6 +1654,9 @@ envDict = dict(
|
||||
LIBDEPS_TAG_EXPANSIONS=[],
|
||||
MSVC_VERSION=variables_only_env.get("MSVC_VERSION"),
|
||||
MSVC_TOOLSET_VERSION=variables_only_env.get("MSVC_TOOLSET_VERSION"),
|
||||
VSINSTALLDIR=variables_only_env.get("VSINSTALLDIR"),
|
||||
MSVC_USE_SCRIPT=variables_only_env.get("MSVC_USE_SCRIPT"),
|
||||
MSVC_USE_SCRIPT_ARGS=variables_only_env.get("MSVC_USE_SCRIPT_ARGS"),
|
||||
)
|
||||
|
||||
# By default, we will get the normal SCons tool search. But if the
|
||||
|
||||
@ -87,6 +87,14 @@ def generate(env):
|
||||
if not exists(env):
|
||||
return
|
||||
|
||||
if 'TARGET_ARCH' not in env or env['TARGET_ARCH'] is None:
|
||||
env['TARGET_ARCH'] = "x86_64"
|
||||
|
||||
if env['TARGET_ARCH'] not in target_arch_expansion_map:
|
||||
raise Exception(
|
||||
f"TARGET_ARCH={env['TARGET_ARCH']}, TARGET_ARCH must be in {target_arch_expansion_map.keys()} on windows."
|
||||
)
|
||||
|
||||
env.Tool("msvc")
|
||||
|
||||
env.AddMethod(_get_merge_module_name_for_feature, "GetMergeModuleNameForFeature")
|
||||
@ -128,6 +136,9 @@ def generate(env):
|
||||
if os.path.isdir(mergemodulepath):
|
||||
env["MSVS"]["VCREDISTMERGEMODULEPATH"] = mergemodulepath
|
||||
|
||||
if 'VSINSTALLDIR' in env:
|
||||
env["MSVS"]["VSINSTALLDIR"] = env["VSINSTALLDIR"]
|
||||
|
||||
if not "VSINSTALLDIR" in env["MSVS"]:
|
||||
|
||||
# Compute a VS version based on the VC version. VC 14.0 is VS 2015, VC
|
||||
|
||||
Loading…
Reference in New Issue
Block a user