Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple MSVC platform toolsets for a single Visual Studio installation #4149

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions SCons/Tool/MSCommon/vc.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,12 @@ def get_host_target(env, msvc_version, all_host_targets=False):
["-version", "[17.0, 18.0)", "-products", "Microsoft.VisualStudio.Product.BuildTools"], # BuildTools
],
'14.2': [
["-version", "[16.0, 17.0)"], # default: Enterprise, Professional, Community (order unpredictable?)
["-version", "[16.0, 17.0)", "-products", "Microsoft.VisualStudio.Product.BuildTools"], # BuildTools
["-version", "[16.0, 18.0)"], # default: Enterprise, Professional, Community (order unpredictable?)
["-version", "[16.0, 18.0)", "-products", "Microsoft.VisualStudio.Product.BuildTools"], # BuildTools
],
'14.1': [
["-version", "[15.0, 16.0)"], # default: Enterprise, Professional, Community (order unpredictable?)
["-version", "[15.0, 16.0)", "-products", "Microsoft.VisualStudio.Product.BuildTools"], # BuildTools
["-version", "[15.0, 18.0)"], # default: Enterprise, Professional, Community (order unpredictable?)
["-version", "[15.0, 18.0)", "-products", "Microsoft.VisualStudio.Product.BuildTools"], # BuildTools
],
'14.1Exp': [
["-version", "[15.0, 16.0)", "-products", "Microsoft.VisualStudio.Product.WDExpress"], # Express
Expand Down Expand Up @@ -1096,6 +1096,10 @@ def msvc_find_valid_batch_script(env, version):
# Initialize environment variables with store/UWP paths
arg = (arg + ' store').lstrip()

# VS2015 can still be found separately, even when installed as a toolset
if maj > 14 or min >= 1:
arg = (arg + ' -vcvars_ver={}.{}'.format(maj, min)).lstrip()

try:
d = script_env(vc_script, args=arg)
found = vc_script
Expand Down