Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env python3
  2. import argparse
  3. import os
  4. from pathlib import Path
  5. from typing import Sequence
  6. import sys
  7. import shutil
  8. from dds_ci import paths
  9. from self_build import self_build
  10. ROOT = Path(__file__).parent.parent.absolute()
  11. BUILD_DIR = ROOT / '_build'
  12. def main(argv: Sequence[str]) -> int:
  13. # Prior versions of this script took a --cxx argument, but we don't care anymore
  14. parser = argparse.ArgumentParser()
  15. parser.add_argument('--cxx', help=argparse.SUPPRESS)
  16. parser.parse_args(argv)
  17. dds_bootstrap_env_key = 'DDS_BOOTSTRAP_PREV_EXE'
  18. if dds_bootstrap_env_key not in os.environ:
  19. raise RuntimeError('A previous-phase bootstrapped executable '
  20. 'must be available via $DDS_BOOTSTRAP_PREV_EXE')
  21. dds_exe = Path(os.environ[dds_bootstrap_env_key])
  22. if BUILD_DIR.exists():
  23. shutil.rmtree(BUILD_DIR)
  24. print(f'Using previously built DDS executable: {dds_exe}')
  25. if os.name == 'nt':
  26. tc_fpath = ROOT / 'tools/msvc.jsonc'
  27. elif sys.platform.startswith('freebsd'):
  28. tc_fpath = ROOT / 'tools/freebsd-gcc-9.jsonc'
  29. else:
  30. tc_fpath = ROOT / 'tools/gcc-9.jsonc'
  31. self_build(dds_exe,
  32. cat_json_path=ROOT / 'catalog.old.json',
  33. toolchain=str(tc_fpath))
  34. return 0
  35. if __name__ == "__main__":
  36. sys.exit(main(sys.argv[1:]))