[llvm-commits] [llvm] r126847 - in /llvm/trunk: cmake/modules/HandleLLVMOptions.cmake docs/CMake.html
Oscar Fuentes
ofv at wanadoo.es
Wed Mar 2 09:47:37 PST 2011
Author: ofv
Date: Wed Mar 2 11:47:37 2011
New Revision: 126847
URL: http://llvm.org/viewvc/llvm-project?rev=126847&view=rev
Log:
Support for parallel compilation (/MP) when using the VS IDE.
Patch by Erik Olofsson!
Modified:
llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
llvm/trunk/docs/CMake.html
Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=126847&r1=126846&r2=126847&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Wed Mar 2 11:47:37 2011
@@ -102,6 +102,31 @@
endif( LLVM_BUILD_32_BITS )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
+message(STATUS "uno"
+"dos")
+if( MSVC_IDE AND ( MSVC90 OR MSVC10 ) )
+ # Only Visual Studio 2008 and 2010 officially supports /MP.
+ # Visual Studio 2005 do support it but it's experimental there.
+ 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()
+ if (MSVC10)
+ message(FATAL_ERROR
+ "Due to a bug in CMake only 0 and 1 is supported for "
+ "LLVM_COMPILER_JOBS when generating for Visual Studio 2010")
+ else()
+ message(STATUS "Number of parallel compiler jobs set to " ${LLVM_COMPILER_JOBS})
+ add_llvm_definitions( /MP${LLVM_COMPILER_JOBS} )
+ endif()
+ endif()
+ else()
+ message(STATUS "Parallel compilation disabled")
+ endif()
+endif()
+
if( MSVC )
include(ChooseMSVCCRT)
Modified: llvm/trunk/docs/CMake.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMake.html?rev=126847&r1=126846&r2=126847&view=diff
==============================================================================
--- llvm/trunk/docs/CMake.html (original)
+++ llvm/trunk/docs/CMake.html Wed Mar 2 11:47:37 2011
@@ -452,6 +452,22 @@
</div>
+<div class="doc_subsection">
+ <a name="msvc">Microsoft Visual C++</a>
+</div>
+
+<div class="doc_text">
+
+<dl>
+ <dt><b>LLVM_COMPILER_JOBS</b>:STRING</dt>
+ <dd>Specifies the maximum number of parallell compiler jobs to use
+ per project when building with msbuild or Visual Studio. Only supported for
+ Visual Studio 2008 and Visual Studio 2010 CMake generators. 0 means use all
+ processors. Default is 0.</dd>
+</dl>
+
+</div>
+
<!-- *********************************************************************** -->
<hr>
More information about the llvm-commits
mailing list