How can I do a parallel build in Visual Studio 2010?

How can I get VS 2010 to run more than one C++ compile process at a time? I mean building object modules in parallel; I'm not interested in building more than one project at a time (I know about Tools > Options > Build and Run < Maximum number of parallel project builds, but that doesn't do what I want).

Basically, I'm looking for Visual Studio's equivalent of "make -jN".


Solution 1:

  1. Tools -> Options
  2. Projects and Solutions\VC++ Project Settings
  3. Maximum concurrent C++ compilations

Also, as Ross Smith said in the comments, you also need to turn on the "Multiprocessor compilation" option on the project:

  1. Project properties
  2. Configuration Properties > C/C++ > General
  3. Multi-Processor Compilation
  4. Profit!

Solution 2:

There are two switches that must be set in order to make VS build using multithreading (both are project-specific):

  • project properties->C/C++->General->Multi-processor Compilation set to: Yes (/MP)
  • project properties->C/C++->Code Generation->Enable Minimal Rebuild set to: No (/Gm-)

Check also Your Tools->Options->Projects and Solutions->VC++ Project Settings->Maximum concurrent C++ compilations setting. Default value is 0 which enables VS to use as many concurret compilations as possible.