From 72397dfa71078a6ccc492c2882db8081e0586826 Mon Sep 17 00:00:00 2001 From: Pietro Monteiro Date: Fri, 26 May 2017 11:16:57 -0700 Subject: [PATCH] Define Android API level needed for AArch64. --- build.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 9ce43c8a9c..5df8a56f3e 100644 --- a/build.rs +++ b/build.rs @@ -593,7 +593,12 @@ fn cc(file: &Path, ext: &str, target: &Target, warnings_are_errors: bool, // Define __ANDROID_API__ to the Android API level we want. // Needed for Android NDK Unified Headers, see: // https://android.googlesource.com/platform/ndk/+/master/docs/UnifiedHeaders.md#Supporting-Unified-Headers-in-Your-Build-System - let _ = c.define("__ANDROID_API__", Some("18")); + if target.arch() == "aarch64" { + // Minimum API level where AArch64 is available is 21. + let _ = c.define("__ANDROID_API__", Some("21")); + } else { + let _ = c.define("__ANDROID_API__", Some("18")); + } } let mut c = c.get_compiler().to_command();