Skip to content

Commit b75ca1e

Browse files
authored
Split props file and IDE sections
When both path and version are merged in the .props file discussion, a division between the .props approach and the IDE approach seems more natural than repeating the same content twice.
1 parent 6dec3ce commit b75ca1e

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

docs/build/clang-support-msbuild.md

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: Clang/LLVM support in Visual Studio projects"
33
title: "Clang/LLVM support in Visual Studio projects"
4-
ms.date: 06/29/2022
4+
ms.date: 09/20/2022
55
ms.description: "Configure a Visual Studio MSBuild project to use the Clang/LLVM toolchain."
66
helpviewer_keywords: ["Clang support for C++ MSBuild projects"]
77
---
@@ -52,9 +52,9 @@ To configure a Visual Studio Linux project to use Clang:
5252

5353
On Linux, Visual Studio by default uses the first Clang location that it finds in the PATH environment property. If you're using a custom Clang installation, then either change the value of the `LLVMInstallDir` property or else enter the path under **Project** > **Properties** > **Configuration Properties** > **VC++ DIrectories** > **Executable Directories**. For more information, see [Set a custom LLVM location](#custom_llvm_location).
5454

55-
## <a name="custom_llvm_location"></a> Set a custom LLVM location
55+
## <a name="custom_llvm_location"></a> Set a custom LLVM location and toolset
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 and version number):
57+
To set a custom path to LLVM and set a custom LLVM toolset version for one or more projects, create 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 example (but use your actual LLVM path and version number):
5858

5959
```xml
6060
<Project>
@@ -65,36 +65,23 @@ You can set a custom path to LLVM for one or more projects by creating a *Direct
6565
</Project>
6666
```
6767

68-
You can combine this property with a custom LLVM toolset version. For more information, see [Set a custom LLVM toolset version](#custom_llvm_toolset).
68+
## <a name="custom_llvm_toolset"></a> Set a custom LLVM toolset version in the IDE
6969

70-
## <a name="custom_llvm_toolset"></a> Set a custom LLVM toolset version
70+
Starting in Visual Studio 2019 version 16.9, you can set a custom toolset version for LLVM in Visual Studio. To set this property in a project:
7171

72-
Starting in Visual Studio 2019 version 16.9, you can set a custom toolset version for LLVM. To set this property in a project in Visual Studio:
73-
74-
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](./working-with-project-properties.md).
72+
1. Open the project's **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties](./working-with-project-properties.md).
7573

7674
1. Select the **Configuration Properties** > **General** property page.
7775

78-
1. Modify the **Platform Toolset** property to *LLVM (clang-cl)*, if it isn't already set.
76+
1. Modify the **Platform Toolset** property to *LLVM (clang-cl)*, if it isn't already set. Choose **Apply** to save your changes.
7977

8078
1. Select the **Configuration Properties** > **Advanced** property page.
8179

8280
1. Modify the **LLVM Toolset Version** property to your preferred version, and then choose **OK** to save your changes.
8381

8482
The **LLVM Toolset Version** property only appears when the LLVM platform toolset is selected.
8583

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):
87-
88-
```xml
89-
<Project>
90-
<PropertyGroup>
91-
<LLVMInstallDir>C:\MyLLVMRootDir</LLVMInstallDir>
92-
<LLVMToolsVersion>15.0.0</LLVMToolsVersion>
93-
</PropertyGroup>
94-
</Project>
95-
```
96-
97-
When you add a *Directory.build.props* file, the settings appear as the default in the project Property Pages dialog. However, changes to these properties in Visual Studio override the settings in the *Directory.build.props* file.
84+
When you add a *Directory.build.props* file to a project or solution, the settings appear as the default in the project Property Pages dialog. However, changes to these properties in Visual Studio override the settings in the *Directory.build.props* file.
9885

9986
## Set additional properties, edit, build, and debug
10087

0 commit comments

Comments
 (0)