Skip to content

Commit 1fe7873

Browse files
authored
Merge branch 'main' into building-tests2
2 parents b6feb7c + 0a9c8f8 commit 1fe7873

40 files changed

Lines changed: 1139 additions & 41 deletions

.github/skills/validation-project/SKILL.md

Lines changed: 300 additions & 0 deletions
Large diffs are not rendered by default.

.mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mcpServers": {
3+
"github": {
4+
"type": "http",
5+
"url": "https://api.githubcopilot.com/mcp/"
6+
}
7+
}
8+
}

.vscode/mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"servers": {
3+
"github": {
4+
"type": "http",
5+
"url": "https://api.githubcopilot.com/mcp/"
6+
}
7+
}
8+
}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@ Features:
88

99
Improvements:
1010
- When CMake is invoked prior to running tests, build targets required for the test rather than everything. [#4515](https://github.com/microsoft/vscode-cmake-tools/issues/4515) [@epistax](https://github.com/epistax)
11+
- Improve responsiveness to CMake path changes made by vendor extensions during configure-on-open retry. [#4908](https://github.com/microsoft/vscode-cmake-tools/pull/4908) Contributed by STMicroelectronics
1112

1213
Bug Fixes:
14+
- Fix Windows backslash handling in token splitting to preserve trailing backslashes before whitespace. This caused "Compile Active File" with MSVC + Ninja Multi-Config to merge adjacent flags (e.g., `/Fd<dir>\ /FS`) into a single malformed argument. [#4902](https://github.com/microsoft/vscode-cmake-tools/issues/4902)
1315
- Fix kit detection returning "unknown vendor" when using clang-cl compiler. [#4638](https://github.com/microsoft/vscode-cmake-tools/issues/4638)
1416
- Update testing framework to fix bugs when running tests of CMake Tools without a reliable internet connection. [#4891](https://github.com/microsoft/vscode-cmake-tools/pull/4891) [@cwalther](https://github.com/cwalther)
1517

18+
## 1.23.52
19+
20+
Bug Fixes:
21+
- Fix "Compile File" terminal closing immediately, hiding compilation output. The terminal now stays open until the user presses a key + Fix POSIX shell escape handling in `compile_commands.json` parsing so that escaped quotes (e.g., `\"`) are correctly interpreted when compiling single files. [#4896](https://github.com/microsoft/vscode-cmake-tools/issues/4896)
22+
- Fix `cmake.exportCompileCommandsFile` set to `false` still passing `-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=FALSE` instead of omitting the flag entirely, which caused CMake warnings for projects with `LANGUAGES NONE`. [#4893](https://github.com/microsoft/vscode-cmake-tools/issues/4893)
23+
- Fix regression where Visual Studio kits with an existing Ninja-based build cache would fail due to a generator mismatch. Ninja is now preferred again when available, stale VS kits derive the correct generator at runtime as a fallback, and the build directory is auto-cleaned on generator mismatches. [#4890](https://github.com/microsoft/vscode-cmake-tools/issues/4890)
24+
1625
## 1.23
1726

1827
Features:

docs/kits.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ A _kit_ defines project-agnostic and configuration-agnostic info about how to bu
66
- A Visual Studio installation: building for Visual Studio involves more than just finding the necessary compiler executable. Visual C++ requires certain environment variables to be set to tell it how to find and link to the Visual C++ toolchain headers and libraries.
77
- A toolchain file: The low-level way to instruct CMake how to compile and link for a target. CMake Tools handles toolchain files using kits.
88

9-
Kits are mostly CMake-generator-agnostic (a CMake generator writes the input files for the native build system). Visual Studio kits have a preferred generator that will be used as a fallback to ensure a matching MSBuild and .sln generator are used for the Visual C++ compiler.
9+
Kits are mostly CMake-generator-agnostic (a CMake generator writes the input files for the native build system). The exception is Visual Studio kits: when you [scan for kits](#scan-for-kits), CMake Tools looks up the VS version and sets `preferredGenerator` on the kit to the matching CMake generator (e.g., `"Visual Studio 18 2026"` for VS 2026). If a kit was scanned before CMake Tools added support for that VS version, the extension derives the correct VS generator at runtime as a last-resort fallback — it is tried only after other generators like Ninja. If the version can't be determined, the kit falls through to default generators.
1010

1111
> **Note:**
12-
> * If you use the [Ninja](https://ninja-build.org/) build system, don't worry about Visual Studio CMake Generators. CMake Tools will prefer Ninja if it is present, unless configured otherwise.
12+
> * If you use the [Ninja](https://ninja-build.org/) build system, don't worry about Visual Studio CMake Generators. CMake Tools will prefer Ninja if it is present, unless configured otherwise or the kit has a `preferredGenerator` set at scan time. To explicitly use a specific generator, set `cmake.generator` in your settings.
1313
> * If you change the active kit while a project is configured, the project configuration will be re-generated with the chosen kit.
14+
> * When the selected generator doesn't match what's already in an existing `CMakeCache.txt`, CMake Tools cleans the prior configuration instead of letting CMake error out.
1415
> * Using a kit is recommended but optional. If you don't use a kit, CMake will perform its own automatic detection.
1516
1617
## How kits are found and defined
@@ -52,7 +53,7 @@ Update [user-local kits](#user-local-kits) by running **Scan for Kits** from the
5253

5354
- CMake tools includes `vswhere.exe`, which it uses to find Visual Studio instances installed on the system.
5455

55-
- For each of `x86`, `amd64`, `x86_amd64`, `x86_arm`, `x86_arm64`, `amd64_x86`, `amd64_arm`, and `amd64_arm64`, CMake Tools checks for installed Visual C++ environments. A kit is generated for each existing MSVC toolchain that is found.
56+
- For each of `x86`, `amd64`, `x86_amd64`, `x86_arm`, `x86_arm64`, `amd64_x86`, `amd64_arm`, and `amd64_arm64`, CMake Tools checks for installed Visual C++ environments. A kit is generated for each existing MSVC toolchain that is found. For known VS versions (2019, 2022, 2026, etc.), the kit gets a `preferredGenerator` pointing at the right CMake generator, like `"Visual Studio 18 2026"`. If the VS version wasn't recognized at scan time, CMake Tools derives the correct generator at runtime as a last-resort fallback. Re-running **Scan for Kits** will set `preferredGenerator` permanently.
5657

5758
**3. Save results to the user-local kits file**
5859

@@ -147,7 +148,15 @@ The following additional options may be specified:
147148

148149
`preferredGenerator`
149150

150-
> The CMake generator that should be used with this kit if not the default. CMake Tools will still search in `cmake.preferredGenerators` from `settings.json`, but will fall back to this option if no generator from the user settings is available
151+
> The CMake generator to use with this kit if not the default. For Visual Studio kits, this is set during [kit scanning](#scan-for-kits) based on the VS version. When picking a generator, CMake Tools checks these in order:
152+
>
153+
> 1. `cmake.generator` from your settings — if set, this wins outright; nothing below is consulted.
154+
> 2. The kit's `preferredGenerator` (set at scan time for VS kits).
155+
> 3. `cmake.preferredGenerators` from your settings, in order.
156+
> 4. `Ninja`, then `Unix Makefiles` — only consulted when neither #2 nor #3 produced any candidate (i.e. the kit has no `preferredGenerator` and `cmake.preferredGenerators` is empty).
157+
> 5. For VS kits that have no `preferredGenerator` of their own: the VS generator derived at runtime from the kit's VS version — pushed to the end of the candidate list, so it's tried after the Ninja/Unix Makefiles fallback when both apply.
158+
>
159+
> If a VS kit was scanned before the VS version mapping existed, CMake Tools derives the correct generator at runtime (#5) — but only after Ninja and Unix Makefiles. To make the VS generator the unconditional choice, either re-run **Scan for Kits** so the kit gets its own `preferredGenerator`, or set `cmake.generator` in your settings.
151160
152161
`cmakeSettings`
153162

i18n/chs/src/drivers/cmakeDriver.i18n.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
"file.compilation": "文件编译",
1414
"compile.finished.with.error": "编译完成,存在错误。",
1515
"compile.finished.successfully": "编译成功完成。",
16+
"press.any.key.to.close": "按任意键关闭终端...",
1617
"removing": "删除 {0}",
1718
"unlink.failed": "未能删除缓存文件 {0}",
19+
"generator.changed": "生成器已从 {0} 更改为 {1};正在清理先前配置",
1820
"switching.to.config.preset": "正在切换到配置预设: {0}",
1921
"unsetting.config.preset": "正在取消设置配置预设",
2022
"cmakedriver.config.preset.set.to": "CMakeDriver 配置预设设置为 {0}",

i18n/chs/src/extension.i18n.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"cmake.retry.not.yet": "CMake 尚不可用(尝试 {0}/{1})",
1818
"cmake.retry.configuring": "CMake 现已可用 - 正在配置项目",
1919
"cmake.retry.exhausted": "重试 {0} 次后未找到 CMake",
20+
"cmake.configuration.change.detected": "Detected change in CMake configuration while waiting for CMake to become available.",
2021
"update.code.model.for.list.modifier": "更新自动列表文件修饰符的代码模型",
2122
"failed.to.open.cache.file.on.code.model.update": "未能在代码模型更新时打开 CMake 缓存文件",
2223
"update.code.model.for.cpptools": "更新 cpptools 的代码模型",

i18n/cht/src/drivers/cmakeDriver.i18n.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
"file.compilation": "檔案編譯",
1414
"compile.finished.with.error": "編譯完成,但發生錯誤。",
1515
"compile.finished.successfully": "已成功完成編譯。",
16+
"press.any.key.to.close": "按任意鍵關閉終端機...",
1617
"removing": "移除 {0}",
1718
"unlink.failed": "無法移除快取檔案 {0}",
19+
"generator.changed": "產生器從 {0} 變更為 {1}; 清除先前的設定",
1820
"switching.to.config.preset": "切換以設定預設: {0}",
1921
"unsetting.config.preset": "正在將設定預設取消設定",
2022
"cmakedriver.config.preset.set.to": "CMakeDriver 將預設設定為 {0}",

i18n/cht/src/extension.i18n.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"cmake.retry.not.yet": "CMake 尚無法使用 (嘗試 {0}/{1})",
1818
"cmake.retry.configuring": "CMake 現已可用 — 正在設定專案",
1919
"cmake.retry.exhausted": "重試 {0} 次後仍找不到 CMake",
20+
"cmake.configuration.change.detected": "Detected change in CMake configuration while waiting for CMake to become available.",
2021
"update.code.model.for.list.modifier": "更新自動清單檔案修飾元的程式碼模型",
2122
"failed.to.open.cache.file.on.code.model.update": "無法在程式碼模型更新時開啟 CMake 快取檔案",
2223
"update.code.model.for.cpptools": "更新 cpptools 的程式碼模型",

i18n/csy/src/drivers/cmakeDriver.i18n.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
"file.compilation": "Kompilace souboru",
1414
"compile.finished.with.error": "Kompilace byla dokončena s chybami.",
1515
"compile.finished.successfully": "Kompilace se úspěšně dokončila.",
16+
"press.any.key.to.close": "Stisknutím libovolné klávesy zavřete terminál...",
1617
"removing": "Odebírání kanálu {0}",
1718
"unlink.failed": "Nepovedlo se odebrat soubor mezipaměti {0}",
19+
"generator.changed": "Generátor se změnil z {0} na {1}; čištění předchozí konfigurace",
1820
"switching.to.config.preset": "Přepíná se na předvolbu konfigurace: {0}",
1921
"unsetting.config.preset": "Rušení nastavení předvolby konfigurace",
2022
"cmakedriver.config.preset.set.to": "Předvolba konfigurace CMakeDriver se nastavila na {0}.",

0 commit comments

Comments
 (0)