diff --git a/csrc/mmdeploy/apis/java/native/CMakeLists.txt b/csrc/mmdeploy/apis/java/native/CMakeLists.txt index 4d93847d40..aad606d74a 100644 --- a/csrc/mmdeploy/apis/java/native/CMakeLists.txt +++ b/csrc/mmdeploy/apis/java/native/CMakeLists.txt @@ -1,7 +1,11 @@ # Copyright (c) OpenMMLab. All rights reserved. project(mmdeploy_java) -find_package(JNI REQUIRED) +if (NOT ANDROID) + find_package(JNI REQUIRED) +else () + set(JNI_LIBRARIES) +endif() mmdeploy_add_library(${PROJECT_NAME} SHARED EXCLUDE mmdeploy_Classifier.cpp @@ -17,6 +21,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE mmdeploy_load_static(${PROJECT_NAME} MMDeployStaticModules) mmdeploy_load_dynamic(${PROJECT_NAME} MMDeployDynamicModules) + target_link_libraries(${PROJECT_NAME} PRIVATE ${JNI_LIBRARIES} MMDeployLibs) install(TARGETS ${PROJECT_NAME} diff --git a/docs/en/01-how-to-build/android.md b/docs/en/01-how-to-build/android.md index ccc0917fb5..6562a78bbf 100644 --- a/docs/en/01-how-to-build/android.md +++ b/docs/en/01-how-to-build/android.md @@ -91,6 +91,12 @@ make install +