|
|
@@ -17,6 +17,8 @@ BUILD_DIR = PROJECT_ROOT / '_build' |
|
|
|
BOOTSTRAP_DIR = BUILD_DIR / '_bootstrap' |
|
|
|
PREBUILT_DIR = PROJECT_ROOT / '_prebuilt' |
|
|
|
|
|
|
|
EXE_SUFFIX = '.exe' if os.name == 'nt' else '' |
|
|
|
|
|
|
|
|
|
|
|
def _run_quiet(args) -> None: |
|
|
|
cmd = [str(s) for s in args] |
|
|
@@ -44,10 +46,11 @@ def _clone_bootstrap_phase(ph: str) -> None: |
|
|
|
def _build_bootstrap_phase(ph: str, args: argparse.Namespace) -> None: |
|
|
|
print(f'Running build: {ph} (Please wait a moment...)') |
|
|
|
env = os.environ.copy() |
|
|
|
env['DDS_BOOTSTRAP_PREV_EXE'] = PREBUILT_DIR / 'dds' |
|
|
|
env['DDS_BOOTSTRAP_PREV_EXE'] = str(PREBUILT_DIR / 'dds') |
|
|
|
subprocess.check_call( |
|
|
|
[ |
|
|
|
sys.executable, |
|
|
|
'-u', |
|
|
|
str(BOOTSTRAP_DIR / 'tools/build.py'), |
|
|
|
f'--cxx={args.cxx}', |
|
|
|
], |
|
|
@@ -58,7 +61,9 @@ def _build_bootstrap_phase(ph: str, args: argparse.Namespace) -> None: |
|
|
|
def _pull_executable() -> Path: |
|
|
|
prebuild_dir = (PROJECT_ROOT / '_prebuilt') |
|
|
|
prebuild_dir.mkdir(exist_ok=True) |
|
|
|
exe, = list(BOOTSTRAP_DIR.glob('_build/dds*')) |
|
|
|
generated = list(BOOTSTRAP_DIR.glob(f'_build/dds{EXE_SUFFIX}')) |
|
|
|
assert len(generated) == 1, repr(generated) |
|
|
|
exe, = generated |
|
|
|
dest = prebuild_dir / exe.name |
|
|
|
exe.rename(dest) |
|
|
|
return dest |