Skip to content

Commit 4bd9215

Browse files
authored
feat(msvs): add support for Visual Studio 2022 (#124)
1 parent 52de08a commit 4bd9215

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

pylib/gyp/MSVSVersion.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,18 @@ def _CreateVersion(name, path, sdk_based=False):
269269
if path:
270270
path = os.path.normpath(path)
271271
versions = {
272+
"2022": VisualStudioVersion(
273+
"2022",
274+
"Visual Studio 2022",
275+
solution_version="12.00",
276+
project_version="17.0",
277+
flat_sln=False,
278+
uses_vcxproj=True,
279+
path=path,
280+
sdk_based=sdk_based,
281+
default_toolset="v143",
282+
compatible_sdks=["v8.1", "v10.0"],
283+
),
272284
"2019": VisualStudioVersion(
273285
"2019",
274286
"Visual Studio 2019",
@@ -436,6 +448,7 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
436448
2015 - Visual Studio 2015 (14)
437449
2017 - Visual Studio 2017 (15)
438450
2019 - Visual Studio 2019 (16)
451+
2022 - Visual Studio 2022 (17)
439452
Where (e) is e for express editions of MSVS and blank otherwise.
440453
"""
441454
version_to_year = {
@@ -447,6 +460,7 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
447460
"14.0": "2015",
448461
"15.0": "2017",
449462
"16.0": "2019",
463+
"17.0": "2022",
450464
}
451465
versions = []
452466
for version in versions_to_check:
@@ -522,7 +536,7 @@ def SelectVisualStudioVersion(version="auto", allow_fallback=True):
522536
if version == "auto":
523537
version = os.environ.get("GYP_MSVS_VERSION", "auto")
524538
version_map = {
525-
"auto": ("16.0", "15.0", "14.0", "12.0", "10.0", "9.0", "8.0", "11.0"),
539+
"auto": ("17.0", "16.0", "15.0", "14.0", "12.0", "10.0", "9.0", "8.0", "11.0"),
526540
"2005": ("8.0",),
527541
"2005e": ("8.0",),
528542
"2008": ("9.0",),
@@ -536,6 +550,7 @@ def SelectVisualStudioVersion(version="auto", allow_fallback=True):
536550
"2015": ("14.0",),
537551
"2017": ("15.0",),
538552
"2019": ("16.0",),
553+
"2022": ("17.0",),
539554
}
540555
override_path = os.environ.get("GYP_MSVS_OVERRIDE_PATH")
541556
if override_path:

0 commit comments

Comments
 (0)