Skip to content

Commit c45b196

Browse files
committed
build inmemoryfs when coreml or pybindings enabled
1 parent 822eb7a commit c45b196

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
@@ -135,6 +135,10 @@ def mps(cls) -> bool:
135135
def xnnpack(cls) -> bool:
136136
return cls._is_cmake_arg_enabled("EXECUTORCH_BUILD_XNNPACK", default=False)
137137

138+
@classmethod
139+
def coreml(cls) -> bool:
140+
return cls._is_env_enabled("EXECUTORCH_BUILD_COREML", default=False)
141+
138142
@classmethod
139143
def training(cls) -> bool:
140144
return cls._is_cmake_arg_enabled(
@@ -833,6 +837,15 @@ def get_ext_modules() -> List[Extension]:
833837
]
834838
)
835839

840+
if ShouldBuild.pybindings() or ShouldBuild.coreml():
841+
ext_modules.append(
842+
BuiltExtension(
843+
src="coreml_inmemoryfs_pybinding.*",
844+
src_dir="backends/apple/coreml",
845+
modpath="executorch.backends.apple.coreml.inmemoryfs",
846+
)
847+
)
848+
836849
if ShouldBuild.pybindings():
837850
ext_modules.append(
838851
# Install the prebuilt pybindings extension wrapper for the runtime,

0 commit comments

Comments
 (0)