I created an Android project using jni. Now I want to use preprocessor macros to distinguish between the lite and the full version. It should look like this:
#ifdef LITE
auto label = LabelTTF::create("Hello Cocos2dx Lite", "Arial", 24);
#else
auto label = LabelTTF::create("Hello Cocos2dx Full", "Arial", 24);
#endif
For this I defined a variable in APP_CPPFLAGS within Android.mk like this:
APP_CPPFLAGS += -DLITE
Unfortunately the app completely ignores it and I still see the label "Hello Cocos2dx Full". However the same line works when I put it in the Application.mk.
APP_CPPFLAGS
and all other APP_ make variables should be set in Application.mk. For changes per module, use LOCAL_CPPFLAGS
or LOCAL_CFLAGS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With