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

feat(msvs): add support for Visual Studio 2022 #124

Merged
merged 1 commit into from
Aug 26, 2021
Merged
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
17 changes: 16 additions & 1 deletion pylib/gyp/MSVSVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,18 @@ def _CreateVersion(name, path, sdk_based=False):
if path:
path = os.path.normpath(path)
versions = {
"2022": VisualStudioVersion(
"2022",
"Visual Studio 2022",
solution_version="12.00",
project_version="17.0",
flat_sln=False,
uses_vcxproj=True,
path=path,
sdk_based=sdk_based,
default_toolset="v143",
compatible_sdks=["v8.1", "v10.0"],
),
"2019": VisualStudioVersion(
"2019",
"Visual Studio 2019",
Expand Down Expand Up @@ -436,6 +448,7 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
2015 - Visual Studio 2015 (14)
2017 - Visual Studio 2017 (15)
2019 - Visual Studio 2019 (16)
2022 - Visual Studio 2022 (17)
Where (e) is e for express editions of MSVS and blank otherwise.
"""
version_to_year = {
Expand All @@ -447,6 +460,7 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
"14.0": "2015",
"15.0": "2017",
"16.0": "2019",
"17.0": "2022",
}
versions = []
for version in versions_to_check:
Expand Down Expand Up @@ -522,7 +536,7 @@ def SelectVisualStudioVersion(version="auto", allow_fallback=True):
if version == "auto":
version = os.environ.get("GYP_MSVS_VERSION", "auto")
version_map = {
"auto": ("16.0", "15.0", "14.0", "12.0", "10.0", "9.0", "8.0", "11.0"),
"auto": ("17.0", "16.0", "15.0", "14.0", "12.0", "10.0", "9.0", "8.0", "11.0"),
"2005": ("8.0",),
"2005e": ("8.0",),
"2008": ("9.0",),
Expand All @@ -536,6 +550,7 @@ def SelectVisualStudioVersion(version="auto", allow_fallback=True):
"2015": ("14.0",),
"2017": ("15.0",),
"2019": ("16.0",),
"2022": ("17.0",),
}
override_path = os.environ.get("GYP_MSVS_OVERRIDE_PATH")
if override_path:
Expand Down