From 9e5cd11ed234d53be75bd0e4e71d2249fc0a8923 Mon Sep 17 00:00:00 2001 From: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:36:44 -0500 Subject: [PATCH] fix regression (#3445) --- CHANGELOG.md | 8 ++++++-- src/preset.ts | 10 ++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecac2208a..eb0479ee8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # What's New? -## 1.16 +## 1.16.30 +Bug Fixes: +- Fixed an issue where finding cl.exe and ninja from Visual Studio was broken. [PR #3445](https://github.com/microsoft/vscode-cmake-tools/pull/3445) + +## 1.16.29 Features: - Support different debug config for different targets. [PR #2801](https://github.com/microsoft/vscode-cmake-tools/pull/2801) [@RichardLuo0](https://github.com/RichardLuo0) - Add ability to get a test's `WORKING_DIRECTORY` in launch.json via `cmake.testWorkingDirectory` [PR #3336](https://github.com/microsoft/vscode-cmake-tools/pull/3336) @@ -23,7 +27,7 @@ Bug Fixes: - Paths containing `mingw` are no longer removed from the `PATH` environment variable because the selected MinGW kit is added before the `PATH` environment variable, rather than after. [#3220](https://github.com/microsoft/vscode-cmake-tools/issues/3220) - Fix a bug where `CMake: Show Configure` or `CMake: Show Build` commands would run them. [#3381](https://github.com/microsoft/vscode-cmake-tools/issues/3381) [@AbdullahAmrSobh](https://github.com/AbdullahAmrSobh) -## 1.15 +## 1.15.31 Features: - Added support for the CMake Debugger. [#3093](https://github.com/microsoft/vscode-cmake-tools/issues/3093) - Added support for passing a folder parameter to the `cmake.selectActiveFolder` command. [#3256](https://github.com/microsoft/vscode-cmake-tools/issues/3256) [@cvanbeek](https://github.com/cvanbeek13) diff --git a/src/preset.ts b/src/preset.ts index 803a8f8e9..3f39254f9 100644 --- a/src/preset.ts +++ b/src/preset.ts @@ -924,8 +924,6 @@ async function expandConfigurePresetHelper(folder: string, name: string, preset: const expansionOpts: ExpansionOptions = await getExpansionOptions(workspaceFolder, sourceDir, preset); expansionOpts.envOverride = inheritedEnv; - preset.environment = EnvironmentUtils.mergePreserveNull([inheritedEnv, preset.environment]); - // [Windows Only] If CMAKE_CXX_COMPILER or CMAKE_C_COMPILER is set as cl, clang, clang-cl, clang-cpp and clang++, // but they are not on PATH, then set the env automatically. if (process.platform === 'win32') { @@ -937,10 +935,10 @@ async function expandConfigurePresetHelper(folder: string, name: string, preset: const expandedPreset: ConfigurePreset = { name }; const expansionOpts: ExpansionOptions = await getExpansionOptions(workspaceFolder, sourceDir, preset); if (compilerName) { - expandedPreset.environment = EnvironmentUtils.createPreserveNull(); - for (const key in preset.environment) { - if (preset.environment[key]) { - expandedPreset.environment[key] = await expandString(preset.environment[key]!, expansionOpts); + expandedPreset.environment = EnvironmentUtils.mergePreserveNull([inheritedEnv, preset.environment]); + for (const key in expandedPreset.environment) { + if (expandedPreset.environment[key]) { + expandedPreset.environment[key] = await expandString(expandedPreset.environment[key]!, expansionOpts); } } const compilerLocation = await execute('where.exe', [compilerName], null, {