Skip to content

Commit b033414

Browse files
committed
build inmemoryfs when coreml or pybindings enabled
1 parent a2189cd commit b033414

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ if(EXECUTORCH_BUILD_PYBIND)
811811

812812
if(EXECUTORCH_BUILD_COREML)
813813
list(APPEND _dep_libs coremldelegate)
814+
list(APPEND _dep_libs coreml_inmemoryfs_pybinding)
814815
endif()
815816

816817
if(EXECUTORCH_BUILD_MPS)
@@ -935,6 +936,7 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
935936

936937
if(EXECUTORCH_BUILD_COREML)
937938
list(APPEND _executor_runner_libs coremldelegate)
939+
list(APPEND _executor_runner_libs coreml_inmemoryfs_pybinding)
938940
endif()
939941

940942
add_executable(executor_runner ${_executor_runner__srcs})

setup.py

+13
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ def _is_env_enabled(env_var: str, default: bool = False) -> bool:
8585
def pybindings(cls) -> bool:
8686
return cls._is_env_enabled("EXECUTORCH_BUILD_PYBIND", default=False)
8787

88+
@classmethod
89+
def coreml(cls) -> bool:
90+
return cls._is_env_enabled("EXECUTORCH_BUILD_COREML", default=False)
91+
8892
@classmethod
8993
def training(cls) -> bool:
9094
return cls._is_env_enabled("EXECUTORCH_BUILD_TRAINING", default=False)
@@ -782,6 +786,15 @@ def get_ext_modules() -> List[Extension]:
782786
]
783787
)
784788

789+
if ShouldBuild.pybindings() or ShouldBuild.coreml():
790+
ext_modules.append(
791+
BuiltExtension(
792+
src="coreml_inmemoryfs_pybinding.*",
793+
src_dir="backends/apple/coreml",
794+
modpath="executorch.backends.apple.coreml.inmemoryfs",
795+
)
796+
)
797+
785798
if ShouldBuild.pybindings():
786799
ext_modules.append(
787800
# Install the prebuilt pybindings extension wrapper for the runtime,

0 commit comments

Comments
 (0)