You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.4KB

  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. from self_deps_get import self_deps_get
  11. from self_deps_build import self_deps_build
  12. ROOT = Path(__file__).parent.parent.absolute()
  13. BUILD_DIR = ROOT / '_build'
  14. def main(argv: Sequence[str]) -> int:
  15. # Prior versions of this script took a --cxx argument, but we don't care anymore
  16. parser = argparse.ArgumentParser()
  17. parser.add_argument('--cxx', help=argparse.SUPPRESS)
  18. parser.parse_args(argv)
  19. dds_bootstrap_env_key = 'DDS_BOOTSTRAP_PREV_EXE'
  20. if dds_bootstrap_env_key not in os.environ:
  21. raise RuntimeError('A previous-phase bootstrapped executable '
  22. 'must be available via $DDS_BOOTSTRAP_PREV_EXE')
  23. dds_exe = Path(os.environ[dds_bootstrap_env_key])
  24. if BUILD_DIR.exists():
  25. shutil.rmtree(BUILD_DIR)
  26. print(f'Using previously built DDS executable: {dds_exe}')
  27. self_deps_get(dds_exe, paths.SELF_TEST_REPO_DIR)
  28. if os.name == 'nt':
  29. tc_fpath = ROOT / 'tools/msvc.dds'
  30. else:
  31. tc_fpath = ROOT / 'gcc-9.dds'
  32. self_deps_build(dds_exe, str(tc_fpath), paths.SELF_TEST_REPO_DIR,
  33. ROOT / 'remote.dds')
  34. self_build(dds_exe, toolchain=str(tc_fpath), dds_flags=['--apps'])
  35. return 0
  36. if __name__ == "__main__":
  37. sys.exit(main(sys.argv[1:]))