Skip to content

Commit 391646f

Browse files
authored
Fixed how we use our '--warn-unused-cli' flag (#3860)
* '--warn-unused-cli' is now used to remove the default '--no-warn-unused-cli' command instead of removing and also adding itself to the arguments * only removed '--warn--unused-cli' instead of all initial_common_flgs
1 parent c1c2412 commit 391646f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Bug Fixes:
1919
- Fix issue where new presets couldn't inherit from presets in CmakeUserPresets.json. These presets are now added to CmakeUserPresets.json instead of CmakePresets.json. [#3725](https://github.com/microsoft/vscode-cmake-tools/issues/3725)
2020
- Fix issue where CMakeTools does not recheck CMake Path to see if user installed CMake after launching VS Code. [3811](https://github.com/microsoft/vscode-cmake-tools/issues/3811)
2121
- Fix issue where `cmake.buildToolArgs` was sometimes applied incorrectly when presets are used [#3754](https://github.com/microsoft/vscode-cmake-tools/issues/3754)
22+
- Still allow for users to add `--warn-unused-cli`. Now instead of overriding, it will remove our default `--no-warn-unused-cli`. [#1090](https://github.com/microsoft/vscode-cmake-tools/issues/1090)
2223

2324
## 1.18.42
2425

src/drivers/cmakeDriver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ export abstract class CMakeDriver implements vscode.Disposable {
14021402
// Cache flags will construct the command line for cmake.
14031403
const init_cache_flags = await this.generateInitCacheFlags();
14041404
const initial_common_flags = extra_args.concat(this.config.configureArgs);
1405-
const common_flags = initial_common_flags.includes("--warn-unused-cli") ? initial_common_flags : initial_common_flags.concat("--no-warn-unused-cli");
1405+
const common_flags = initial_common_flags.includes("--warn-unused-cli") ? initial_common_flags.filter(f => f !== "--warn-unused-cli") : initial_common_flags.concat("--no-warn-unused-cli");
14061406
const define_flags = withoutCmakeSettings ? [] : this.generateCMakeSettingsFlags();
14071407
const final_flags = define_flags.concat(common_flags, init_cache_flags);
14081408

0 commit comments

Comments
 (0)