#NEWLINE# def parse_num_jobs( self , num_jobs , cmake_generator = None ) : #NEWLINE# #INDENT# ' Convert a number of jobs to a list of cmake args ' #NEWLINE# if ( not cmake_generator ) : #NEWLINE# #INDENT# cmake_generator = qibuild . cmake . get_cached_var ( self . build_directory , 'CMAKE_GENERATOR' ) #NEWLINE# #UNINDENT# if ( num_jobs is None ) : #NEWLINE# #INDENT# if ( 'Visual Studio' in cmake_generator ) : #NEWLINE# #INDENT# return [ '/maxcpucount' ] #NEWLINE# #UNINDENT# return list ( ) #NEWLINE# #UNINDENT# if ( ( 'Unix Makefiles' in cmake_generator ) or ( 'Ninja' in cmake_generator ) ) : #NEWLINE# #INDENT# return [ '-j' , str ( num_jobs ) ] #NEWLINE# #UNINDENT# if ( cmake_generator == 'NMake Makefiles' ) : #NEWLINE# #INDENT# mess = ( '-j is not supported for %s\n' % cmake_generator ) #NEWLINE# mess += 'On Windows, you can use Jom or Ninja instead to compile ' #NEWLINE# mess += 'with multiple processors' #NEWLINE# raise qisys . error . Error ( mess ) #NEWLINE# #UNINDENT# if ( ( cmake_generator == 'Xcode' ) or ( 'JOM' in cmake_generator ) ) : #NEWLINE# #INDENT# ui . warning ( '-j is ignored when used with' , cmake_generator ) #NEWLINE# return list ( ) #NEWLINE# #UNINDENT# if ( 'Visual Studio' in cmake_generator ) : #NEWLINE# #INDENT# return [ ( '/maxcpucount:%i' % num_jobs ) ] #NEWLINE# #UNINDENT# ui . warning ( ( 'Unknown generator: %s, ignoring -j option' % cmake_generator ) ) #NEWLINE# return list ( )