executorch icon indicating copy to clipboard operation
executorch copied to clipboard

[CMake] When should we use static lib and when shared

Open kirklandsign opened this issue 8 months ago • 1 comments

🐛 Describe the bug

We can definitely split backends and ops into its own .so library.

Right now we don't have a clear guideline when to use which.

We also have something like

 if(CMAKE_TOOLCHAIN_IOS
    OR CMAKE_TOOLCHAIN_ANDROID
    OR APPLE
 )

repeating.

Versions

main a325c56864c5b25630c1ebda03c8f16a96a02a19

cc @larryliu0820 @jathu

kirklandsign avatar Apr 25 '25 02:04 kirklandsign

for android my suggestion is

shared: executorch xyz_ops_lib (+ _kernel)? xyz_backend

remaining static

kirklandsign avatar Apr 25 '25 18:04 kirklandsign