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

Fix regression for searching for VS cl and ninja #3445

Merged
merged 4 commits into from
Nov 15, 2023
Merged
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
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand Down
10 changes: 4 additions & 6 deletions src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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, {
Expand Down