Skip to content

Commit

Permalink
presets + cmake.buildToolArgs: make sure -- is added in all cases (#…
Browse files Browse the repository at this point in the history
…3755)

* presets + cmake.buildToolArgs: make sure `--` is added in all cases

Fixes #3754.
This issue was introduced in #3537 (cmake.buildToolsArgs was ignored for presets before).

* Update changelog

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
  • Loading branch information
JeremieA and gcampbell-msft authored Jun 24, 2024
1 parent 423aa3b commit d66b0f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Bug Fixes:
- Fix CMakePresets.json schema validation. [#3651](https://github.com/microsoft/vscode-cmake-tools/issues/3651)
- Update what we use to create the workspace browse configuration to pass to cpp tools by filtering out extra file groups that are generated. [#3729](https://github.com/microsoft/vscode-cmake-tools/issues/3729)
- Fix issue where `cmake.cacheInit` isn't supporting absolute path in environment variables. [#2777](https://github.com/microsoft/vscode-cmake-tools/issues/2777)
- Fix issue where `cmake.buildToolArgs` was sometimes applied incorrectly when presets are used [#3754](https://github.com/microsoft/vscode-cmake-tools/issues/3754)

## 1.17.17

Expand Down
7 changes: 5 additions & 2 deletions src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2032,8 +2032,11 @@ export function buildArgs(preset: BuildPreset, tempOverrideArgs?: string[], temp
}

tempOverrideArgs && result.push(...tempOverrideArgs);
preset.nativeToolOptions && result.push('--', ...preset.nativeToolOptions);
tempOverrideBuildToolArgs && result.push(...tempOverrideBuildToolArgs);
if (preset.nativeToolOptions || tempOverrideBuildToolArgs) {
result.push('--');
preset.nativeToolOptions && result.push(...preset.nativeToolOptions);
tempOverrideBuildToolArgs && result.push(...tempOverrideBuildToolArgs);
}

return result;
}
Expand Down

0 comments on commit d66b0f4

Please sign in to comment.