I would like MSBuild.exe to always use the /MP option so that projects are always built with multiple cores. I tried adding /MP to the last line of my MSBuild.rsp (in the same directory as the MSBuild.exe executable). However the /MP option is not being used. How can I get Visual Studio to always use the /MP option?
The MSBuild.rsp describes the behavior I want to use, but I haven't been able to get it to work:
The auto-response file is a special .rsp file that MSBuild.exe automatically uses when building a project. This file, MSBuild.rsp, must be in the same directory as MSBuild.exe, otherwise it will not be found. You can edit this file to specify default command line switches to MSBuild.exe. For example, if you use the same logger every time you build a project, you can add the /logger switch to MSBuild.rsp, and MSBuild.exe will use the logger every time a project is built.
I restarted my computer to verify that MSBuild.exe wasn't somehow using the prior version of MSBuild.rsp.
I verified that I was modifying the MSBuild.rsp in the same directory as MSBuild.exe by checking the "Open File Location" in Windows task manager. The project configuration MP option is blank (not explicitly disabled).
I confirmed that the /MP option in MSBuild.rsp wasn't being used by doing a "Project Only" rebuild and counting just one cl.exe instance in Windows Task Manager (if I do the same rebuild with the /MP option manually set there are more than 10 cl.exe instances).
I also tried adding a bunch of garbage to MSBuild.rsp, and no error nor warning was reported by Visual Studio, which leads me to think the MSBuild.rsp is not being used at all.
I tried enabling diagnostic output logging for MSBuild and it shows the /MP option (as an argument to Tracker.exe) when I explicitly enable it in my project's configuration settings, but if I leave the MP option blank in my project's configuration and just include it in MSBuild.rsp the /MP option is not included in this output. I don't know what Tracker.exe is (I expected to see MSBuild.exe in it's place). I also tried adding a Tracker.rsp file with /MP in the same directory as Tracker.exe on a wild guess, and that didn't help either (and I also tried adding MSBuild.rsp to my Tracker.exe directory and that also had no impact).
Just to see if the rsp file could ever work, I explicitly added the rsp file with the @ option added to my project's configuration settings, and it does show as loading in the /MP option in the diagnostic build output, but it has no effect. The /MP option is included later as an argument to cl.exe, not as an argument to Tracker.exe like it was when the MP option was specified in the project configuration. I think the option should be to MSBuild (or Tracker.exe I guess), not cl.exe.
I am using Visual Studio 2010 with mostly C++ projects.