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
2 people authored and ptrendx committed Sep 27, 2024
1 parent 9b9a75a commit 4041897
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 4041897

Please sign in to comment.