I’m working from home today due to Seattle’s OMGSNOWPOCALYPSE2012. Lamenting the lack of IncrediBuild here at home, I decided to parallelize my builds - if only across four cores instead of across the entire office.
Visual Studio 2010 has an option for parallelizing C++ builds within a single
project (as opposed to parallelizing the building of multiple projects, which
has long been supported) in the project configuration properties under C/C++
→ General → Multi-processor Compilation. This is similar to the old
make -j, in that it spawns multiple child processes to carry out compilation.
make -j, though, it’s smart enough to spawn an appropriate amount of
processes for the number of processor cores on your machine. (So you won’t end
up with any hilarious anecdotes about how you brought your machine to a
standstill by forgetting to type a number, like with
make -j. Kind of sad,
While it’s not exposed in the project properties dialog, the compilers that ship with VS2005 and VS2008 also supported this option via the /MP command line option. Yes, I realize that the MSDN article I linked to only lists 2010 and 2008, but it does work on 2005 as well; we used it on Pirates of the Burning Sea without trouble.
So go forth, and use those extra cores for something besides YouTube while you’re waiting on a build!