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 Jun 8, 2017
1 parent 06da374 commit 759f1cc
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 @@ -614,7 +614,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 759f1cc

Please sign in to comment.