Merged requested to merge jightuse/cmake:master into master
!5862 (merged), the previous fix for #21772 (closed), doesn't work with typical android toolchain file, like this one:
The condition fails to work when CMAKE_ANDROID_NDK_VERSION is undefined: second part evaluates to true, although ndk version is not known.
I've encountered following environment where CMAKE_ANDROID_NDK_VERSION is used without definition:
- Build uses android toolchain file, which sets CMAKE_SYSTEM_VERSION=1 and doesn't set CMAKE_ANDROID_NDK_VERSION.
- Code in Platform/Android-Determine.cmake exits early when it detects toolchain usage (via value CMAKE_SYSTEM_VERSION=1). This file is the only place in cmake modules where variable CMAKE_ANDROID_NDK_VERSION is set, and by early return we skip this definition.