Skip to content

Commit

Permalink
Allow specifying cmake setup directory (#1186)
Browse files Browse the repository at this point in the history
Allow specifying cmake directory

Signed-off-by: Ryan Li <[email protected]>
Co-authored-by: Ryan Li <[email protected]>
  • Loading branch information
ryxli and Ryan Li committed Sep 17, 2024
1 parent 528d44b commit 28f95bd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build_tools/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ def run(self) -> None:
if isinstance(ext, CMakeExtension):
print(f"Building CMake extension {ext.name}")
# Set up incremental builds for CMake extensions
setup_dir = Path(__file__).resolve().parent.parent
build_dir = setup_dir / "build" / "cmake"
build_dir = os.getenv("NVTE_CMAKE_BUILD_DIR")
if build_dir:
build_dir = Path(build_dir).resolve()
else:
root_dir = Path(__file__).resolve().parent.parent
build_dir = root_dir / "build" / "cmake"

# Ensure the directory exists
build_dir.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit 28f95bd

Please sign in to comment.