Skip to content

Commit d66b0f4

Browse files
presets + cmake.buildToolArgs: make sure -- is added in all cases (#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 <[email protected]>
1 parent 423aa3b commit d66b0f4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Bug Fixes:
5959
- Fix CMakePresets.json schema validation. [#3651](https://github.com/microsoft/vscode-cmake-tools/issues/3651)
6060
- 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)
6161
- Fix issue where `cmake.cacheInit` isn't supporting absolute path in environment variables. [#2777](https://github.com/microsoft/vscode-cmake-tools/issues/2777)
62+
- Fix issue where `cmake.buildToolArgs` was sometimes applied incorrectly when presets are used [#3754](https://github.com/microsoft/vscode-cmake-tools/issues/3754)
6263

6364
## 1.17.17
6465

src/preset.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,8 +2032,11 @@ export function buildArgs(preset: BuildPreset, tempOverrideArgs?: string[], temp
20322032
}
20332033

20342034
tempOverrideArgs && result.push(...tempOverrideArgs);
2035-
preset.nativeToolOptions && result.push('--', ...preset.nativeToolOptions);
2036-
tempOverrideBuildToolArgs && result.push(...tempOverrideBuildToolArgs);
2035+
if (preset.nativeToolOptions || tempOverrideBuildToolArgs) {
2036+
result.push('--');
2037+
preset.nativeToolOptions && result.push(...preset.nativeToolOptions);
2038+
tempOverrideBuildToolArgs && result.push(...tempOverrideBuildToolArgs);
2039+
}
20372040

20382041
return result;
20392042
}

0 commit comments

Comments
 (0)