diff options
| author | MonsterDruide1 <5958456@gmail.com> | 2021-08-21 00:58:49 +0200 |
|---|---|---|
| committer | MonsterDruide1 <5958456@gmail.com> | 2021-08-21 00:59:26 +0200 |
| commit | 0b50a1a5d2c7e2616a5b60727b30d64ebd5c2afe (patch) | |
| tree | 0e0dd6bd1e965591c003e065711e248127238eba | |
| parent | 75bdfbd44ec6ec43729fd89b19707d3d6d34aa6a (diff) | |
tools: Add `create_build_dir` to custom `setup.py`
| m--------- | tools/common | 0 | ||||
| -rwxr-xr-x | tools/setup.py | 14 |
2 files changed, 13 insertions, 1 deletions
diff --git a/tools/common b/tools/common -Subproject 7c9a9cb7e4633595f7aab54cd03ed9d7367bc3a +Subproject f4fa8946437071cb79c17ef1d2245e53fe8e4b1 diff --git a/tools/setup.py b/tools/setup.py index 81d467f1..740ae8b5 100755 --- a/tools/setup.py +++ b/tools/setup.py @@ -3,6 +3,7 @@ import argparse import hashlib from pathlib import Path +import subprocess import tempfile import urllib.request from typing import Optional @@ -77,6 +78,17 @@ def prepare_executable(original_nso: Optional[Path]): setup.fail("internal error while preparing executable (missing ELF); please report") +def create_build_dir(): + build_dir = setup.ROOT / "build" + if build_dir.is_dir(): + print(">>> build directory already exists: nothing to do") + return + + subprocess.check_call( + "cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=toolchain/ToolchainNX64.cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -B build/".split(" ")) + print(">>> created build directory") + + def main(): parser = argparse.ArgumentParser( "setup.py", description="Set up the Breath of the Wild decompilation project") @@ -87,7 +99,7 @@ def main(): setup.install_viking() prepare_executable(args.original_nso) setup.set_up_compiler("4.0.1") - setup.create_build_dir() + create_build_dir() if __name__ == "__main__": |
