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/reference/headername.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,30 +23,32 @@ The name of a header file that the compiler should compile into a header unit (*
23
23
24
24
## Remarks
25
25
26
-
The **`/headerName`** compiler option is available starting in Visual Studio 2019 version 16.10.
26
+
The **`/headerName:quote`**and **`/headerName:angle`**compiler options are available starting in Visual Studio 2019 version 16.10.
27
27
28
-
The **`/headerName`** compiler option, in all its forms, requires the [`/std:c++20`](std-specify-language-standard-version.md) or later compiler option (such as **`/std:c++latest`**).\
29
-
If you specify **`/headerName:{quote,angle}`**, you must also specify [`/exportHeader`](module-exportheader.md).
28
+
The **`/headerName`** compiler options, in all their forms, require the [`/std:c++20`](std-specify-language-standard-version.md) or later compiler option (such as **`/std:c++latest`**).\
29
+
If you specify a **`/headerName`** option, you must also specify [`/exportHeader`](module-exportheader.md).
30
30
31
-
**`/headerName:quote`** looks up *`header-filename`* using the same rules as `#include "header-name"` and builds it as a header unit (*`.ifc`* file).\
32
-
**`/headerName:angle`** looks up *`header-filename`* using the same rules as `#include <header-name>` and builds it as a header unit (*`.ifc`* file).
31
+
-**`/headerName:quote`** looks up *`header-filename`* using the same rules as `#include "header-filename"` and builds it as a header unit (*`.ifc`* file).
32
+
-**`/headerName:angle`** looks up *`header-filename`* using the same rules as `#include <header-filename>` and builds it as a header unit (*`.ifc`* file).
33
+
34
+
For more information about the path searching rules for included files in quotes or angle brackets, see [`#include` directive](../../preprocessor/hash-include-directive-c-cpp.md).
33
35
34
36
### Examples
35
37
36
-
Given a project that references a header file it defines called `m.h`, the compiler option to compile it into a header unit looks similar to this:
38
+
Given a project that references a header file it defines called *`m.h`*, the compiler option to compile it into a header unit looks similar to this example:
You can specify multiple `/headerName` options on the same command line, and every argument after that option will be processed with the specified *`header-filename`* lookup rules. The following example processes all the headers as the previous two command line examples in the same way. It looks up the headers using the lookup rules applied as if they had been specified as: `#include <vector>`, `#include "my-utilties.h"`, and `#include "a/b/my-core.h"`:
51
+
You can specify multiple **`/headerName`** options on the same command line. Every argument after a **`/headerName`**option is processed with the specified include file lookup rules for quotes or angle brackets until the next **`/headerName`** option. The following example processes all the headers as the previous two command line examples in the same way as before. It looks up the headers using the lookup rules applied as if they had been specified as: `#include <vector>`, `#include <iostream>`, `#include <algorithm>`, `#include "my-utilties.h"`, and `#include "a/b/my-core.h"`:
### To set this compiler option in the Visual Studio development environment
56
58
57
59
> [!NOTE]
58
-
> Users don't typically set this command line option. It's set by the build system.
60
+
> You normally shouldn't set this option in the Visual Studio development environment. It's set by the build system.
59
61
60
62
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).
61
63
62
64
1. Set the **Configuration** drop-down to **All Configurations**. Set the **Platform** drop-down to **All Platforms**.
1. Modify the **Additional Options** property to add the *`/headerName`* options and arguments. Then, choose **OK** or **Apply** to save your changes.
68
+
1. Modify the **Additional Options** property to add the *`/headerName:quote`*or *`/headerName:angle`*options and the header filenames the options apply to. Then, choose **OK** or **Apply** to save your changes.
Copy file name to clipboardExpand all lines: docs/build/reference/interface.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ This switch must be used in with the [`/TP` (Specify source file type)](tc-tp-tc
34
34
35
35
### To set this compiler option in the Visual Studio development environment
36
36
37
-
You normally shouldn't set this in the Visual Studio development environment unless you use a different extension for your module interface files. By default, the build system applies this option to files that have a *`.ixx`** extension.
37
+
You normally shouldn't set this option in the Visual Studio development environment unless you use a different extension for your module interface files. By default, the build system applies this option to files that have a *`.ixx`** extension.
38
38
39
39
1. To apply the **`/interface`** option to a file explicitly in the IDE, select the file in **Solution Explorer**. Right-click to open the context menu and select **Properties** to open the Property Pages dialog.
Copy file name to clipboardExpand all lines: docs/build/reference/internal-partition.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ This option can't be used with the [`/interface`](interface.md) compiler option.
52
52
53
53
### To set this compiler option in the Visual Studio development environment
54
54
55
-
You normally shouldn't set this in the Visual Studio development environment unless you use a different extension for your partition files. By default, the build system applies this option to files that have a *`.ixx`** extension.
55
+
You normally shouldn't set this option in the Visual Studio development environment unless you use a different extension for your partition files. By default, the build system applies this option to files that have a *`.ixx`** extension.
56
56
57
57
1. To apply the **`/internalPartition`** option to a file explicitly in the IDE, select the file in **Solution Explorer**. Right-click to open the context menu and select **Properties** to open the Property Pages dialog.
### To set this compiler option in the Visual Studio development environment
55
55
56
-
You normally shouldn't set this in the Visual Studio development environment. It is set by the build system.
56
+
You normally shouldn't set this option in the Visual Studio development environment unless you use a different extension for your header files. By default, the build system applies this option to compiled files that have a *`.h`* extension, or no extension.
57
57
58
58
1. To apply the **`/exportHeader`** option to a file explicitly in the IDE, select the file in **Solution Explorer**. Right-click to open the context menu and select **Properties** to open the Property Pages dialog.
59
59
@@ -65,7 +65,7 @@ You normally shouldn't set this in the Visual Studio development environment. It
65
65
66
66
## See also
67
67
68
-
[`/headerName (Build a header unit from the specified header)`](headername.md)\
68
+
[`/headerName` (Build a header unit from the specified header)](headername.md)\
69
69
[`/headerUnit` (Use header unit IFC)](headerunit.md)\
70
70
[`/reference` (Use named module IFC)](module-reference.md)\
71
71
[`/translateInclude` (Translate include directives into import directives)](translateinclude.md)
0 commit comments