Skip to content

Commit

Permalink
Optional build to temp-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Aug 26, 2024
1 parent ab1ff7a commit 158ee69
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def banner(msg: str) -> None:
print("=" * 80)


def build_extension(debug: bool = False) -> None:
def build_extension(debug: bool = False, use_temp_dir: bool = False) -> None:
print("CMakeBuild::build_extension()")

debug = bool(os.environ.get("DEBUG", 0)) or debug
Expand All @@ -37,8 +37,10 @@ def build_extension(debug: bool = False) -> None:
if archs:
cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))]

build_temp = Path(TemporaryDirectory(suffix=".build-temp").name) / "extension_it_in"
# build_temp = Path(".") / "build"
if use_temp_dir:
build_temp = Path(TemporaryDirectory(suffix=".build-temp").name) / "extension_it_in"
else:
build_temp = Path(".") / "build"
# print("cwd:", os.getcwd(), "build-dir:", build_temp, "top:", str(TOP_DIR))
if not build_temp.exists():
build_temp.mkdir(parents=True)
Expand Down

0 comments on commit 158ee69

Please sign in to comment.