CMake 3.7.2 interferes with Android NDK toolchain files.
The Android NDK r13 and later comes with its own CMake toolchain files under build/cmake/android.toolchain.cmake
. Merely setting CMAKE_SYSTEM_NAME
to Android
in CMake 3.7.2 seems to trigger a ton of auto-detect logic, but the toolchain file already sets everything up and picks the compiler.
In particular, when ANDROID_TOOLCHAIN
is clang
(the default), CMake switches it back to GCC and breaks because the flags are still Clang (not to mention overriding the toolchain-set compiler).