Skip to content

Android: add support for native compilation, such as with the Termux app

B Face requested to merge buttaface/cmake:android into master

The CMake support for Android assumes cross-compilation using the NDK, so stub out that Android NDK support and use the Linux support that's already invoked. Set CMAKE_HOST_SYSTEM_NAME to "Android", rather than "Linux".

I've used this patch to build large CMake projects like LLVM, Clang, and Swift on an Android host, along with building CMake itself (though that required using the cross-compiled CMake Termux package to build CMake from source on my Android device, as the autotools approach didn't work).

This is my first time patching CMake, so any feedback is appreciated.

Fixes: #19840 (closed)
Topic-rename: android-native

Edited by Brad King

Merge request reports