Search code examples
preprocessorapportable

How to detect Apportable with preprocessor flags?


This is related to my other question

When I build my project with Apportable, it assumes Linux/Android platform. I think these preprocessor flags are set.

__linux
ANDROID

But, my source code (OpenGL drawing) is not ready for Android, and only for iOS. So I want to detect some preprocessor flag for Apportable (not Linux or Android), and perform some iOS specific processing.

How can I detect Apportable platform in preprocessing stage? (What is pre-defined preprocessor flag for Apportable?)


Solution

  • ANDROID will be defined by the build system, however since the Apportable platform has numerous features that stock Android will not. APPORTABLE is defined to signify builds by the apportable build system.

    You can find additional build flags specific for Apportable builds in

    ~/.apportable/SDK/site_scons/android/ndk.py