Skip to content
This repository was archived by the owner on Feb 26, 2020. It is now read-only.

Commit 1df89dd

Browse files
committed
fix(android): set CC=arm-linux-androideabi-gcc
1 parent 88620e2 commit 1df89dd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

build.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ fn main() {
5757
println!("cargo:rustc-link-lib=framework=CoreFoundation");
5858

5959
} else if target.contains("android") {
60-
env::set_var("CFLAGS", "-D LINE_MAX=2048 -D RLIMIT_NLIMITS=15 -D IPTOS_LOWCOST=2 -std=gnu99");
61-
env::set_var("CXX", "arm-linux-androideabi-clang++");
60+
set_android_flags();
6261
execute_shell_cmd(&ANDROID_CFG);
6362
let mut config = cc::Build::new();
6463
config.file("etc/hidapi/linux/hid.c").include("etc/hidapi/hidapi");
@@ -77,6 +76,12 @@ fn main() {
7776
}
7877
}
7978

79+
fn set_android_flags() {
80+
env::set_var("CFLAGS", "-D LINE_MAX=2048 -D RLIMIT_NLIMITS=15 -D IPTOS_LOWCOST=2 -std=gnu99");
81+
env::set_var("CXX", "arm-linux-androideabi-clang++");
82+
env::set_var("CC", "arm-linux-androideabi-gcc");
83+
}
84+
8085
fn execute_shell_cmd(commands: &[&str]) {
8186
let start = std::env::current_dir().expect("Couldn't fetch current directory");
8287
let target = std::path::Path::new(&start).join("etc/eudev");

0 commit comments

Comments
 (0)