[llvm-commits] [PATCH] Add MSVC multi processor compilation to build system

Erik Olofsson Erik.Olofsson at hansoft.se
Tue Mar 1 19:11:40 PST 2011


> > -----Original Message-----
> > From: Óscar Fuentes [mailto:ofv at wanadoo.es]
> >
> > if( MSVC_IDE )
> >   set(LLVM_COMPILER_JOBS "0" CACHE STRING
> >     "Number of parallel compiler jobs. 0 means use all processors. Default is
> > 0.")
> >   if( NOT LLVM_COMPILER_JOBS STREQUAL "1" )
> >     if( LLVM_COMPILER_JOBS STREQUAL "0" )
> >       add_llvm_definitions( /MP )
> >     else
> >       add_llvm_definitions( /MP${LLVM_COMPILER_JOBS} )
> >   endif()
> > endif()
>
> Yes, this is even better.

Turns out that due to a bug in CMake you can't actually specify /MPx. When generating for Visual Studio 2010 /MP2 will just set the msbuild MultiProcessorCompilation property to true. It does work correctly for Visual Studio 2008 though, so I just report an error if you try to set anything but 0 or 1 for VS2010.

New patch attached including documentation.

Regards,
Erik

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: llvm-msvc-multi-processor-compilation.patch.txt
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110302/97958141/attachment.txt>


More information about the llvm-commits mailing list