Issue
I see that people do this by changing their Android.mk and Application.mk files. However, I cannot find the file in my project at all. What I wish to do is to optimize the code as much as possible (in Visual Studio, Release mode can be 10x faster than Debug mode). How can I do this in android NDK ?
Thank you.
APP_OPTIM := release
ndk-build NDK_DEBUG=0
-DNDEBUG
LOCAL_CFLAGS += -O2
Solution
If you'd like to specify some options manually only in release configuration, append cppFlags to the relevant section in app/build.gradle as follows.
android {
:
buildTypes {
release {
// debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
externalNativeBuild {
cmake {
cppFlags += "-O2 -DNDEBUG"
}
}
}
}
:
}
Answered By - ardget
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.