更新时间:2023-09-26 10:53:58
默认情况下,Android Studio IDE 与 CMake 和 Gradle 一起会生成一系列以 externalNative
命名的原生构建任务根据您的构建类型和风格.如果你想扭转这种行为,一些解决方法如下:
By default, Android Studio IDE together with CMake and Gradle will generate a series of native build tasks named with externalNative<BuildVariant>Build
according to your build types and flavours. If you want to twist this behaviour, some workaround is as below:
共享原生
.对于此解决方案,您需要考虑以下几点:
For this solution, you need to consider below points:
.so
文件放到其他项目可以看到和链接的适当位置.shared-native
模块项目包含debug
和release
构建类型,以避免多次重新构建.或者您可以简单地让您的其他项目依赖于发布类型,以便它只构建ONCE..so
files into a proper location that other projects can see and link with. debug
and release
build types for this shared-native
module project to avoid too many times of re-build. Or you can simply to let your other projects depends on the release type so that it will be built only ONCE.