You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated for better visibility of LLVMToolsVersion property.
Note the text was also misleading because it kind of implies that LLVMToolsVersion supports side-by-side version of clang/LLVM in the same `LLVMInstallDir`, but that's not how clang/LLVM works. If you want to select a different version, you need to point it to a different path.
Copy file name to clipboardExpand all lines: docs/build/clang-support-msbuild.md
+8-17Lines changed: 8 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -9,23 +9,23 @@ helpviewer_keywords: ["Clang support for C++ MSBuild projects"]
9
9
10
10
::: moniker range="<=msvc-150"
11
11
12
-
Clang support for both CMake and MSBuild projects is available in Visual Studio 2019.
12
+
Clang/LLVM support for both CMake and MSBuild projects is available in Visual Studio 2019 and Visual Studio 2022.
13
13
14
14
::: moniker-end
15
15
16
16
::: moniker range=">=msvc-160"
17
17
18
-
You can use Visual Studio 2019 version 16.2 and later with Clang to edit, build, and debug C++ Visual Studio projects (MSBuild) that target Windows or Linux.
18
+
You can use Visual Studio 2019 version 16.2 and later with Clang/LLVM to edit, build, and debug C++ Visual Studio projects (MSBuild) that target Windows or Linux.
19
19
20
20
## Install
21
21
22
-
For best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have the tools, you can install them by opening the Visual Studio Installer and choosing **C++ Clang tools for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose **C++ Clang-cl for v142 build tools**.
22
+
For best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have the tools, you can install them by opening the Visual Studio Installer and choosing **C++ Clang tools for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose **C++ Clang-cl for v142 build tools** or **C++ Clang-cl for v143 build tools**.
23
23
24
24
The Microsoft C++ Standard Library requires at least Clang 8.0.0.
25
25
26
26

27
27
28
-
Later versions of Visual Studio provide newer versions of the Clang toolset. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library. For example, Visual Studio 2019 version 16.9 includes Clang v11.
28
+
Later versions of Visual Studio provide newer versions of the Clang toolset. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library. For example, Visual Studio 2019 version 16.11 includes Clang v12.
29
29
30
30
## Configure a Windows project to use Clang tools
31
31
@@ -54,12 +54,13 @@ On Linux, Visual Studio by default uses the first Clang location that it finds i
54
54
55
55
## <aname="custom_llvm_location"></a> Set a custom LLVM location
56
56
57
-
You can set a custom path to LLVM for one or more projects by creating a *Directory.build.props* file. Then, add that file to the root folder of any project. You can add it to the root solution folder to apply it to all projects in the solution. The file should look like this (but use your actual LLVM path):
57
+
You can set a custom path to LLVM for one or more projects by creating a *Directory.build.props* file. Then, add that file to the root folder of any project. You can add it to the root solution folder to apply it to all projects in the solution. The file should look like this (but use your actual LLVM path and version number):
58
58
59
59
```xml
60
60
<Project>
61
61
<PropertyGroup>
62
62
<LLVMInstallDir>C:\MyLLVMRootDir</LLVMInstallDir>
63
+
<LLVMToolsVersion>15.0.0</LLVMToolsVersion>
63
64
</PropertyGroup>
64
65
</Project>
65
66
```
@@ -82,23 +83,13 @@ Starting in Visual Studio 2019 version 16.9, you can set a custom toolset versio
82
83
83
84
The **LLVM Toolset Version** property only appears when the LLVM platform toolset is selected.
84
85
85
-
You can set the toolset version for one or more projects by creating a *Directory.build.props* file. Then, add that file to the root folder of any project. Add it to the root solution folder to apply it to all projects in the solution. The file should look like this (but use your actual LLVM path):
86
-
87
-
```xml
88
-
<Project>
89
-
<PropertyGroup>
90
-
<LLVMToolsVersion>11.0.0</LLVMToolsVersion>
91
-
</PropertyGroup>
92
-
</Project>
93
-
```
94
-
95
-
You can also combine this property with a custom LLVM location. For example, your *Directory.build.props* file could look like:
86
+
You can set the toolset version for one or more projects by creating a *Directory.build.props* file. Then, add that file to the root folder of any project. Add it to the root solution folder to apply it to all projects in the solution. The file should look like this (but use your actual LLVM path and version number):
0 commit comments