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
Copy file name to clipboardExpand all lines: docs/build/clang-support-msbuild.md
+53-10
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
description: "Learn more about: Clang/LLVM support in Visual Studio projects"
3
-
title: "Clang/LLVM support in Visual Studio Visual Studio projects"
4
-
ms.date: "06/02/2020"
3
+
title: "Clang/LLVM support in Visual Studio projects"
4
+
ms.date: 02/05/2021
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
---
@@ -19,7 +19,9 @@ You can use Visual Studio 2019 version 16.2 with Clang to edit, build, and debug
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 those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang tools for Windows** under **Desktop development with C++** optional components. If you prefer to use an existing Clang installation on your machine, choose the **C++ Clang-cl for v142 build tools.** optional component. The Microsoft C++ Standard Library currently requires at least Clang 8.0.0; the bundled version of Clang will automatically be updated to stay current with updates in the Microsoft implementation of the Standard Library.
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 the **C++ Clang-cl for v142 build tools.** optional component.
23
+
24
+
The Microsoft C++ Standard Library currently requires at least Clang 8.0.0. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library.
23
25
24
26

25
27
@@ -29,9 +31,9 @@ To configure a Visual Studio project to use Clang, right-click on the project no
29
31
30
32

31
33
32
-
If you are using the Clang tools that are bundled with Visual Studio, no additional steps are required. For Windows projects, Visual Studio by default invokes Clang in [clang-cl](https://llvm.org/devmtg/2014-04/PDFs/Talks/clang-cl.pdf) mode and links with the Microsoft implementation of the Standard Library. By default, **clang-cl.exe** is located in *%VCINSTALLDIR%\\Tools\\Llvm\\bin\\* and *%VCINSTALLDIR%\\Tools\\Llvm\\x64\\bin\\*.
34
+
If you're using the Clang tools that are bundled with Visual Studio, no extra steps are required. For Windows projects, Visual Studio by default invokes Clang in [clang-cl](https://llvm.org/devmtg/2014-04/PDFs/Talks/clang-cl.pdf) mode. It links with the Microsoft implementation of the Standard Library. By default, **clang-cl.exe** is located in *%VCINSTALLDIR%\\Tools\\Llvm\\bin\\* and *%VCINSTALLDIR%\\Tools\\Llvm\\x64\\bin\\*.
33
35
34
-
If you are using a custom Clang installation, you can either modify **Project** > **Properties** > **VC++ DIrectories** > **Configuration Properties** > **Executable Directories** by adding the custom Clang installation root as the first directory there, or change the value of the `LLVMInstallDir` property. See [Set a custom LLVM location](#custom_llvm_location) for more information.
36
+
If you're using a custom Clang installation, you can either modify **Project** > **Properties** > **VC++ DIrectories** > **Configuration Properties** > **Executable Directories** by adding the custom Clang installation root as the first directory there, or change the value of the `LLVMInstallDir` property. For more information, see [Set a custom LLVM location](#custom_llvm_location).
35
37
36
38
## Configure a Linux project to use Clang tools
37
39
@@ -41,28 +43,69 @@ To configure a Visual Studio Linux project to use Clang:
41
43
42
44
1. Right-click on the project node in **Solution Explorer** and choose **Properties**.
43
45
1. Typically, you should first choose **All configurations** at the top of the dialog.
44
-
1. Under **General** > **Platform Toolset**, choose **WSL_Clang_1_0** if you are using Windows Subsystem for Linux, or **Remote_Clang_1_0** if you are using a remote machine or VM.
46
+
1. Under **General** > **Platform Toolset**, choose **WSL_Clang_1_0** if you're using Windows Subsystem for Linux (WSL). Choose **Remote_Clang_1_0** if you're using a remote machine or VM.
45
47
1. Press **OK**.
46
48
47
49

48
50
49
-
On Linux, Visual Studio by default uses the first Clang location that it encounters in the PATH environment property. If you are using a custom Clang installation, then you must change the value of the `LLVMInstallDir` property or else substitute a path under **Project** > **Properties** > **VC++ DIrectories** > **Configuration Properties** > **Executable Directories**. See [Set a custom LLVM location](#custom_llvm_location) for more information.
51
+
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).
50
52
51
53
## <aname="custom_llvm_location"></a> Set a custom LLVM location
52
54
53
-
You can set a custom path for LLVM for one or more projects by creating a *Directory.build.props* file and adding 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 substitute your actual path):
55
+
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):
54
56
55
57
```xml
56
58
<Project>
57
59
<PropertyGroup>
58
-
<LLVMInstallDir>c:\MyLLVMRootDir</LLVMInstallDir>
60
+
<LLVMInstallDir>C:\MyLLVMRootDir</LLVMInstallDir>
59
61
</PropertyGroup>
60
62
</Project>
61
63
```
62
64
65
+
You can combine this property with a custom LLVM toolset version. For more information, see [Set a custom LLVM toolset version](#custom_llvm_toolset).
66
+
67
+
## <aname="custom_llvm_toolset"></a> Set a custom LLVM toolset version
68
+
69
+
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:
70
+
71
+
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
+
73
+
1. Select the **Configuration Properties** > **General** property page.
74
+
75
+
1. Modify the **Platform Toolset** property to *LLVM (clang-cl)*, if it isn't already set.
76
+
77
+
1. Select the **Configuration Properties** > **Advanced** property page.
78
+
79
+
1. Modify the **LLVM Toolset Version** property to your preferred version, and then choose **OK** to save your changes.
80
+
81
+
The **LLVM Toolset Version** property only appears when the LLVM platform toolset is selected.
82
+
83
+
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):
84
+
85
+
```xml
86
+
<Project>
87
+
<PropertyGroup>
88
+
<LLVMToolsVersion>11.0.0</LLVMToolsVersion>
89
+
</PropertyGroup>
90
+
</Project>
91
+
```
92
+
93
+
You can also combine this property with a custom LLVM location. For example, your *Directory.build.props* file could look like:
94
+
95
+
```xml
96
+
<Project>
97
+
<PropertyGroup>
98
+
<LLVMInstallDir>C:\MyLLVMRootDir</LLVMInstallDir>
99
+
<LLVMToolsVersion>11.0.0</LLVMToolsVersion>
100
+
</PropertyGroup>
101
+
</Project>
102
+
```
103
+
104
+
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.
105
+
63
106
## Set additional properties, edit, build, and debug
64
107
65
-
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 are 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 very similar to those for MSVC, although some compiler-dependent features such as Edit and Continue are not available for Clang configurations. To set a Clang compiler or linker option that is not available in the property pages, you can add it manually in the property pages under **Configuration Properties** > **C/C++ (or Linker)** > **Command Line** > **Additional Options**.
108
+
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**.
66
109
67
110
When debugging, you can use breakpoints, memory and data visualization, and most other debugging features.
ms.description: "Use the Advanced property page in Visual Studio 2019 to set various properties for C++ projects."
7
7
---
8
8
# Advanced Property Page
@@ -83,6 +83,10 @@ The Advanced property page is available in Visual Studio 2019 and later.
83
83
84
84
Specifies the full version of the MSVC toolset that's used to build the project. You may have various update and preview versions of a toolset installed. You can specify which one to use here.
85
85
86
+
-**LLVM Toolset Version**
87
+
88
+
Specifies the full version of the LLVM toolset that's used to build the project. This property is available when **LLVM (clang-cl)** is selected as the platform toolset, starting in Visual Studio 2019 version 16.9. For more information, see [Set a custom LLVM toolset version](..\clang-support-msbuild.md#custom_llvm_toolset).
Copy file name to clipboardExpand all lines: docs/overview/what-s-new-for-visual-cpp-in-visual-studio.md
+3-2
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,17 @@
1
1
---
2
2
title: "What's new for C++ in Visual Studio"
3
3
description: "The new features and fixes in the Microsoft C/C++ compiler and tools in Visual Studio."
4
-
ms.date: "05/19/2020"
4
+
ms.date: "02/08/2021"
5
5
ms.technology: "cpp-ide"
6
-
ms.assetid: 8801dbdb-ca0b-491f-9e33-01618bff5ae9
7
6
---
8
7
# What's new for C++ in Visual Studio
9
8
10
9
::: moniker range=">=msvc-160"
11
10
12
11
Visual Studio 2019 brings many updates and fixes to the Microsoft C++ environment. We've fixed many bugs and issues in the compiler and tools. Many of these issues were submitted by customers through the [Report a Problem](/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2019&preserve-view=true) and [Provide a Suggestion](https://aka.ms/feedback/suggest?space=62) options under **Send Feedback**. Thank you for reporting bugs! For more information on what's new in all of Visual Studio, visit [What's new in Visual Studio 2019](/visualstudio/ide/whats-new-visual-studio-2019). For information on what's new for C++ in Visual Studio 2017, see [What's new for C++ in Visual Studio 2017](?preserve-view=true&view=msvc-150). For information on what's new for C++ in Visual Studio 2015 and earlier versions, see [Visual C++ What's New 2003 through 2015](../porting/visual-cpp-what-s-new-2003-through-2015.md).
13
12
13
+
For information about what's new in the C++ docs, see [Microsoft C++ docs: What's new](whats-new-cpp-docs.md).
14
+
14
15
## C++ compiler
15
16
16
17
- Enhanced support for C++17 features and correctness fixes, plus experimental support for C++20 features such as modules and coroutines. For detailed information, see [C++ Conformance Improvements in Visual Studio 2019](cpp-conformance-improvements.md).
Copy file name to clipboardExpand all lines: docs/overview/whats-new-cpp-docs.md
+13-8
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,15 @@
1
1
---
2
2
title: "What's new for the C++ docs"
3
3
description: "The new docs and doc updates for the Microsoft C/C++ compiler, ATL/MFC, C runtime, and standard library docs."
4
-
ms.date: "02/05/2021"
4
+
ms.date: "02/08/2021"
5
5
---
6
6
# Microsoft C++ docs: What's new for Visual Studio 16.8
7
7
8
-
This article lists some of the major changes to docs for Visual Studio 16.8.
8
+
This article lists some of the major changes to docs for Visual Studio 16.8.
9
+
10
+
For information about what's new in Visual Studio, see [What's new for C++ in Visual Studio](what-s-new-for-visual-cpp-in-visual-studio.md).
11
+
12
+
For the latest C++ conformance status, see [C++ conformance improvements in Visual Studio](cpp-conformance-improvements.md)
9
13
10
14
## C language
11
15
@@ -107,7 +111,7 @@ This article lists some of the major changes to docs for Visual Studio 16.8.
107
111
-[Configure a Linux CMake project in Visual Studio](../linux/cmake-linux-configure.md) - Updated to reflect latest UI
108
112
-[Deploy, run, and debug your Linux MSBuild project](../linux/deploy-run-and-debug-your-linux-project.md) - Added `GDB Path`
109
113
110
-
## Microsoft C/C++ compiler and tools errors and warnings
114
+
## C/C++ compiler and tools errors and warnings
111
115
112
116
### New articles
113
117
@@ -121,7 +125,7 @@ This article lists some of the major changes to docs for Visual Studio 16.8.
121
125
-[Compiler warnings C4800 through C5999](../error-messages/compiler-warnings/compiler-warnings-c4800-through-c4999.md) - Updated 16.7 warnings
122
126
-[Compiler Error C3381](../error-messages/compiler-errors-2/compiler-error-c3381.md) - Address cpp-docs 2493; update remarks and example
123
127
124
-
## Microsoft C/C++ compiler intrinsics and assembly language
128
+
## C/C++ compiler intrinsics and assembly language
125
129
126
130
### Updated articles
127
131
@@ -130,15 +134,15 @@ This article lists some of the major changes to docs for Visual Studio 16.8.
130
134
-[C++ in Visual Studio](../overview/visual-cpp-in-visual-studio.md) - Updated DevCom and Microsoft Docs Q&A links
131
135
-[Microsoft C++ language conformance table](../overview/visual-cpp-language-conformance.md) - Updated C++20 library conformance table, update language feature table for 16.7
132
136
133
-
## Microsoft C++ in Visual Studio
137
+
## C++ in Visual Studio
134
138
135
139
### Updated articles
136
140
137
141
-[`__restrict`](../cpp/extension-restrict.md)
138
142
-[if-else statement (C++)](../cpp/if-else-statement-cpp.md) - Added description for `if/else` grammar
139
143
-[`union`](../cpp/unions.md) - Fixed code snippet
140
144
141
-
## Microsoft C++ in Visual Studio projects and build systems
145
+
## C/C++ projects and build systems
142
146
143
147
### New articles
144
148
@@ -155,13 +159,14 @@ This article lists some of the major changes to docs for Visual Studio 16.8.
155
159
-[`/clr` (Common Language Runtime Compilation)](../build/reference/clr-common-language-runtime-compilation.md) - Added description for `/clr`
156
160
-[pgosweep](../build/pgosweep.md) - Added more pgosweep options
157
161
-[Importing data using `__declspec(dllimport)`](../build/importing-data-using-declspec-dllimport.md) - Updated example
158
-
## Microsoft C++ porting and upgrade guide
162
+
163
+
## C++ porting and upgrade guide
159
164
160
165
### Updated articles
161
166
162
167
-[How to: Use existing C++ code in a Universal Windows Platform app](../porting/how-to-use-existing-cpp-code-in-a-universal-windows-platform-app.md) - Reworked for clarity and updated examples
0 commit comments