mirror of https://github.com/zeldaret/botw.git
Merge pull request #61 from MonsterDruide1/master
tools: Add `create_build_dir` to custom `setup.py`
This commit is contained in:
commit
ad9b3e8a42
|
@ -1 +1 @@
|
|||
Subproject commit 7c9a9cb7e4633595f7aab54cd03ed9d7367bc3a1
|
||||
Subproject commit f4fa8946437071cb79c17ef1d2245e53fe8e4b10
|
|
@ -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__":
|
||||
|
|
Loading…
Reference in New Issue