Udostępnij za pośrednictwem


How to: Run Multiprocessor Builds in the IDE

This topic describes how to run Multiprocessor Builds from the IDE.

The number of projects that can build concurrently in the IDE is equal to the value of the Maximum number of parallel project builds property. For example, if you build a solution that comprises several projects while this property is set to 2, then up to two projects will build concurrently at a time.

Note

To enable multiprocessor builds in the IDE, the Maximum number of parallel project builds property must be set to a value greater than 1. For information on how to change this property, see How to: Set the Number of Concurrent Builds for Multiprocessor Builds.

Multiprocessor builds automatically run for build commands (such as Build Solution, Rebuild Solution, etc.) when they are enabled in the IDE. Build commands are available from the Build menu or from the shortcut menu that displays when you right-click project (or solution) nodes in Solution Explorer.

To run multiprocessor builds on all projects in a solution

  1. Open the solution containing the projects that you want to build.

  2. Click the Build menu.

    - OR -

    In Solution Explorer, right-click the solution node to bring up the shortcut menu.

  3. Select the desired build command.

    The project system will perform the multiprocessor build action and display the build output in the Output Window.

Use the Batch Build command to specify which projects (in your solution) and which build configurations (such as Debug or Release), that you would like to build concurrently.

To run multiprocessor builds on a subset of projects in a solution

  1. Open the solution containing the projects that you want to build.

  2. Click the Build menu, and then click Batch Build.

    The Batch Build Dialog Box appears.

  3. In the Build column, check the build configurations of the projects that you want to build.

  4. Click the button for the build action that you want to perform (Build or Rebuild).

    The project system will perform the multiprocessor build action and display the build output in the Output window.

Example

The following example illustrates multiprocessor builds in the IDE. To set up this example, create a new solution named MultiprocExample that comprises two C++ console applications, one named Console1 and the other named Console2.

Verify that multiprocessor builds are activated in the IDE, and then use the Batch Build command to run a multiprocessor build for Console1 as Release and Console2 as Debug. Your build output should appear similar to the following build output:

1>------ Build started: Project: Console1, Configuration: Release Win32 ------
2>------ Build started: Project: Console2, Configuration: Debug Win32 ------
2>Compiling...
1>Linking...
2>stdafx.cpp
1>Build log was saved at "file://d:\Documents and Settings\username\My Documents\Visual Studio\Projects\MultiprocExample\Console1\Release\BuildLog.htm"
1>Console1 - 0 error(s), 0 warning(s)
1>
2>Compiling...
2>AssemblyInfo.cpp
2>Console2.cpp
2>Generating Code...
2>Compiling resources...
2>Linking...
2>Build log was saved at "file://d:\Documents and Settings\username\My Documents\Visual Studio\Projects\MultiprocExample\Console2\Debug\BuildLog.htm"
2>Console2 - 0 error(s), 0 warning(s)
2>
---------------------- Done ----------------------

    Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped

See Also

Tasks

How to: Run Multiprocessor Builds with VCBUILD

How to: Run Multiprocessor Builds with DEVENV Command Line Switches