Bagikan melalui


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:

  1. Pre-Build event

  2. Custom build steps on individual files

  3. Proxy generator

  4. MIDL

  5. Resource compiler

  6. The C/C++ compiler

  7. Pre-Link event

  8. Linker or Librarian (as appropriate)

  9. BSCMake

  10. Custom build step on the project

  11. 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.

  12. 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.

See Also

Reference

Tool Build Order Dialog Box

Other Resources

Building C++ Projects in Visual Studio

Macros for Build Commands and Properties