Browse Source

Merge pull request #110 from jdub/cross-compile

Trim right - from CROSS_COMPILE
vs2017
Alex Crichton 8 years ago
committed by GitHub
parent
commit
f5d90fa492
  1. 6
      src/lib.rs

6
src/lib.rs

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

Loading…
Cancel
Save