|
@ -1549,10 +1549,10 @@ impl Build { |
|
|
} |
|
|
} |
|
|
let host = self.get_host()?; |
|
|
let host = self.get_host()?; |
|
|
let target = self.get_target()?; |
|
|
let target = self.get_target()?; |
|
|
let (env, msvc, gnu, traditional) = if self.cpp { |
|
|
let (env, msvc, gnu, traditional, clang) = if self.cpp { |
|
|
("CXX", "cl.exe", "g++", "c++") |
|
|
("CXX", "cl.exe", "g++", "c++", "clang++") |
|
|
} else { |
|
|
} else { |
|
|
("CC", "cl.exe", "gcc", "cc") |
|
|
("CC", "cl.exe", "gcc", "cc", "clang") |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// On Solaris, c++/cc unlikely to exist or be correct.
|
|
|
// On Solaris, c++/cc unlikely to exist or be correct.
|
|
@ -1607,15 +1607,20 @@ impl Build { |
|
|
format!("{}.exe", gnu) |
|
|
format!("{}.exe", gnu) |
|
|
} |
|
|
} |
|
|
} else if target.contains("android") { |
|
|
} else if target.contains("android") { |
|
|
format!( |
|
|
let target = target |
|
|
"{}-{}", |
|
|
.replace("armv7", "arm") |
|
|
target |
|
|
.replace("armv7neon", "arm") |
|
|
.replace("armv7", "arm") |
|
|
.replace("thumbv7", "arm") |
|
|
.replace("armv7neon", "arm") |
|
|
.replace("thumbv7neon", "arm"); |
|
|
.replace("thumbv7", "arm") |
|
|
let gnu_compiler = format!("{}-{}", target, gnu); |
|
|
.replace("thumbv7neon", "arm"), |
|
|
let clang_compiler = format!("{}-{}", target, clang); |
|
|
gnu |
|
|
// Check if gnu compiler is present
|
|
|
) |
|
|
// if not, use clang
|
|
|
|
|
|
if Command::new(&gnu_compiler).spawn().is_ok() { |
|
|
|
|
|
gnu_compiler |
|
|
|
|
|
} else { |
|
|
|
|
|
clang_compiler |
|
|
|
|
|
} |
|
|
} else if target.contains("cloudabi") { |
|
|
} else if target.contains("cloudabi") { |
|
|
format!("{}-{}", target, traditional) |
|
|
format!("{}-{}", target, traditional) |
|
|
} else if self.get_host()? != target { |
|
|
} else if self.get_host()? != target { |
|
|