Skip to content

Commit

Permalink
[Fix] Fix android build (#698)
Browse files Browse the repository at this point in the history
* fix android build

* fix cmake

* fix url link
  • Loading branch information
hanrui1sensetime authored Jul 7, 2022
1 parent 69c38b9 commit d57cf85
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion csrc/mmdeploy/apis/java/native/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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}
Expand Down
6 changes: 6 additions & 0 deletions docs/en/01-how-to-build/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ make install
</code></pre>
</td>
</tr>
<tr>
<td>OpenJDK </td>
<td>It is necessary for building Java API.</br>
See <a href='https://github.com/open-mmlab/mmdeploy/blob/master/csrc/mmdeploy/apis/java/README.md'> Java API build </a> for building tutorials.
</td>
</tr>
</tbody>
</table>

Expand Down
6 changes: 6 additions & 0 deletions docs/zh_cn/01-how-to-build/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ make install
</code></pre>
</td>
</tr>
<tr>
<td>OpenJDK </td>
<td>编译Java API之前需要先准备OpenJDK开发环境</br>
请参考 <a href='https://github.com/open-mmlab/mmdeploy/blob/master/csrc/mmdeploy/apis/java/README.md'> Java API 编译 </a> 进行构建.
</td>
</tr>
</tbody>
</table>

Expand Down

0 comments on commit d57cf85

Please sign in to comment.