Skip to content

Commit 6dec3ce

Browse files
authored
Update clang-support-msbuild.md
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.
1 parent e01f9c0 commit 6dec3ce

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

docs/build/clang-support-msbuild.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ helpviewer_keywords: ["Clang support for C++ MSBuild projects"]
99

1010
::: moniker range="<=msvc-150"
1111

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.
1313

1414
::: moniker-end
1515

1616
::: moniker range=">=msvc-160"
1717

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.
1919

2020
## Install
2121

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**.
2323

2424
The Microsoft C++ Standard Library requires at least Clang 8.0.0.
2525

2626
![Screenshot of the Visual Studio installer with the Individual components tab selected and the C plus plus Clang components visible.](media/clang-install-vs2019.png)
2727

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.
2929

3030
## Configure a Windows project to use Clang tools
3131

@@ -54,12 +54,13 @@ On Linux, Visual Studio by default uses the first Clang location that it finds i
5454

5555
## <a name="custom_llvm_location"></a> Set a custom LLVM location
5656

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):
5858

5959
```xml
6060
<Project>
6161
<PropertyGroup>
6262
<LLVMInstallDir>C:\MyLLVMRootDir</LLVMInstallDir>
63+
<LLVMToolsVersion>15.0.0</LLVMToolsVersion>
6364
</PropertyGroup>
6465
</Project>
6566
```
@@ -82,23 +83,13 @@ Starting in Visual Studio 2019 version 16.9, you can set a custom toolset versio
8283

8384
The **LLVM Toolset Version** property only appears when the LLVM platform toolset is selected.
8485

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):
9687

9788
```xml
9889
<Project>
9990
<PropertyGroup>
10091
<LLVMInstallDir>C:\MyLLVMRootDir</LLVMInstallDir>
101-
<LLVMToolsVersion>11.0.0</LLVMToolsVersion>
92+
<LLVMToolsVersion>15.0.0</LLVMToolsVersion>
10293
</PropertyGroup>
10394
</Project>
10495
```

0 commit comments

Comments
 (0)