Issue
I'm using the Android NDK (integrated with CMake and gradle). Currently the C++ Release-Flag is automatically set dependent on the Android Build-Type (Release/Debug). I'd like to compile/link the native code always with the release flag. How can this be done?
Thank you
Solution
Inside the module build.gradle (for example, app/build.gradle), inside android {} block, add:
android {
...
externalNativeBuild {
cmake {
arguments "-DCMAKE_BUILD_TYPE=Release"
}
}
}
This would overwrite the default debug settings as arguments are appended to default settings. Check the generated build files at .externalNativeBuild/cmake/debug/$arch :
- cmake_build_command.txt
- android_gradle_build.json
Answered By - Gerry
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.