(preamble: it took me around three hours to find out this issue.)
Right now our Parity Android build works because CI uses CMake 3.5.
CMake 3.5 knows that the CMAKE_BUILD_SYSTEM is Android but doesn't do anything more about this information.
CMake now supports Cross Compiling for Android with simple toolchain files.
Now, apparently, when you set CMAKE_BUILD_SYSTEM to Android, it will automatically try to detect the Android NDK using environment variables and pick the compiler, thereby overriding the compiler that the cmake-rs crate sets by passing CMAKE_C_COMPILER.
A regular user of CMake is supposed to pass a bunch of CMAKE_* variables to properly configure the Android NDK detection, but we can't do that. Instead what I propose here is to simply ignore this whole system.
(preamble: it took me around three hours to find out this issue.)
Right now our Parity Android build works because CI uses CMake 3.5. CMake 3.5 knows that the
CMAKE_BUILD_SYSTEM
isAndroid
but doesn't do anything more about this information.CMake 3.7, however, did this: (https://cmake.org/cmake/help/v3.7/release/3.7.html#id3)
Now, apparently, when you set
CMAKE_BUILD_SYSTEM
toAndroid
, it will automatically try to detect the Android NDK using environment variables and pick the compiler, thereby overriding the compiler that thecmake-rs
crate sets by passingCMAKE_C_COMPILER
. A regular user of CMake is supposed to pass a bunch ofCMAKE_*
variables to properly configure the Android NDK detection, but we can't do that. Instead what I propose here is to simply ignore this whole system.cc @andresilva