librustc: ar call fix to support android cross compile on mac
This commit is contained in:
parent
8adbb383c4
commit
19e97f5c5d
|
@ -37,7 +37,15 @@ pub struct ArchiveRO {
|
|||
|
||||
fn run_ar(sess: Session, args: &str, cwd: Option<&Path>,
|
||||
paths: &[&Path]) -> ProcessOutput {
|
||||
let ar = sess.opts.ar.clone().unwrap_or_else(|| ~"ar");
|
||||
let ar = if sess.opts.target_triple == ~"arm-linux-androideabi" {
|
||||
match sess.opts.android_cross_path {
|
||||
Some(ref path) => *path + "/bin/" + "arm-linux-androideabi-ar",
|
||||
None => ~"arm-linux-androideabi-ar"
|
||||
}
|
||||
} else {
|
||||
sess.opts.ar.clone().unwrap_or_else(|| ~"ar")
|
||||
};
|
||||
|
||||
let mut args = ~[args.to_owned()];
|
||||
let mut paths = paths.iter().map(|p| p.as_str().unwrap().to_owned());
|
||||
args.extend(&mut paths);
|
||||
|
|
Loading…
Reference in New Issue