Skip to content

Commit 9bbbbe5

Browse files
authored
Allow android C compile to fail (#425)
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
1 parent 5fc4f79 commit 9bbbbe5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

build.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ fn main() {
1010
}
1111

1212
fn build_android() {
13-
let expansion = cc::Build::new().file("src/android-api.c").expand();
13+
let expansion = match cc::Build::new().file("src/android-api.c").try_expand() {
14+
Ok(result) => result,
15+
Err(e) => {
16+
println!("failed to run C compiler: {}", e);
17+
return;
18+
}
19+
};
1420
let expansion = match std::str::from_utf8(&expansion) {
1521
Ok(s) => s,
1622
Err(_) => return,

0 commit comments

Comments
 (0)