From 432e5bae08ccfb61c1f75bfd9dc144d5c61fe266 Mon Sep 17 00:00:00 2001 From: Thibaut Lorrain Date: Tue, 3 Oct 2023 14:48:21 +0200 Subject: [PATCH] Fix cross compilation on android armv7 and x86 This fixes the following cmake errors ``` Android: Unknown processor CMAKE_SYSTEM_PROCESSOR='x86'. ``` and ``` Android: Unknown processor CMAKE_SYSTEM_PROCESSOR='arm'. ``` when crosscompiling for `i686-linux-android` and `armv7-linux-androideabi` android targets fixes #175 --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 035cead..425ac0d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -458,6 +458,8 @@ impl Config { // CMAKE_SYSTEM_PROCESSOR // some of the values come from https://en.wikipedia.org/wiki/Uname let (system_name, system_processor) = match (os.as_str(), arch.as_str()) { + ("android", "arm") => ("Android", "armv7-a"), + ("android", "x86") => ("Android", "i686"), ("android", arch) => ("Android", arch), ("dragonfly", arch) => ("DragonFly", arch), ("macos", "x86_64") => ("Darwin", "x86_64"),