Skip to content

Commit

Permalink
Allow android C compile to fail (#425)
Browse files Browse the repository at this point in the history
A C compiler hasn't been required historically, so let's assume we don't
know the API version if the C compiler fails.

Closes #424
  • Loading branch information
alexcrichton authored May 7, 2021
1 parent 5fc4f79 commit 9bbbbe5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ fn main() {
}

fn build_android() {
let expansion = cc::Build::new().file("src/android-api.c").expand();
let expansion = match cc::Build::new().file("src/android-api.c").try_expand() {
Ok(result) => result,
Err(e) => {
println!("failed to run C compiler: {}", e);
return;
}
};
let expansion = match std::str::from_utf8(&expansion) {
Ok(s) => s,
Err(_) => return,
Expand Down

0 comments on commit 9bbbbe5

Please sign in to comment.