I have a VC project file that I'm building from command line using MSBuild. I want to specify the /MP flag without editing the project file. Is that possible?
I've tried set CL=/MP prior to calling MSBuild, but it has no effect.
This can be accomplished by accessing the CL_MPCount Visual Studio option:
MSBuild /m:2 /p:CL_MPCount=2 /p:Configuration=Release tf_tutorials_example_trainer.vcxproj
The above instructs the compiler to perform a maximum of 2 parallel compilation tasks. The /m:2 flag allows MSBuild to build two projects in parallel. The net result is that we have a maximum of 4 cl.exe processes running in parallel.
UPDATE: The CL_MPCount=2 flag gets passed on to cl.exe as /MP2. This allows parallel compilation of 2 .cpp files within the same project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With