@@ -413,6 +413,11 @@ def make_mpdec(context, working_dir):
413413 write_library_config (prefix , "mpdec" , mpdec_config , context .quiet )
414414
415415
416+ def make_dependencies (context ):
417+ make_emscripten_libffi (context )
418+ make_mpdec (context )
419+
420+
416421def calculate_node_path ():
417422 node_version = os .environ .get ("PYTHON_NODE_VERSION" , None )
418423 if node_version is None :
@@ -573,7 +578,10 @@ def run_emscripten_python(context):
573578 if args and args [0 ] == "--" :
574579 args = args [1 :]
575580
576- os .execv (str (exec_script ), [str (exec_script )] + args )
581+ if context .test :
582+ args = load_config_toml ()["test-args" ] + args
583+
584+ os .execv (str (exec_script ), [str (exec_script ), * args ])
577585
578586
579587def build_target (context ):
@@ -665,6 +673,11 @@ def main():
665673 help = "Clone libffi repo, configure and build it for emscripten" ,
666674 )
667675
676+ make_dependencies_cmd = subcommands .add_parser (
677+ "make-dependencies" ,
678+ help = "Build all static library dependencies" ,
679+ )
680+
668681 make_build = subcommands .add_parser (
669682 "make-build-python" , help = "Run `make` for the build Python"
670683 )
@@ -685,6 +698,15 @@ def main():
685698 "run" ,
686699 help = "Run the built emscripten Python" ,
687700 )
701+ run .add_argument (
702+ "--test" ,
703+ action = "store_true" ,
704+ default = False ,
705+ help = (
706+ "If passed, will add the default test arguments to the beginning of the command. "
707+ "Default arguments loaded from Platforms/emscripten/config.toml"
708+ )
709+ )
688710 run .add_argument (
689711 "args" ,
690712 nargs = argparse .REMAINDER ,
@@ -694,6 +716,7 @@ def main():
694716 )
695717 )
696718 add_cross_build_dir_option (run )
719+
697720 clean = subcommands .add_parser (
698721 "clean" , help = "Delete files and directories created by this script"
699722 )
@@ -714,6 +737,7 @@ def main():
714737 configure_build ,
715738 make_libffi_cmd ,
716739 make_mpdec_cmd ,
740+ make_dependencies_cmd ,
717741 make_build ,
718742 configure_host ,
719743 make_host ,
@@ -781,6 +805,7 @@ def main():
781805 "install-emscripten" : install_emscripten ,
782806 "make-libffi" : make_emscripten_libffi ,
783807 "make-mpdec" : make_mpdec ,
808+ "make-dependencies" : make_dependencies ,
784809 "configure-build-python" : configure_build_python ,
785810 "make-build-python" : make_build_python ,
786811 "configure-host" : configure_emscripten_python ,
0 commit comments