14
votes

I'm using Visual Studio 2008 on my main build system. I've been playing with Visual Studio 2010 on another one. It appears that the tool still only wants to use one core when compiling unless you specify the /MP switch in the compiler switches (see How do I turn on multi-CPU/Core C++ compiles in the Visual Studio IDE (2008)?). I have to do this for every project. Is there a way to make VS always do this?

2
I've added the [visual-c++] tag since I think the /MP flag is specific to the VC++ compiler.James McNellis

2 Answers

16
votes

Create environment variable "CL" and set it to "/MP". Microsofts compiler cl.exe always prepend command line flags with this variable.

Some compiler features and options like #import aren't compatible with /MP flag. You will need to add /MP1 to projects used #import in a code. This will disable /MP for those projects.

6
votes

Your can create a property sheet that all of your projects include, and set the /MP flag in that property sheet.

In Visual Studio 2010, you could put it in the Microsoft.Cpp.Win32.user property sheet, which is included in new projects by default (it has the old Visual C++ directories and other default settings defined in it). I don't know that modifying the default property sheet is really a good idea, but it's certainly an option.