|
1 | 1 | --- |
2 | 2 | title: "Clang/LLVM support in Visual Studio projects" |
3 | 3 | description: "Learn more about: Clang/LLVM support in Visual Studio projects" |
4 | | -ms.date: 03/13/2024 |
| 4 | +ms.date: 12/11/2025 |
5 | 5 | ms.description: "Configure a Visual Studio MSBuild project to use the Clang/LLVM toolchain." |
6 | 6 | helpviewer_keywords: ["Clang support for C++ MSBuild projects"] |
7 | 7 | --- |
@@ -49,6 +49,10 @@ The Individual components tab is selected in the installer. C++ Clang Compiler f |
49 | 49 | ::: moniker range=">=msvc-160" |
50 | 50 | 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. |
51 | 51 |
|
| 52 | +The LLVM experience in Visual Studio delivers seamless build support, project system integration, and design-time features that work with your choice of LLVM distributions. For acquisition convenience, we provide an optional LLVM binary distribution with Visual Studio. This LLVM toolset is provided as-is, sourced directly from the [LLVM Foundation’s release page](https://github.com/llvm/llvm-project/releases) without modifications by Microsoft. The installed binaries are digitally signed with a third-party Microsoft code signing certificate to mark their third-party status and to confirm that they were obtained from the LLVM Foundation’s release page. |
| 53 | + |
| 54 | +LLVM updates in Visual Studio are typically aligned with major LLVM releases ahead of a Visual Studio general release. However, if the community or partners report security or critical blocking issues addressed in a minor LLVM release, we prioritize updating the bundled LLVM toolset to a newer minor version containing the fix. Visual Studio’s build and project system supports using your own custom LLVM installation if needed. |
| 55 | + |
52 | 56 | ## Configure a Windows project to use Clang tools |
53 | 57 |
|
54 | 58 | To configure a Visual Studio project to use Clang, right-click on the project node in **Solution Explorer** and choose **Properties**. Typically, you should first choose **All configurations** at the top of the dialog. Then, under **General** > **Platform Toolset**, choose **LLVM (clang-cl)** and then **OK**. |
@@ -111,12 +115,12 @@ When you add a `Directory.build.props` file to a project or solution, the settin |
111 | 115 |
|
112 | 116 | ## Set properties, edit, build, and debug |
113 | 117 |
|
114 | | -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**. |
| 118 | +After you 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**. |
115 | 119 |
|
116 | 120 | When debugging, you can use breakpoints, memory and data visualization, and most other debugging features. |
117 | 121 |
|
118 | 122 | :::image type="complex" source="media/clang-debug-msbuild.png" alt-text="Screenshot of Visual Studio debugging a sample app"::: |
119 | | -The portion of the app that is visible creates a string vector and adds some strings to it. Execution has stopped on a breakpoint for the code: v.push_back("Clang/LLVM");. |
| 123 | +The portion of the app that's visible creates a string vector and adds some strings to it. Execution stopped on a breakpoint for the code v.push_back("Clang/LLVM");. |
120 | 124 | :::image-end::: |
121 | 125 |
|
122 | 126 | ::: moniker-end |
0 commit comments