+# On Win32 using MS tools, provide an option to set the number of parallel jobs
+# to use.
+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()
+ 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()
+