Skip to content

Commit d0208d0

Browse files
Varun Purifacebook-github-bot
authored andcommitted
Fix iOS build by excluding external CoreML SDK dependencies (#3043)
Summary: Pull Request resolved: #3043 CoreML delegate SDK integration broke the app build. Getting the SDK integration to work properly internally will require buckifying the third-party targets on which the CoreML delegate SDK itself depends (not to be confused with the third-party dependencies from ET itself). Running the `install_requirements.sh` script (CoreML's, not the generic ET one) clones a bunch of Git repos, XCode-specific tooling, and generates Protobuf headers on which their SDK integration relies. To avoid this, we simply add the `BUILD_SDK` flag and set it to false and disable building the SDK and exclude references to generated headers. Reviewed By: kirklandsign Differential Revision: D55456558 fbshipit-source-id: 6ab931b39298ee0a4a4b238699c64c84952e180e
1 parent 7b375fe commit d0208d0

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

runtime/core/targets.bzl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ def get_event_tracer_flags():
99
event_tracer_flags += ["-DET_EVENT_TRACER_ENABLED"]
1010
return event_tracer_flags
1111

12+
def build_sdk():
13+
return native.read_config("executorch", "build_sdk", "false") == "true"
14+
15+
def get_sdk_flags():
16+
sdk_flags = []
17+
if build_sdk():
18+
sdk_flags += ["-DEXECUTORCH_BUILD_SDK"]
19+
return sdk_flags
20+
1221
def define_common_targets():
1322
"""Defines targets that should be shared between fbcode and xplat.
1423
@@ -92,7 +101,7 @@ def define_common_targets():
92101
"//executorch/...",
93102
"@EXECUTORCH_CLIENTS",
94103
],
95-
exported_preprocessor_flags = get_event_tracer_flags(),
104+
exported_preprocessor_flags = get_event_tracer_flags() + get_sdk_flags(),
96105
exported_deps = [
97106
"//executorch/runtime/platform:platform",
98107
"//executorch/runtime/core:evalue" + aten_suffix,

sdk/targets.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def build_sdk():
2+
return native.read_config("executorch", "build_sdk", "false") == "true"
3+
4+
def get_sdk_flags():
5+
sdk_flags = []
6+
if build_sdk():
7+
sdk_flags += ["-DEXECUTORCH_BUILD_SDK"]
8+
return sdk_flags

0 commit comments

Comments
 (0)