@@ -123,6 +123,11 @@ def main():
123123 default = USE_REGISTRY ,
124124 help = ('Command or path to WinRAR\' s "winrar.exe" binary. If "_use_registry" is '
125125 'specified, determine the path from the registry. Default: %(default)s' ))
126+ parser .add_argument (
127+ '-j' ,
128+ type = int ,
129+ dest = 'thread_count' ,
130+ help = ('Number of CPU threads to use for compiling' ))
126131 parser .add_argument (
127132 '--ci' ,
128133 action = 'store_true'
@@ -300,16 +305,25 @@ def main():
300305 sys .executable ,
301306 'tools\\ rust\\ build_bindgen.py' , '--skip-test' )
302307
308+ # Ninja commandline
309+ ninja_commandline = ['third_party\\ ninja\\ ninja.exe' ]
310+ if args .thread_count is not None :
311+ ninja_commandline .append ('-j' )
312+ ninja_commandline .append (args .thread_count )
313+ ninja_commandline .append ('-C' )
314+ ninja_commandline .append ('out\\ Default' )
315+ ninja_commandline .append ('chrome' )
316+ ninja_commandline .append ('chromedriver' )
317+ ninja_commandline .append ('mini_installer' )
318+
303319 # Run ninja
304320 if args .ci :
305- _run_build_process_timeout ('third_party\\ ninja\\ ninja.exe' , '-C' , 'out\\ Default' , 'chrome' ,
306- 'chromedriver' , 'mini_installer' , timeout = 3.5 * 60 * 60 )
321+ _run_build_process_timeout (* ninja_commandline , timeout = 3.5 * 60 * 60 )
307322 # package
308323 os .chdir (_ROOT_DIR )
309324 subprocess .run ([sys .executable , 'package.py' ])
310325 else :
311- _run_build_process ('third_party\\ ninja\\ ninja.exe' , '-C' , 'out\\ Default' , 'chrome' ,
312- 'chromedriver' , 'mini_installer' )
326+ _run_build_process (* ninja_commandline )
313327
314328
315329if __name__ == '__main__' :
0 commit comments