If you
android { defaultConfig { ndk { moduleName "yourlib" stl "stlport_static" ldLibs "log", "z", "m" cFlags "-I/some/include/dir/" } ... } ... }
in your build.gradle, then Gradle will compile the files in src / main / jni / and it will generate Android.mk in the build / ndk / debug / Android.mk file.
However, in my case, I am trying to compile some C ++ files compiled with OpenCV.
This works for me when I manually create the Android.mk file and run the ndk-build command. But I want to do this through Gradle / Android Studio automatically.
When you do this manually, I include libraries for links. I do this in manually created Android.mk using the line:
include /path/to/the/opencv/directory/sdk/native/jni/OpenCV.mk
However, in the Android Gradle plugin, I'm not sure how to add this include directive to the generated Android.mk file.
Can someone point me in the right direction of Gradle-directive to add this line to the file file? Thanks.
android opencv android-ndk gradle
newfivefour
source share