Skip to content

Package headers into pip wheel #5734

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 3 commits into from
Closed
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
19 changes: 19 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,25 @@ def run(self):
"devtools/bundled_program/serialize/scalar_type.fbs",
),
]
# Copy all the necessary headers into include/executorch/ so that they can
# be found in the pip package. This is the subset of headers that are
# essential for building custom ops extensions.
# TODO: Use cmake to gather the headers instead of hard-coding them here.
# For example: https://discourse.cmake.org/t/installing-headers-the-modern-
# way-regurgitated-and-revisited/3238/3
for include_dir in [
"runtime/core/",
"runtime/kernel/",
"runtime/platform/",
"extension/kernel_util/",
"extension/tensor/",
"extension/threadpool/",
]:
src_list = Path(include_dir).rglob("*.h")
for src in src_list:
src_to_dst.append(
(str(src), os.path.join("include/executorch", str(src)))
)
for src, dst in src_to_dst:
dst = os.path.join(dst_root, dst)

Expand Down
Loading