Skip to content

Commit d1e52dd

Browse files
authored
Merge pull request #4740 from MicrosoftDocs/main
1/06 AM Publish
2 parents 4239201 + b2fc8d4 commit d1e52dd

7 files changed

+128
-65
lines changed

docs/build/clang-support-cmake.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,23 @@ You can use Visual Studio with Clang to edit and debug C++ CMake projects that t
2121
**Linux**: For Linux CMake projects, no special Visual Studio support is required. You can install Clang using your distro's package manager, and add the appropriate commands in the CMakeLists.txt file.
2222

2323
## Install
24-
2524
::: moniker-end
2625
::: moniker range="msvc-160"
2726

2827
For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. When using a custom Clang installation, check the **C++ Clang-cl for v142 build tools** component.
2928

29+
![Screenshot of the Visual Studio Installer Individual Components page that shows Clang components available for installation.](media/clang-install-vs2019.png)
30+
3031
::: moniker-end
3132
::: moniker range="msvc-170"
3233

33-
For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. When using a custom Clang installation, check the **C++ Clang-cl for v143 build tools** component.
34+
For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. When using a custom Clang installation, check the **MSBuild support for LLVM (clang-cl) toolset** component.
35+
36+
![Screenshot of the Visual Studio Installer Individual Components page that shows Clang components available for installation.](media/clang-install-vs2022.png)
3437

3538
::: moniker-end
3639
::: moniker range=">=msvc-160"
3740

38-
![Screenshot of the Visual Studio Installer Individual Components page that shows Clang components available for installation.](media/clang-install-vs2019.png)
3941

4042
## Create a new configuration
4143

@@ -82,9 +84,9 @@ You can modify these values in **CMake Settings** under **CMake variables and ca
8284

8385
## Edit, build, and debug
8486

85-
After you have set up a Clang configuration, you can build and debug the project. Visual Studio detects that you are using the Clang compiler and provides IntelliSense, highlighting, navigation, and other editing features. Errors and warnings are displayed in the **Output Window**.
87+
After you have set up a Clang configuration, you can build and debug the project. Visual Studio detects that you're using the Clang compiler and provides IntelliSense, highlighting, navigation, and other editing features. Errors and warnings are displayed in the **Output Window**.
8688

87-
When debugging, you can use breakpoints, memory and data visualization, and most other debugging features. Some compiler-dependent features such as Edit and Continue are not available for Clang configurations.
89+
When debugging, you can use breakpoints, memory and data visualization, and most other debugging features. Some compiler-dependent features such as Edit and Continue aren't available for Clang configurations.
8890

8991
![Screenshot of the Visual Studio debugger debugging a CMake Clang project.](media/clang-debug-visualize.png)
9092

docs/build/clang-support-msbuild.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,35 @@ helpviewer_keywords: ["Clang support for C++ MSBuild projects"]
1212
Clang/LLVM support for both CMake and MSBuild projects is available in Visual Studio 2019 and Visual Studio 2022.
1313

1414
::: moniker-end
15-
1615
::: moniker range=">=msvc-160"
1716

1817
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.
1918

19+
::: moniker-end
20+
21+
::: moniker range="=msvc-160"
22+
## Install
23+
24+
For the 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**.
25+
::: moniker-end
26+
::: moniker range=">=msvc-170"
2027
## Install
2128

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**.
29+
For the 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 **MSBuild support for LLVM (clang-cl) toolset**.
30+
::: moniker-end
2331

32+
::: moniker range=">=msvc-160"
2433
The Microsoft C++ Standard Library requires at least Clang 8.0.0.
34+
::: moniker-end
2535

36+
::: moniker range="=msvc-160"
2637
![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)
38+
::: moniker-end
39+
::: moniker range=">=msvc-170"
40+
![Screenshot of the Visual Studio installer with the Individual components tab selected and the C plus plus Clang components visible.](media/clang-install-vs2022.png)
41+
::: moniker-end
2742

43+
::: moniker range=">=msvc-160"
2844
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.
2945

3046
## Configure a Windows project to use Clang tools
@@ -83,7 +99,7 @@ The **LLVM Toolset Version** property only appears when the LLVM platform toolse
8399

84100
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.
85101

86-
## Set additional properties, edit, build, and debug
102+
## Set properties, edit, build, and debug
87103

88104
After you have set up a Clang configuration, right-click again on the project node and choose **Reload project**. You can now build and debug the project using the Clang tools. Visual Studio detects that you're using the Clang compiler and provides IntelliSense, highlighting, navigation, and other editing features. Errors and warnings are displayed in the **Output Window**. The project property pages for a Clang configuration are similar to the ones for MSVC. However, some compiler-dependent features such as Edit and Continue aren't available for Clang configurations. You can set a Clang compiler or linker option that isn't available in the property pages. Add it manually in the property pages under **Configuration Properties** > **C/C++ (or Linker)** > **Command Line** > **Additional Options**.
89105

11.8 KB
Loading

0 commit comments

Comments
 (0)