diff --git a/BUILDING.md b/BUILDING.md index b5bab72e1..7de129485 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -58,6 +58,9 @@ Note in particular that if you are cross-compiling an x86 build on a 64-bit version of Linux, then you need to have the proper gcc-multilibs and g++-multilibs packages or equivalent installed. +On Android, you will need to define the `__ANDROID_API__` constant to at least +`21` on 64-bit and `18` on 32-bit. + Additional Features that are Useful for Development diff --git a/build.rs b/build.rs index a469e19b7..97f5bce8b 100644 --- a/build.rs +++ b/build.rs @@ -571,17 +571,6 @@ fn cc(file: &Path, ext: &str, target: &Target, warnings_are_errors: bool, // http://www.openwall.com/lists/musl/2015/06/17/1 let _ = c.flag("-U_FORTIFY_SOURCE"); } - if target.os() == "android" { - // 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 - 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(); let _ = c.arg("-c")