android_app { name: "DesensitiseJNI", srcs: ["**/*.java"], sdk_version: "current", jni_libs: ["libDesensitisejni"], } // Build JNI Shared Library cc_library_shared { name: "libDesensitisejni", cflags: [ "-Werror", "-Wno-error=unused-parameter", ], include_dirs: ["."], srcs: ["jni/Jni_Desensitis.cpp"], shared_libs: [ "libEGL", "libGLESv2", "libjpeg", "libprotobuf", "libTSDesensitizationAlgorithm", "libecarx_engine", ], sdk_version: "current", arch: { arm: { instruction_set: "arm", }, }, }转为CMake
时间: 2023-07-19 08:32:53 浏览: 438
以下是将上述 Android.mk 转换为 CMakeLists.txt 的示例:
```
cmake_minimum_required(VERSION 3.4.1)
add_library(DesensitiseJNI SHARED
src/main/java/com/example/DesensitiseJNI.java
jni/Jni_Desensitis.cpp)
target_include_directories(DesensitiseJNI PRIVATE .)
target_link_libraries(DesensitiseJNI
libEGL
libGLESv2
libjpeg
libprotobuf
libTSDesensitizationAlgorithm
libecarx_engine)
target_compile_options(DesensitiseJNI PRIVATE
-Werror
-Wno-error=unused-parameter)
set_target_properties(DesensitiseJNI PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED ON)
# Set the ABI for the library
set_target_properties(DesensitiseJNI PROPERTIES
ANDROID_ARM_MODE "arm")
```
请注意,这只是一个示例,你需要根据你的项目结构和需要进行适当的修改。
阅读全文