Debug vs. Release builds in the Android NDK

前端 未结 3 1739
一向
一向 2021-02-02 03:01

I\'m working on a large game engine that must be ported to Android. All the code is C/C++, so we are porting via the NDK. I\'ve got everything building, but after lots of scou

相关标签:
3条回答
  • 2021-02-02 03:38

    You're not required to use the Android.mk system to build your .so's. Personally, I use my own Makefile's with the targets I need and this allows for very standardized debug vs. release build specification.

    0 讨论(0)
  • 2021-02-02 03:39

    Do you have different Application.mk files for each target?

    No. Separate subdirectories, all with their own Android.mk (shared and static libs) but only one Application.mk for me.

    My Application.mk is just:

    APP_STL := gnustl_static
    APP_OPTIM := debug
    

    I'm still uncertain what the best method is for building Debug vs. Release versions of our .so file. Changing things by hand every time is getting old.

    It's a bit spread out, for me at least, using the jni/Android.mk + Application.mk layout.

    Application.mk has APP_OPTIM := debug Then in the application element of AndroidManifest.xml I have android:debuggable="true" When you build with ndk-build, it uses this manifest flag to determine optimization (which is useful to turn off or on, off for profiling, etc.)

    (A Little Off topic) I recently ran across

    https://code.google.com/p/android-ndk-profiler/

    Which, when combined with http://code.google.com/p/jrfonseca/wiki/Gprof2Dot

    Generates some pretty images to help my little mind grasp how things are running over on the phone itself.

    0 讨论(0)
  • 2021-02-02 03:44

    I use a single file to build a library for diferent targets. In the Application.mk add this "APP_ABI := armeabi armeabi-v7a" it works for me.

    0 讨论(0)
提交回复
热议问题