Understanding Custom Build Steps and Build Events
From within the Visual C++ development environment, there are two ways customize the build process:
- Custom Build Steps
- A custom build step is a build rule associated with either a project or one or more files. A custom build step can pass input files to a tool, which results in one or more output files. For example, the help files in an MFC application are built with custom build steps. For more information, see Specifying Custom Build Steps.
- Build Events
- Build events let you customize a project's build. There are three build events: Pre-Build, Pre-Link, and Post-Build. A build event lets you specify an action to occur at a specific time in the build process. For example, you could use a build event to register a file with regsvr32.exe after the project finishes building. For more information, see Specifying Build Events.
Troubleshooting Custom Build Steps and Build Events can help you ensure that your custom build steps and build events run as expected.
The output format of a custom build step or build event can also enhance the usability of the tool. For more information, see Formatting the Output of a Custom Build Step or Build Event.
Build events and custom build steps run in the following order along with other build steps:
- Pre-Build event
- Custom build steps on individual files
- Proxy generator
- Resource compiler
- The C/C++ compiler
- Pre-Link event
- Linker or Librarian (as appropriate)
- Custom build step on the project
- Web deployment tool. The web deployment tool runs as part of a build only if the linker or librarian tools also run. However, you can run the web deployment tool via the Build menu.
- Post-Build event
A custom build step on the project, the web deployment tool, and a post-build event run (sequentially) at the same point in the build — after all other build processes are completed.