Skip to content

Commit

Permalink
fix presets expansion (#4024)
Browse files Browse the repository at this point in the history
* fix presets expansion

* missed a change

* update changelog
  • Loading branch information
gcampbell-msft authored Aug 29, 2024
1 parent 96f67f1 commit f1a3770
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# What's New?

## 1.19
## 1.19.50

Bug Fixes:

- Fix env expansion of all variables (toolchainFile, etc.) in presets. [#4019](https://github.com/microsoft/vscode-cmake-tools/issues/4019)

## 1.19.49

Features:

Expand Down
6 changes: 3 additions & 3 deletions src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ export async function expandConfigurePresetVariables(preset: ConfigurePreset, fo
}
}

expansionOpts.envOverride = expandedPreset.environment;
expansionOpts.envOverride = EnvironmentUtils.mergePreserveNull([env, expandedPreset.environment]);

if (preset.__file && preset.__file.version >= 3) {
// For presets v3+ binaryDir is optional, but cmake-tools needs a value. Default to something reasonable.
Expand Down Expand Up @@ -1659,7 +1659,7 @@ export async function expandBuildPresetVariables(preset: BuildPreset, name: stri
}
}

expansionOpts.envOverride = expandedPreset.environment;
expansionOpts.envOverride = EnvironmentUtils.mergePreserveNull([env, expandedPreset.environment]);

// Expand other fields
if (preset.targets) {
Expand Down Expand Up @@ -1834,7 +1834,7 @@ export async function expandTestPresetVariables(preset: TestPreset, name: string
}
}

expansionOpts.envOverride = expandedPreset.environment;
expansionOpts.envOverride = EnvironmentUtils.mergePreserveNull([env, expandedPreset.environment]);

// Expand other fields
if (preset.overwriteConfigurationFile) {
Expand Down

0 comments on commit f1a3770

Please sign in to comment.