Skip to content

Extend setup cmake ability #3349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ fi

# Parse options.
EXECUTORCH_BUILD_PYBIND=OFF
CMAKE_ARGS=""

for arg in "$@"; do
case $arg in
Expand Down Expand Up @@ -110,4 +109,5 @@ $PIP_EXECUTABLE install --extra-index-url "${TORCH_NIGHTLY_URL}" \

EXECUTORCH_BUILD_PYBIND="${EXECUTORCH_BUILD_PYBIND}" \
CMAKE_ARGS="${CMAKE_ARGS}" \
CMAKE_BUILD_ARGS="${CMAKE_BUILD_ARGS}" \
$PIP_EXECUTABLE install . --no-build-isolation -v
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,14 @@ def run(self):
if "CMAKE_ARGS" in os.environ:
cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item]

# Allow adding extra build args through the environment. Used by some
# tests and demos to expand the set of targets included in the pip
# package.
if "CMAKE_BUILD_ARGS" in os.environ:
build_args += [
item for item in os.environ["CMAKE_BUILD_ARGS"].split(" ") if item
]

# Put the cmake cache under the temp directory, like
# "pip-out/temp.<plat>/cmake-out".
cmake_cache_dir = os.path.join(repo_root, self.build_temp, "cmake-out")
Expand Down