Skip to content

Commit 3b6980b

Browse files
wchou158Will.Chou
andauthored
buildKitVendor etc.. expansion for clang-cl support (#4524)
* buildKitVendor etc.. expansion for clang-cl support * Updated CHANGELOG.md --------- Co-authored-by: Will.Chou <[email protected]>
1 parent 15de5c5 commit 3b6980b

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Improvements:
1313

1414
- In the Test Explorer, associate CTest tests with outermost function or macro invocation that calls `add_test()` instead of with the `add_test()` call itself. [#4490](https://github.com/microsoft/vscode-cmake-tools/issues/4490) [@malsyned](https://github.com/malsyned)
1515
- Better support of cmake v4.1 and its error index files in cmake-file-api replies [#4575](https://github.com/microsoft/vscode-cmake-tools/issues/4575) Contributed by STMicroelectronics
16+
- Added support for clang-cl vendor detection: `${buildKitVendor}`, `${buildKitVersionMajor}`, etc. now expand correctly when using clang-cl on Windows [#4524](https://github.com/microsoft/vscode-cmake-tools/pull/4524) [@wchou158](https://github.com/wchou158)
1617

1718
Bugs:
1819
- Fix Compiler Warnings not shown in Problems Window [#4567]https://github.com/microsoft/vscode-cmake-tools/issues/4567

src/kits/kit.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export interface CMakeGenerator {
6161
platform?: string;
6262
}
6363

64-
type CompilerVendorEnum = 'Clang' | 'GCC' | 'MSVC';
64+
type CompilerVendorEnum = 'Clang' | 'ClangCl' | 'GCC' | 'MSVC';
6565

6666
export interface KitDetect {
6767
/**
@@ -176,7 +176,7 @@ export async function getCompilerVersion(vendor: CompilerVendorEnum, binPath: st
176176
}
177177
let version_re: RegExp;
178178
let version_match_index;
179-
if (vendor === 'Clang') {
179+
if (vendor === 'Clang' || vendor === 'ClangCl') {
180180
version_re = /^(?:Apple LLVM|.*clang) version ([^\s-]+)(?:[\s-]|$)/mgi;
181181
version_match_index = 1;
182182
} else {
@@ -268,6 +268,8 @@ export async function getKitDetect(kit: Kit): Promise<KitDetect> {
268268
vendor = 'GCC';
269269
} else if (kit.name.startsWith('Clang ')) {
270270
vendor = 'Clang';
271+
} else if (kit.name.startsWith('Clang-cl')) {
272+
vendor = 'ClangCl';
271273
}
272274
if (vendor === undefined) {
273275
return kit;

0 commit comments

Comments
 (0)