Skip to content

Commit 0ecab9e

Browse files
author
Colin Robertson
authored
Miscellaneous fixes for issues reported (#4179)
* Miscellaneous fixes for issues reported * Update per review
1 parent b73d6c6 commit 0ecab9e

8 files changed

+263
-281
lines changed
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
---
2-
description: "Learn more about: Formatting the Output of a Custom Build Step or Build Event"
3-
title: "Formatting the Output of a Custom Build Step or Build Event"
4-
ms.date: "08/27/2018"
2+
description: "Learn more about: Formatting the output of a custom build step or build event"
3+
title: "Formatting the output of a custom build step or build event"
4+
ms.date: 03/15/2022
55
helpviewer_keywords: ["builds [C++], build events", "custom build steps [C++], output format", "events [C++], build", "build events [C++], output format", "build steps [C++], output format", "builds [C++], custom build steps"]
66
ms.assetid: 92ad3e38-24d7-4b89-90e6-5a16f5f998da
77
---
8-
# Formatting the Output of a Custom Build Step or Build Event
8+
# Formatting the output of a custom build step or build event
99

1010
If the output of a custom build step or build event is formatted correctly, users get the following benefits:
1111

1212
- Warnings and errors are counted in the **Output** window.
1313

1414
- Output appears in the **Task List** window.
1515

16-
- Clicking on the output in the **Output** window displays the appropriate topic.
16+
- Clicking on the output in the **Output** window displays the appropriate location.
1717

18-
- F1 operations are enabled in the **Task List** window or **Output** window.
18+
- **F1** operations are enabled in the **Task List** window or **Output** window.
19+
20+
## Output format
1921

2022
The format of the output should be:
2123

22-
> {<em>filename</em>**(**<em>line#</em> \[**,** <em>column#</em>]**)** \| *toolname*} **:** \[ <em>any text</em> ] {**error** \| **warning**} <em>code+number</em>**:**<em>localizable string</em> \[ <em>any text</em> ]
24+
> { *filename*`(`*line-number* \[`,` *column-number*]`)` \| *tool-name* } `:` \[ *any-text* ] {`error` \| `warning`} *code-type-and-number* `:` *localizable-string* \[ *any-text* ]
2325
2426
Where:
2527

26-
- {*a* \| *b*} is a choice of either *a* or *b*.
28+
- { *a* \| *b* } is a choice of either *a* or *b*,
2729

28-
- \[<em>item</em>] is an optional string or parameter.
30+
- \[ *item* ] is an optional string or parameter,
2931

30-
- **Bold** represents a literal.
32+
- `text` represents a literal.
3133

3234
For example:
3335

34-
> C:\\*sourcefile.cpp*(134) : error C2143: syntax error : missing ';' before '}'
36+
> C:\\sourcefile.cpp(134) : error C2143: syntax error : missing ';' before '}'
3537
>
36-
> LINK : fatal error LNK1104: cannot open file '*somelib.lib*'
38+
> LINK : fatal error LNK1104: cannot open file 'some-library.lib'
3739
3840
## See also
3941

40-
[Understanding Custom Build Steps and Build Events](understanding-custom-build-steps-and-build-events.md)
42+
[Understanding custom build steps and build events](understanding-custom-build-steps-and-build-events.md)
Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
---
2-
description: "Learn more about: How to: Add Custom Build Tools to MSBuild Projects"
3-
title: "How to: Add Custom Build Tools to MSBuild Projects"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about how to add custom build tools to MSBuild projects"
3+
title: "How to: Add custom build tools to MSBuild projects"
4+
ms.date: 03/15/2022
55
helpviewer_keywords: ["msbuild (c++), howto: add custom build tools"]
66
ms.assetid: de03899a-371d-4396-9bf9-34f45a65e909
77
---
8-
# How to: Add Custom Build Tools to MSBuild Projects
8+
# How to: Add custom build tools to MSBuild projects
99

10-
A custom build tool is a user-defined, command-line tool that is associated with a particular file.
10+
A custom build tool is a user-defined, command-line tool that's associated with a particular file.
1111

12-
For a particular file, specify in the project file (.vcxproj) the command line to execute, any additional input or output files, and a message to display. If **MSBuild** determines that your output files are out of date with regard to your input files, it displays the message and executes the command-line tool.
12+
For a particular file, specify in the project file (*`.vcxproj`*) the command line to execute, any other input or output files, and a message to display. If **MSBuild** determines that your output files are out of date relative to your input files, it displays the message and executes the command-line tool.
1313

14-
To specify when the custom build tool executes, use one or both of the `CustomBuildBeforeTargets` and `CustomBuildAfterTargets` XML elements in the project file. For example, you might specify that your custom build tool run after the MIDL compiler and before the C/C++ compiler. Specify the `CustomBuildBeforeTargets` element to execute the tool before a particular target runs; the `CustomBuildAfterTargets` element to execute the tool after a particular target; or both elements to run the tool between execution of two targets. If neither element is specified, your custom build tool executes at its default location, which is before the **MIDL** target.
14+
## Specify custom build tools and custom build steps
15+
16+
To specify when the custom build tool executes, use one or both of the `CustomBuildBeforeTargets` and `CustomBuildAfterTargets` XML elements in the project file. For example, you might specify that your custom build tool run after the MIDL compiler and before the C/C++ compiler. Specify the `CustomBuildBeforeTargets` element to execute the tool before a particular target runs. Use the `CustomBuildAfterTargets` element to execute the tool after a particular target runs. Use both elements to run the tool between execution of two targets. If neither element is specified, your custom build tool executes at its default location, which is before the **MIDL** target.
1517

1618
Custom build steps and custom build tools share the information specified in the `CustomBuildBeforeTargets` and `CustomBuildAfterTargets` XML elements. Specify those targets one time in your project file.
1719

1820
### To add a custom build tool
1921

20-
1. Add an item group to the project file and add an item for each input file. Specify the command, additional inputs, outputs, and a message as item metadata, as shown here. This example assumes that a "faq.txt" file exists in the same directory as your project.
22+
1. Add an item group to the project file and add an item for each input file. Specify the command and its inputs, outputs, and a message as item metadata, as shown here. This example assumes that a "faq.txt" file exists in the same directory as your project. The custom build step copies it to the output directory.
2123

22-
```
24+
```xml
2325
<ItemGroup>
2426
<CustomBuild Include="faq.txt">
2527
<Message>Copying readme...</Message>
@@ -29,11 +31,11 @@ Custom build steps and custom build tools share the information specified in the
2931
</ItemGroup>
3032
```
3133

32-
### To define where in the build the custom build tools will execute
34+
### To define where in the build the custom build tools execute
3335

34-
1. Add the following property group to the project file. You have to specify at least one of the targets, but you can omit the other if you are only interested in having your build step execute before (or after) a particular target. This example performs the custom step after compiling but before linking.
36+
1. Add the following property group to the project file. You have to specify at least one of the targets. You can omit the other if you're only interested in having your build step execute before (or after) a particular target. This example performs the custom step after compiling but before linking.
3537

36-
```
38+
```xml
3739
<PropertyGroup>
3840
<CustomBuildAfterTargets>ClCompile</CustomBuildAfterTargets>
3941
<CustomBuildBeforeTargets>Link</CustomBuildBeforeTargets>
@@ -42,6 +44,8 @@ Custom build steps and custom build tools share the information specified in the
4244

4345
## See also
4446

45-
[Walkthrough: Using MSBuild to Create a C++ Project](walkthrough-using-msbuild-to-create-a-visual-cpp-project.md)<br/>
46-
[How to: Use Build Events in MSBuild Projects](how-to-use-build-events-in-msbuild-projects.md)<br/>
47-
[How to: Add a Custom Build Step to MSBuild Projects](how-to-add-a-custom-build-step-to-msbuild-projects.md)
47+
[Walkthrough: Using MSBuild to create a C++ project](walkthrough-using-msbuild-to-create-a-visual-cpp-project.md)\
48+
[How to: Use build events in MSBuild projects](how-to-use-build-events-in-msbuild-projects.md)\
49+
[How to: Add a custom build step to MSBuild projects](how-to-add-a-custom-build-step-to-msbuild-projects.md)\
50+
[Common macros for MSBuild commands and properties](reference/common-macros-for-build-commands-and-properties.md)\
51+
[MSBuild well-known item metadata](/visualstudio/msbuild/msbuild-well-known-item-metadata)
Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,72 @@
11
---
2-
title: "BSCMAKE Options"
2+
title: "BSCMAKE options"
33
description: "Reference to the Microsoft BSCMAKE utility command-line options."
4-
ms.date: "02/09/2020"
4+
ms.date: 03/21/2022
55
f1_keywords: ["VC.Project.VCBscMakeTool.OutputFile", "VC.Project.VCBscMakeTool.SuppressStartupBanner", "VC.Project.VCBscMakeTool.PreserveSBR"]
66
helpviewer_keywords: ["/v BSCMAKE option", "Iu BSCMAKE option", "browse information files (.bsc), content", "/Er BSCMAKE option", "NOLOGO BSCMAKE option", "/s BSCMAKE option", "/Ei BSCMAKE option", "/o BSCMAKE option", "/NOLOGO BSCMAKE option", "/Iu BSCMAKE option", "s BSCMAKE option (/s)", "/Em BSCMAKE option", "Em BSCMAKE option", "Es BSCMAKE option", "files [C++], BSCMAKE", "Er BSCMAKE option", "BSCMAKE, options for controlling files", "controlling BSCMAKE options", "El BSCMAKE option", "/El BSCMAKE option", "/Es BSCMAKE option", "Ei BSCMAKE option"]
77
ms.assetid: fa2f1e06-c684-41cf-80dd-6a554835ebd2
88
---
9-
# BSCMAKE Options
9+
# BSCMAKE options
1010

1111
> [!WARNING]
12-
> Although BSCMAKE is still installed with Visual Studio, it is no longer used by the IDE. Since Visual Studio 2008, browse and symbol information is stored automatically in a SQL Server *`.sdf`* file in the solution folder.
12+
> Although BSCMAKE is still installed with Visual Studio, it's no longer used by the IDE. Since Visual Studio 2008, browse and symbol information is stored automatically in a SQL Server *`.sdf`* file in the solution folder.
1313
14-
This section describes the options available for controlling BSCMAKE. Several options control the content of the browse information file by excluding or including certain information. The exclusion options can allow BSCMAKE to run faster and may result in a smaller *`.bsc`* file. Option names are case-sensitive (except for **/HELP** and **/NOLOGO**).
14+
This section describes the options available for controlling BSCMAKE. Several options control the content of the browse information file by excluding or including certain information. The exclusion options can allow BSCMAKE to run faster and may result in a smaller *`.bsc`* file. Option names are case-sensitive (except for **`/HELP`** and **`/NOLOGO`**).
1515

16-
Only **/NOLOGO** and **/o** are available from within the Visual Studio development environment. See [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md) for information on access a project's property pages.
16+
Only **`/NOLOGO`** and **`/o`** are available from within the Visual Studio development environment. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
1717

18-
**/Ei (**_filename_...**)**\
19-
Excludes the contents of the specified include files from the browse information file. To specify multiple files, separate the names with a space and enclose the list in parentheses. Parentheses aren't necessary if you specify only one *filename*. Use **/Ei** along with the **/Es** option to exclude files not excluded by **/Es**.
18+
## Options
2019

21-
**/El**\
20+
**`/Ei (`** *`filename`* ... **`)`**\
21+
Excludes the contents of one or more specified *`filename`* include files from the browse information file. To specify multiple files, separate the names with a space and enclose the list in parentheses. Parentheses aren't necessary if you specify only one *`filename`*. Use **`/Ei`** along with the **`/Es`** option to exclude files not excluded by **`/Es`**.
22+
23+
**`/El`**\
2224
Excludes local symbols. The default is to include local symbols. For more information about local symbols, see [Creating an .sbr File](creating-an-dot-sbr-file.md).
2325

24-
**/Em**\
25-
Excludes symbols in the body of macros. Use **/Em** to include only the names of macros in the browse information file. The default is to include both the macro names and the result of the macro expansions.
26+
**`/Em`**\
27+
Excludes symbols in the body of macros. Use **`/Em`** to include only the names of macros in the browse information file. The default is to include both the macro names and the result of the macro expansions.
2628

27-
**/Er (**_symbol_...**)**\
28-
Excludes the specified symbols from the browse information file. To specify multiple symbol names, separate the names with a space and enclose the list in parentheses. Parentheses are unnecessary if you specify only one *symbol*.
29+
**`/Er (`** *`symbol`* ... **`)`**\
30+
Excludes one or more of the specified *`symbol`* symbols from the browse information file. To specify multiple symbol names, separate the names with a space and enclose the list in parentheses. Parentheses are unnecessary if you specify only one *`symbol`*.
2931

30-
**/Es**\
31-
Excludes every include file specified with an absolute path, or found in an absolute path specified in the INCLUDE environment variable. (Usually, these files are the system include files, which contain much information you may not need in your browse information file.) This option doesn't exclude files specified without a path, or with relative paths, or files found in a relative path in INCLUDE. You can use the **/Ei** option along with **/Es** to exclude files that **/Es** doesn't exclude. If you want to exclude only some of the files, use **/Ei** instead of **/Es**, and list the files you want to exclude.
32+
**`/Es`**\
33+
Excludes every include file specified with an absolute path, or found in an absolute path specified in the INCLUDE environment variable. (Usually, these files are the system include files, which contain much information you may not need in your browse information file.) This option doesn't exclude files specified without a path, or with relative paths, or files found in a relative path in INCLUDE. You can use the **`/Ei`** option along with **`/Es`** to exclude files that **`/Es`** doesn't exclude. If you want to exclude only some of the files, use **`/Ei`** instead of **`/Es`**, and list the files you want to exclude.
3234

33-
**/errorreport:**[**none** \| **prompt** \| **queue** \| **send**]\
34-
This option is deprecated. Starting in Windows Vista, error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings.
35+
**`/errorreport:`**\[ **`none`** \| **`prompt`** \| **`queue`** \| **`send`** ]\
36+
This option is deprecated. In Windows Vista and later, error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings.
3537

36-
**/HELP**\
38+
**`/HELP`**\
3739
Displays a summary of the BSCMAKE command-line syntax.
3840

39-
**/Iu**\
41+
**`/Iu`**\
4042
Includes unreferenced symbols. By default, BSCMAKE doesn't record any symbols that are defined but not referenced. If an *`.sbr`* file has been packed, this option has no effect for that input file because the compiler has already removed the unreferenced symbols.
4143

42-
**/n**\
43-
Forces a nonincremental build. Use **/n** to force a full build of the browse information file whether a *`.bsc`* file exists or not, and to prevent *`.sbr`* files from being truncated. For more information, see [How BSCMAKE builds a `.bsc` file](how-bscmake-builds-a-dot-bsc-file.md).
44+
**`/n`**\
45+
Forces a non-incremental build. Use **`/n`** to force a full build of the browse information file whether a *`.bsc`* file exists or not, and to prevent *`.sbr`* files from being truncated. For more information, see [How BSCMAKE builds a `.bsc` file](how-bscmake-builds-a-dot-bsc-file.md).
4446

45-
**/NOLOGO**\
47+
**`/NOLOGO`**\
4648
Suppresses the BSCMAKE copyright message.
4749

48-
**/o** *filename*\
49-
Specifies a name for the browse information file. By default, BSCMAKE gives the browse information file the base name of the first *`.sbr`* file and a *`.bsc`* extension.
50+
**`/o`** *`filename`*\
51+
The *`filename`* option parameter specifies a name for the browse information file. By default, BSCMAKE gives the browse information file the base name of the first *`.sbr`* file and a *`.bsc`* extension.
5052

51-
**/S (**_filename_...**)**\
52-
Tells BSCMAKE to process the specified include file the first time it's encountered and to exclude it otherwise. Use this option to save processing time when a file (such as a header, or *`.h`*, file for a *`.c`* or *`.cpp`* source file) is included in several source files but is unchanged by preprocessing directives each time. Use this option if a file is changed in ways unimportant for the browse information file you're creating. To specify multiple files, separate the names with a space, and enclose the list in parentheses. Parentheses aren't necessary if you specify only one *filename*. If you want to exclude the file every time it's included, use the **/Ei** or **/Es** option.
53+
**`/S (`** *`filename`* ... **`)`**\
54+
Tells BSCMAKE to process each specified *`filename`* include file the first time it's encountered and to exclude it otherwise. Use this option to save processing time when a file (such as a header, or *`.h`*, file for a *`.c`* or *`.cpp`* source file) is included in several source files but is unchanged by preprocessing directives each time. Use this option if a file is changed in ways unimportant for the browse information file you're creating. To specify multiple files, separate the names with a space, and enclose the list in parentheses. Parentheses aren't necessary if you specify only one *`filename`*. If you want to exclude the file every time it's included, use the **`/Ei`** or **`/Es`** option.
5355

54-
**/v**\
56+
**`/v`**\
5557
Provides verbose output, which includes the name of each *`.sbr`* file being processed and information about the complete BSCMAKE run.
5658

57-
**/?**\
59+
**`/?`**\
5860
Displays a brief summary of BSCMAKE command-line syntax.
5961

60-
The following command line tells BSCMAKE to do a full build of MAIN.bsc from three *`.sbr`* files. It also tells BSCMAKE to exclude duplicate instances of TOOLBOX.h:
62+
## Example
63+
64+
The following command line tells BSCMAKE to do a full build of *`main.bsc`* from three *`.sbr`* files. It also tells BSCMAKE to exclude duplicate instances of *`toolbox.h`*:
6165

6266
```cmd
6367
BSCMAKE /n /S toolbox.h /o main.bsc file1.sbr file2.sbr file3.sbr
6468
```
6569

6670
## See also
6771

68-
[BSCMAKE Reference](bscmake-reference.md)
72+
[BSCMAKE reference](bscmake-reference.md)

0 commit comments

Comments
 (0)