()
| 656 | |
| 657 | |
| 658 | def main(): |
| 659 | parser = argparse.ArgumentParser() |
| 660 | subcommands = parser.add_subparsers(dest="subcommand") |
| 661 | |
| 662 | install_emscripten_cmd = subcommands.add_parser( |
| 663 | "install-emscripten", |
| 664 | help="Install the appropriate version of Emscripten", |
| 665 | ) |
| 666 | |
| 667 | build = subcommands.add_parser("build", help="Build everything") |
| 668 | build.add_argument( |
| 669 | "target", |
| 670 | nargs="?", |
| 671 | default="all", |
| 672 | choices=["all", "host", "build"], |
| 673 | help=( |
| 674 | "What should be built. 'build' for just the build platform, or " |
| 675 | "'host' for the host platform, or 'all' for both. Defaults to 'all'." |
| 676 | ), |
| 677 | ) |
| 678 | |
| 679 | configure_build = subcommands.add_parser( |
| 680 | "configure-build-python", help="Run `configure` for the build Python" |
| 681 | ) |
| 682 | |
| 683 | make_mpdec_cmd = subcommands.add_parser( |
| 684 | "make-mpdec", |
| 685 | help="Clone mpdec repo, configure and build it for emscripten", |
| 686 | ) |
| 687 | |
| 688 | make_libffi_cmd = subcommands.add_parser( |
| 689 | "make-libffi", |
| 690 | help="Clone libffi repo, configure and build it for emscripten", |
| 691 | ) |
| 692 | |
| 693 | make_dependencies_cmd = subcommands.add_parser( |
| 694 | "make-dependencies", |
| 695 | help="Build all static library dependencies", |
| 696 | ) |
| 697 | |
| 698 | for cmd in [make_mpdec_cmd, make_libffi_cmd, make_dependencies_cmd]: |
| 699 | cmd.add_argument( |
| 700 | "--check-up-to-date", |
| 701 | action="store_true", |
| 702 | default=False, |
| 703 | help=("If passed, will fail if dependency is out of date"), |
| 704 | ) |
| 705 | |
| 706 | make_build = subcommands.add_parser( |
| 707 | "make-build-python", help="Run `make` for the build Python" |
| 708 | ) |
| 709 | |
| 710 | configure_host = subcommands.add_parser( |
| 711 | "configure-host", |
| 712 | help=( |
| 713 | "Run `configure` for the host/emscripten " |
| 714 | "(pydebug builds are inferred from the build Python)" |
| 715 | ), |
no test coverage detected
searching dependent graphs…