Android: Default API level inconsistent between older and newer NDKs
If the Android NDK includes a platforms.cmake
file, the default API level is set to ${NDK_MIN_PLATFORM_LEVEL}
in
https://gitlab.kitware.com/cmake/cmake/-/blob/v3.26.3/Modules/Platform/Android-Determine.cmake#L512
On the other hand, if the Android NDK doesn't include the platforms definition file, a descending list of API levels is created by reversing the sorted list in https://gitlab.kitware.com/cmake/cmake/-/blob/v3.26.3/Modules/Platform/Android-Determine.cmake#L535 and then picking the first element.
The result is that the highest supported API level is picked from old NDKs, but the lowest supported API level is picked from new NDKs. The documentation indicates the behaviour implemented for old NDKs: https://gitlab.kitware.com/cmake/cmake/-/blob/v3.26.3/Help/manual/cmake-toolchains.7.rst?plain=1#L419
In case the behavior described in the documentation is the intended behaviour, ${NDK_MAX_PLATFORM_LEVEL}
needs to be used instead.