[CMake] Parallel builds

Greg Marr greg.marr at autodesk.com
Wed Sep 16 14:06:10 EDT 2015


-----Original Message-----
From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Bill Hoffman
Sent: Wednesday, September 16, 2015 2:00 PM
To: cmake at cmake.org
Subject: Re: [CMake] Parallel builds

	On 9/16/2015 1:47 PM, J Decker wrote:
	> I see yer right.
	> Details get foggy after years.
	> well that's something to add:)
	>
	All covered my blog.  :)

This part here is inaccurate, at least with the current CMake and Visual Studio:
    "To set the flag you will have to edit the CMake cache with the cmake-gui and add it to the CMAKE_CXX_FLAGS and the CMAKE_C_FLAGS."

This is all we do in the CMake file that we include in all our projects:
        add_compile_options(/MP$ENV{NUMBER_OF_PROCESSORS})

If you don't have a NUMBER_OF_PROCESSORS environment variable, you just get /MP.

The oversubscription part is still true, but I've never seen randomly bad object files.



More information about the CMake mailing list