Skip to content

Commit a29d425

Browse files
committed
[RELEASE ONLY] Android custom op registration
1 parent ed23bc0 commit a29d425

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

extension/android/CMakeLists.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ if(EXECUTORCH_BUILD_LLAMA_JNI)
6161
set(CUSTOM_OPS_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../examples/models/llama2/custom_ops/libcustom_ops.a)
6262
add_library(custom_ops STATIC IMPORTED)
6363
set_property(TARGET custom_ops PROPERTY IMPORTED_LOCATION ${CUSTOM_OPS_PATH})
64+
target_link_options_shared_lib(custom_ops)
65+
66+
set(CUSTOM_OPS_LIB_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../examples/models/llama2/custom_ops/libcustom_ops_lib.a)
67+
add_library(custom_ops_lib STATIC IMPORTED)
68+
set_property(TARGET custom_ops_lib PROPERTY IMPORTED_LOCATION ${CUSTOM_OPS_LIB_PATH})
69+
target_link_options_shared_lib(custom_ops_lib)
6470

6571
if(TARGET pthreadpool)
6672
set(LLAMA_JNI_SRCS jni/jni_layer_llama.cpp ../../backends/xnnpack/threadpool/cpuinfo_utils.cpp)
@@ -77,6 +83,6 @@ if(EXECUTORCH_BUILD_LLAMA_JNI)
7783
endif()
7884
target_include_directories(executorch_llama_jni PRIVATE ${_common_include_directories})
7985
target_link_libraries(executorch_llama_jni ${link_libraries} llama_runner
80-
custom_ops cpublas eigen_blas)
86+
custom_ops custom_ops_lib cpublas eigen_blas)
8187
target_compile_options(executorch_llama_jni PUBLIC ${_common_compile_options})
8288
endif()

0 commit comments

Comments
 (0)