Skip to content

Commit 23effb2

Browse files
authored
Update cmake-presets-vs.md
Add instructions for configuring clang-cl with the ClangCL toolset configure preset instead of by setting CMAKE_C_COMPILER and CMAKE_CXX_COMPILER in cacheVariables.
1 parent 530cdae commit 23effb2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/build/cmake-presets-vs.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,22 @@ Build with `clang`:
223223
}
224224
```
225225

226+
*OR* use the `toolset` configure preset to specify the `ClangCL` toolset like so:
227+
228+
```json
229+
"cacheVariables": {
230+
"CMAKE_BUILD_TYPE": "Debug",
231+
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
232+
},
233+
"toolset": "ClangCL",
234+
235+
"vendor": {
236+
"microsoft.com/VisualStudioSettings/CMake/1.0": {
237+
"intelliSenseMode": "windows-clang-x64"
238+
}
239+
}
240+
```
241+
226242
> [!IMPORTANT]
227243
> In Visual Studio 2019, you must explicitly specify a Clang IntelliSense mode when you're building with `clang` or `clang-cl`.
228244

0 commit comments

Comments
 (0)