Skip to content

Commit

Permalink
Detection for VS 2022 toolchain
Browse files Browse the repository at this point in the history
This adds basic support for VS 2022 by detecting the toolchain.
I.e. include paths, lib paths, and PATH env var are properly detected.

The detection works the same as 2017 and 2019 since vswhere.exe works
the same and the folder layout hasn't changed.

Revived from https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/182202
  • Loading branch information
MarkZ3 authored and jonahgraham committed May 15, 2024
1 parent 271041b commit b914001
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion windows/org.eclipse.cdt.msw.build/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.msw.build;singleton:=true
Bundle-Version: 2.0.200.qualifier
Bundle-Version: 2.0.300.qualifier
Bundle-Activator: org.eclipse.cdt.msw.build.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 Marc-Andre Laperle.
* Copyright (c) 2020, 2021 Marc-Andre Laperle.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -16,4 +16,5 @@
interface IVSVersionConstants {
VSVersionNumber VS2017_BASE_VER = new VSVersionNumber(15);
VSVersionNumber VS2019_BASE_VER = new VSVersionNumber(16);
VSVersionNumber VS2022_BASE_VER = new VSVersionNumber(17);
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ private static void detectVSInstallations() {
fVsInstallations = new TreeMap<>();
// We are opting-in which versions to detect instead of trying to detect even unknown ones in order
// to allow proper testing for a new version before exposing it to users.
Arrays.asList(IVSVersionConstants.VS2017_BASE_VER, IVSVersionConstants.VS2019_BASE_VER).forEach(version -> {
VSInstallation insllation = detectVSInstallation(version);
if (insllation != null)
fVsInstallations.put(version, insllation);
});
Arrays.asList(IVSVersionConstants.VS2017_BASE_VER, IVSVersionConstants.VS2019_BASE_VER,
IVSVersionConstants.VS2022_BASE_VER).forEach(version -> {
VSInstallation insllation = detectVSInstallation(version);
if (insllation != null)
fVsInstallations.put(version, insllation);
});
}

private static VSInstallation detectVSInstallation(VSVersionNumber baseVersion) {
Expand Down

0 comments on commit b914001

Please sign in to comment.