我想自动构建jansson C库。我如何告诉gradle自动执行此操作。
通常,手动命令对于编译和安装第三方本机库是必需的。是否可以自动编译并安装?
答案 0 :(得分:0)
jansson具有CMakeLists.txt;配置您的app / build.gradle以构建您的本机代码。
android {
...
defaultConfig {...}
buildTypes {...}
// Encapsulates your external native build configurations.
externalNativeBuild {
// Encapsulates your CMake build configurations.
cmake {
// Provides a relative path to your CMake build script.
path "CMakeLists.txt"
}
}
}
https://developer.android.com/studio/projects/gradle-external-native-builds.html#configure-gradle