Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Bug Fixes:
- Show the CMake Tools activity-bar view immediately with an "initializing" placeholder instead of hiding the entire sidebar until CMake, kit, preset, and Visual Studio developer-environment probing completes. On machines where those probes are intermittently slow (e.g. aggressive antivirus scanning of spawned processes, or extension-host file-handle exhaustion), the sidebar no longer disappears for minutes during activation. Project commands, menus, and status items remain gated on full readiness, so nothing runs against a partially-initialized project. [#5027](https://github.com/microsoft/vscode-cmake-tools/pull/5027)
- Refresh the open CMake Cache Editor when configuration changes cache values externally. [#3635](https://github.com/microsoft/vscode-cmake-tools/issues/3635)
- Preserve `CMakeCache.txt` on folder open with CMake Presets when the active configure preset specifies no generator, so `cmake.configureOnOpen` performs an incremental configure instead of deleting the cache and reconfiguring from scratch. [#5049](https://github.com/microsoft/vscode-cmake-tools/issues/5049)
- Fix the `vsInstanceVersion` vendor field being ignored when a configure preset also specifies a `toolset`, causing the developer environment to be bootstrapped from the latest installed Visual Studio instance having the toolset compiler instead of the pinned major version. The pinned version is now applied as a filter before matching the requested toolset. [#5074](https://github.com/microsoft/vscode-cmake-tools/issues/5074)

## 1.23.52

Expand Down
11 changes: 5 additions & 6 deletions src/presets/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,11 @@ async function getVsDevEnv(opts: VsDevEnvOptions): Promise<EnvironmentWithNull |
// Check for existence of vcvars script to determine whether desired host/target architecture is supported.
// toolset.host will be set by getToolset.
if (await getVcVarsBatScript(vs, toolset.host!, arch)) {
// If a VS major version is pinned via vendor settings, skip any instance that doesn't match it.
if (vendorVsVersion && !vs.installationVersion.startsWith(vendorVsVersion.toString())) {
continue;
}

// If a toolset version is specified then check to make sure this vs instance has it installed.
if (toolset.version) {
const availableToolsets = await enumerateMsvcToolsets(vs.installationPath, vs.installationVersion);
Expand All @@ -949,12 +954,6 @@ async function getVsDevEnv(opts: VsDevEnvOptions): Promise<EnvironmentWithNull |
vsInstall = vs;
break;
}
} else if (vendorVsVersion) {
// If a VS major version is specified via vendor settings, match against it.
if (vs.installationVersion.startsWith(vendorVsVersion.toString())) {
vsInstall = vs;
break;
}
} else if (!vsGeneratorVersion || vs.installationVersion.startsWith(vsGeneratorVersion.toString())) {
// If no toolset version specified then choose the latest VS instance for the given generator
vsInstall = vs;
Expand Down