Question

We have a setup where our Android game contains a few native libraries that get built using ndk-build.

Our project contains the following structure:

Root
 |
 |-- jni
      |
      |-- Android.mk   // $include ( lib.mk ) and ( photon/photon.mk)
      |-- lib.mk
      |-- photon
            |
            |----- photon.mk
            |----- debug_android_armeabi.mk
            |----- release_android_armeabi.mk

One of the libs that get built (Photon) comes with 2 additional makefiles besides its main one - one for debug and one for release.

My question is - how can i pass this info to ndk-build such that the correct additional mk file will be picked up when building?

Was it helpful?

Solution

Probably, your photon.mk looks like

...
ifdef DEBUG
  include debug_android_armeabi.mk
else
  include release_android_armeabi.mk
endif
...

This way you can simply use

ndk-build DEBUG=1

If you want to lean on the ndk official features for release/debug build, you may prefer

...
ifeq ($(APP_OPTIM),debug)
  include debug_android_armeabi.mk
else
  include release_android_armeabi.mk
endif
...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top