Skip to content

Commit e245291

Browse files
committed
Try to revert part of #2962
To see if it fixes the Android app
1 parent 4d7dd03 commit e245291

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

extension/android/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,14 @@ if(EXECUTORCH_BUILD_LLAMA_JNI)
5858
add_library(llama_runner STATIC IMPORTED)
5959
set_property(TARGET llama_runner PROPERTY IMPORTED_LOCATION ${LLAMA_RUNNER_PATH})
6060

61+
set(CUSTOM_OPS_LIB_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../examples/models/llama2/custom_ops/libcustom_ops_lib.a)
62+
add_library(custom_ops_lib STATIC IMPORTED)
63+
set_property(TARGET custom_ops_lib PROPERTY IMPORTED_LOCATION ${CUSTOM_OPS_LIB_PATH})
64+
6165
set(CUSTOM_OPS_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../examples/models/llama2/custom_ops/libcustom_ops.a)
6266
add_library(custom_ops STATIC IMPORTED)
6367
set_property(TARGET custom_ops PROPERTY IMPORTED_LOCATION ${CUSTOM_OPS_PATH})
68+
target_link_options_shared_lib(custom_ops_lib)
6469

6570
if(TARGET pthreadpool)
6671
set(LLAMA_JNI_SRCS jni/jni_layer_llama.cpp ../../backends/xnnpack/threadpool/cpuinfo_utils.cpp)
@@ -77,6 +82,6 @@ if(EXECUTORCH_BUILD_LLAMA_JNI)
7782
endif()
7883
target_include_directories(executorch_llama_jni PRIVATE ${_common_include_directories})
7984
target_link_libraries(executorch_llama_jni ${link_libraries} llama_runner
80-
custom_ops cpublas eigen_blas)
85+
custom_ops custom_ops_lib cpublas eigen_blas)
8186
target_compile_options(executorch_llama_jni PUBLIC ${_common_compile_options})
8287
endif()

0 commit comments

Comments
 (0)