Skip to content

Commit d7bc5f4

Browse files
committed
Doc compile as property per Olga in 4293
1 parent 9c2749e commit d7bc5f4

File tree

5 files changed

+43
-8
lines changed

5 files changed

+43
-8
lines changed

docs/build/reference/c-cpp-prop-page.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "C/C++ Project Properties (Visual Studio)"
33
description: "Reference guide to the Visual Studio Microsoft C/C++ project Property Pages properties."
4-
ms.date: 06/30/2022
4+
ms.date: 11/17/2022
55
ms.topic: "article"
66
f1_keywords: ["VC.Project.VCCLCompilerTool.AdditionalModuleDirectories", "VC.Project.VCCLCompilerTool.ScanSourceForModuleDependencies"]
77
ms.assetid: 16375038-4917-4bd0-9a2a-26343c1708b7
@@ -36,7 +36,7 @@ Specifies one or more header units to use to resolve names passed to an `import`
3636

3737
When set to **Yes**, the compiler scans all C++ sources, not just module interface and header unit sources, for module and header units dependencies. The build system builds the full dependencies graph, which ensures that all imported modules and header units are built before compiling the files that depend on them. When combined with **Translate Includes to Imports**, any header file that's specified in a [`header-units.json`](header-unit-json-reference.md) file in the same directory as the header file is compiled into a header unit.
3838

39-
Files that have the extension *`.ixx`*, and files that have their **File properties** > **C/C++** > **Compile As** property set to **Compile as C++ Header Unit (/export)**, are always scanned.
39+
Files that have the extension *`.ixx`*, and files that have their **File properties** > **C/C++** > **Compile As** property set to **Compile as C++ Header Unit (/exportHeader)**, are always scanned.
4040

4141
### Translate Includes to Imports
4242

@@ -490,8 +490,11 @@ Select compile language option for *`.c`* and *`.cpp`* files. Sets [`/TC`, `/TP`
490490
#### Choices
491491

492492
- **Default** - Default.
493-
- **Compile as C Code** - Compile as C Code.
494-
- **Compile as C++ Code** - Compile as C++ Code.
493+
- **Compile as C Code ([/TC](./tc-tp-tc-tp-specify-source-file-type.md))** - Compile as C Code.
494+
- **Compile as C++ Code ([/TP](./tc-tp-tc-tp-specify-source-file-type.md))** - Compile as C++ Code.
495+
- **Compile as C++ Module Code ([/interface](./interface.md))** - Compile as C++ module code.
496+
- **Compile as C++ Module Internal Partition ([/internalPartition](./internal-partition.md))** - Compile as C++ module internal partition.
497+
- **Compile as C++ Header Unit ([/exportHeader](./module-exportheader.md))** - Compile as C++ header unit.
495498

496499
### Disable Specific Warnings
497500

docs/build/reference/headername.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/headerName (Build a header unit from the specified header)"
33
description: "Use the /headerName compiler option to establish a mapping between a header file and the header unit to build."
4-
ms.date: 04/21/2022
4+
ms.date: 11/16/2022
55
author: "tylermsft"
66
ms.author: "twhitney"
77
f1_keywords: ["/headerName"]
@@ -59,7 +59,7 @@ cl /std:c++latest /exportHeader /headerName:angle /MP /Fo.\ vector iostream algo
5959
6060
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).
6161

62-
1. Set the **Configuration** drop-down to **All Configurations**.
62+
1. Set the **Configuration** drop-down to **All Configurations**. Set the **Platform** drop-down to **All Platforms**.
6363

6464
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
6565

docs/build/reference/interface.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/interface"
33
description: "Use the /interface compiler option to treat the input file as a module interface unit."
4-
ms.date: 04/15/2022
4+
ms.date: 11/16/2022
55
author: "tylermsft"
66
ms.author: "twhitney"
77
f1_keywords: ["/interface", "VC.Project.VCCLCompilerTool.Interface"]
@@ -32,6 +32,18 @@ This switch must be used in with the [`/TP` (Specify source file type)](tc-tp-tc
3232
**`/interface`** is available in Visual Studio 2019 version 16.10, or later.\
3333
**`/interface`** requires [/std:c++20](std-specify-language-standard-version.md) or later.
3434

35+
### To set this compiler option in the Visual Studio development environment
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.
38+
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.
40+
41+
1. Set the **Configuration** dropdown to **All Configurations**. Set the **Platform** dropdown to **All Platforms**.
42+
43+
1. Open the **Configuration Properties** > **C/C++** > **Advanced** property page.
44+
45+
1. Use the dropdown control to modify the **Compile As** property to **Compile as C++ Module Code (/interface)**. Choose **OK** or **Apply** to save your changes.
46+
3547
## See also
3648

3749
[Overview of modules in C++](../../cpp/modules-cpp.md)\

docs/build/reference/internal-partition.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/internalPartition"
33
description: "Use the /internalPartition compiler option to treat the input file as an internal partition unit."
4-
ms.date: 06/29/2022
4+
ms.date: 11/16/2022
55
author: "tylermsft"
66
ms.author: "twhitney"
77
f1_keywords: ["/internalPartition", "VC.Project.VCCLCompilerTool.Interface"]
@@ -50,6 +50,18 @@ This option can't be used with the [`/interface`](interface.md) compiler option.
5050
**`/internalPartition`** is available in Visual Studio 2019 version 16.10, or later.\
5151
**`/internalPartition`** requires [/std:c++20](std-specify-language-standard-version.md) or later.
5252

53+
### To set this compiler option in the Visual Studio development environment
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.
56+
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.
58+
59+
1. Set the **Configuration** dropdown to **All Configurations**. Set the **Platform** dropdown to **All Platforms**.
60+
61+
1. Open the **Configuration Properties** > **C/C++** > **Advanced** property page.
62+
63+
1. Use the dropdown control to modify the **Compile As** property to **Compile as C++ Module Internal Partition (/internalPartition)**. Choose **OK** or **Apply** to save your changes.
64+
5365
## See also
5466

5567
[Overview of modules in C++](../../cpp/modules-cpp.md)\

docs/build/reference/module-exportheader.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ cl . . . /std:c++latest /exportHeader /headerName:quote util/util.h
5555

5656
You normally shouldn't set this in the Visual Studio development environment. It is set by the build system.
5757

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+
60+
1. Set the **Configuration** dropdown to **All Configurations**. Set the **Platform** dropdown to **All Platforms**.
61+
62+
1. Open the **Configuration Properties** > **C/C++** > **Advanced** property page.
63+
64+
1. Use the dropdown control to modify the **Compile As** property to **Compile as C++ Header Unit (/exportHeader)**. Choose **OK** or **Apply** to save your changes.
65+
5866
## See also
5967

6068
[`/headerName (Build a header unit from the specified header)`](headername.md)\

0 commit comments

Comments
 (0)