diff --git a/CMakeLists.txt b/CMakeLists.txt index cf89adb..b39ad92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,9 @@ else() set_target_properties(llm PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) target_link_libraries(llm MNN MNN_Express) + if (MNN_OPENCL) + target_link_libraries(llm MNN_CL) + endif() if (LLM_SUPPORT_VISION) target_link_libraries(llm MNNOpenCV) endif() @@ -122,10 +125,13 @@ else() list(APPEND LLM_LIBS $) list(APPEND LLM_LIBS $) if (LLM_SUPPORT_VISION) - list(APPEND LLM_LIBS $) + #list(APPEND LLM_LIBS $) + endif() + if (MNN_OPENCL) + list(APPEND LLM_LIBS $) endif() add_custom_command(TARGET llm POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${LLM_LIBS} - ${CMAKE_CURRENT_LIST_DIR}/android/app/src/main/jni/libs) + ${CMAKE_CURRENT_LIST_DIR}/android/app/src/main/jni/libs/arm64-v8a) endif() \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 0e71327..88e2a4e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -12,7 +12,7 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { - arguments "-DBUILD_JNI=TRUE", "-DANDROID_STL=c++_shared", "-DLLM_SUPPORT_VISION=TRUE" + arguments "-DBUILD_JNI=TRUE", "-DANDROID_STL=c++_shared", "-DLLM_SUPPORT_VISION=TRUE", "-DMNN_OPENCL=TRUE" abiFilters 'arm64-v8a' } }