paritytech / rust-rocksdb

rust wrapper for rocksdb
Apache License 2.0
15 stars 23 forks source link

Remove setting CMAKE_BUILD_SYSTEM manually #26

Closed tomaka closed 5 years ago

tomaka commented 5 years ago

(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 3.7, however, did this: (https://cmake.org/cmake/help/v3.7/release/3.7.html#id3)

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.

cc @andresilva