Skip to content

Commit

Permalink
Define Android API level needed for AArch64.
Browse files Browse the repository at this point in the history
  • Loading branch information
pietro authored and briansmith committed Jan 26, 2018
1 parent 7e81996 commit 72397df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 72397df

Please sign in to comment.