|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Run Multiprocessor Builds with DEVENV Command Line Switches
Runningusing is similar to running multiprocessor builds from the IDE. The number of projects that can build concurrently depends on the value of the Maximum number of parallel project builds property.
To enable multiprocessor builds with DEVENV, 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.
When Multiprocessor builds are enabled with DEVENV command line switches, they will automatically run when you invoke DEVENV with the following build options:
To run multiprocessor builds using DEVENV command line switches
Open a command window.
To set the appropriate environment variables to run Visual Studio tools in a command session, you may need to run VSVARS32.BAT or VCVARS32.BAT.
At the command prompt, enter the following command line to build your solution:
devenv <solution>.sln [options] solutionconfig [/project projectnameorfile [/projectconfig name]]
<solution> specifies the name (and path, if necessary) to the solution file.
The following example illustrates multiprocessor builds using DEVENV command line switches. 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.
Use the following command line to run a multiprocessor rebuild for Console1 and Console2, both in Debug configuration.
D:\>devenv "D:\Documents and Settings\username\My Documents\Visual Studio\Projects\MultiprocExample\MultiprocExample.sln" /rebuild Debug
1>------ Rebuild All started: Project: Console2, Configuration: Debug Win32 ---- -- 2>------ Rebuild All started: Project: Console1, Configuration: Debug Win32 ---- -- 1>Deleting intermediate and output files for project 'Console2', configuration ' Debug|Win32' 2>Deleting intermediate and output files for project 'Console1', configuration ' Debug|Win32' 1>Compiling... 2>Compiling... 1>stdafx.cpp 2>stdafx.cpp 1>Compiling... 2>Compiling... 1>Console2.cpp 2>Console1.cpp 1>AssemblyInfo.cpp 2>AssemblyInfo.cpp 1>Generating Code... 2>Generating Code... 1>Compiling resources... 2>Compiling resources... 2>Linking... 1>Linking... 1>Build log was saved at "file://d:\Documents and Settings\username\My Documents \Visual Studio\Projects\MultiprocExample\Console2\Debug\BuildLog.htm" 1>Console2 - 0 error(s), 0 warning(s) 1> 2>Build log was saved at "file://d:\Documents and Settings\username\My Documents \Visual Studio\Projects\MultiprocExample\Console1\Debug\BuildLog.htm" 2>Console1 - 0 error(s), 0 warning(s) 2> ---------------------- Done ---------------------- Rebuild All: 2 succeeded, 0 failed, 0 skipped