Search code examples
androidandroid-ndkndk-build

How can I get the NDK version during compile time?


I've searched and it seems that at some point __NDK_MAJOR__ was at least proposed but at least as of NDK 15c it doesn't seem to be set.

Is there a way within the preprocessor to determine the NDK version being used to build from source?


Solution

  • It's in r16. If you need to know the version before then, you'll need to parse the $NDK/source.properties file and pass it as a define to your code as part of your build system.