Skip to content

Commit

Permalink
Add target_link_options_shared_lib to coremldelegate build (#3556)
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.

Pull Request resolved: #3556

Test Plan: Attempt to load a CoreML PTE from Python no longer fails with error about the backend not being registered

Reviewed By: mikekgfb

Differential Revision: D57136490

Pulled By: swolchok

fbshipit-source-id: 613d7f786fa47f34a94ee4eea7b2a81ef670a573
  • Loading branch information
swolchok authored and facebook-github-bot committed May 10, 2024
1 parent 749f6ab commit c83af25
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 c83af25

Please sign in to comment.