Browse Source

Trim right - from CROSS_COMPILE

Note the expected form of CROSS_COMPILE for future reference.
vs2017
Jeff Waugh 8 years ago
parent
commit
ffc397d143
  1. 6
      src/lib.rs

6
src/lib.rs

@ -713,8 +713,10 @@ impl Config {
} else if target.contains("android") {
format!("{}-{}", target, gnu)
} else if self.get_host() != target {
let cross_compile = self.getenv("CROSS_COMPILE");
let prefix = cross_compile.as_ref().map(String::as_str).or(match &target[..] {
// CROSS_COMPILE is of the form: "arm-linux-gnueabi-"
let cc_env = self.getenv("CROSS_COMPILE");
let cross_compile = cc_env.as_ref().map(|s| s.trim_right_matches('-'));
let prefix = cross_compile.or(match &target[..] {
"aarch64-unknown-linux-gnu" => Some("aarch64-linux-gnu"),
"arm-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"),
"arm-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"),

Loading…
Cancel
Save