Skip to content

Commit

Permalink
Add target_link_options_shared_lib to coremldelegate build
Browse files Browse the repository at this point in the history
Summary: Backends use a static initializer to register themselves. We have an established solution to forcing the Apple linker to load the object files containing said initializer, so let's use it for CoreML.

Test Plan: Attempt to load a CoreML PTE from Python no longer fails with error about the backend not being registered
  • Loading branch information
swolchok committed May 9, 2024
1 parent dd81fc7 commit 2dfc737
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backends/apple/coreml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ target_link_libraries(
${FOUNDATION_FRAMEWORK} ${SQLITE_LIBRARY}
)

target_link_options_shared_lib(coremldelegate)

if(COREML_BUILD_EXECUTOR_RUNNER)
target_link_libraries(
coremldelegate PRIVATE portable_ops_lib portable_kernels
Expand Down

0 comments on commit 2dfc737

Please sign in to comment.