@@ -305,25 +305,26 @@ def build_on_mac(args: argparse.Namespace) -> None:
305
305
if not qt_src_dir .exists ():
306
306
raise FileNotFoundError ('Could not find qt_src_dir=%s' % qt_src_dir )
307
307
308
- jobs = os .cpu_count () * 2
309
- os .environ ['MAKEFLAGS' ] = '--jobs=%s' % jobs
310
308
os .chdir (qt_src_dir )
311
309
312
- commands = ['./configure' ] + make_configure_options (args )
310
+ configure_cmds = ['./configure' ] + make_configure_options (args )
311
+ build_cmds = ['make' , '--jobs=%s' % (os .cpu_count () * 2 )]
312
+ install_cmds = ['make' , 'install' ]
313
313
if args .dryrun :
314
- print (f'dryrun: run_or_die({ commands } )' )
315
- print ('dryrun: make ' )
314
+ print (f'dryrun: run_or_die({ configure_cmds } )' )
315
+ print ('dryrun: run_or_die({build_cmds}) ' )
316
316
if qt_src_dir != qt_dest_dir :
317
317
if qt_dest_dir .exists ():
318
318
print (f'dryrun: delete { qt_dest_dir } ' )
319
- print ('dryrun: make install ' )
319
+ print ('dryrun: run_or_die({install_cmds}) ' )
320
320
else :
321
- run_or_die (commands )
322
- run_or_die (['make' ])
321
+ run_or_die (configure_cmds )
322
+
323
+ run_or_die (build_cmds )
323
324
if qt_src_dir != qt_dest_dir :
324
325
if qt_dest_dir .exists ():
325
326
shutil .rmtree (qt_dest_dir )
326
- run_or_die ([ 'make' , 'install' ] )
327
+ run_or_die (install_cmds )
327
328
328
329
329
330
def get_vcvarsall (path_hint : Union [str , None ] = None ) -> pathlib .Path :
@@ -437,12 +438,13 @@ def build_on_windows(args: argparse.Namespace) -> None:
437
438
438
439
options = make_configure_options (args )
439
440
configs = ' ' .join (options )
440
- command = f'configure.bat { configs } '
441
+ configure_cmds = f'configure.bat { configs } '
441
442
if args .dryrun :
442
- print (f"dryrun: subprocess.run('{ command } ', shell=True, check=True,"
443
- f' cwd={ qt_src_dir } , env={ env } )' )
443
+ print (f"dryrun: subprocess.run('{ configure_cmds } ', shell=True, check=True,"
444
+ f' cwd={ configure_cmds } , env={ env } )' )
444
445
else :
445
- subprocess .run (command , shell = True , check = True , cwd = qt_src_dir , env = env )
446
+ subprocess .run (configure_cmds , shell = True , check = True , cwd = qt_src_dir ,
447
+ env = env )
446
448
447
449
# In order not to expose internal build path, replace paths in qconfig.cpp,
448
450
# which have been embedded by configure.exe based on the build directory.
@@ -454,20 +456,22 @@ def build_on_windows(args: argparse.Namespace) -> None:
454
456
args .dryrun )
455
457
456
458
jom = qt_src_dir .joinpath ('jom.exe' )
459
+ build_cmds = [str (jom )]
460
+ install_cmds = [str (jom ), 'install' ]
457
461
if args .dryrun :
458
- print (f'dryrun: subprocess.run(str( { jom } ) , shell=True, check=True,'
462
+ print (f'dryrun: subprocess.run({ build_cmds } , shell=True, check=True,'
459
463
f' cwd={ qt_src_dir } , env={ env } )' )
460
464
if qt_src_dir != qt_dest_dir :
461
465
if qt_dest_dir .exists ():
462
466
print (f'dryrun: delete { qt_dest_dir } ' )
463
- print (f" dryrun: subprocess.run([str( { jom } ), 'install'], shell=True,"
464
- f" check=True, cwd={ qt_src_dir } , env={ env } )" )
467
+ print (f' dryrun: subprocess.run({ install_cmds } , shell=True,'
468
+ f' check=True, cwd={ qt_src_dir } , env={ env } )' )
465
469
else :
466
- subprocess .run (str ( jom ) , shell = True , check = True , cwd = qt_src_dir , env = env )
470
+ subprocess .run (build_cmds , shell = True , check = True , cwd = qt_src_dir , env = env )
467
471
if qt_src_dir != qt_dest_dir :
468
472
if qt_dest_dir .exists ():
469
473
shutil .rmtree (qt_dest_dir )
470
- subprocess .run ([ str ( jom ), 'install' ] , shell = True , check = True ,
474
+ subprocess .run (install_cmds , shell = True , check = True ,
471
475
cwd = qt_src_dir , env = env )
472
476
473
477
0 commit comments