Browse Source

Merge pull request #106 from jdub/cross-compile

Support CROSS_COMPILE environment variable
vs2017
Alex Crichton 8 years ago
committed by GitHub
parent
commit
24d1b39ee2
  1. 5
      src/lib.rs

5
src/lib.rs

@ -709,7 +709,8 @@ impl Config {
} else if target.contains("android") {
format!("{}-{}", target, gnu)
} else if self.get_host() != target {
let prefix = match &target[..] {
let cross_compile = self.getenv("CROSS_COMPILE");
let prefix = cross_compile.as_ref().map(String::as_str).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"),
@ -739,7 +740,7 @@ impl Config {
"x86_64-unknown-linux-musl" => Some("musl"),
"x86_64-unknown-netbsd" => Some("x86_64--netbsd"),
_ => None,
};
});
match prefix {
Some(prefix) => format!("{}-{}", prefix, gnu),
None => default.to_string(),

Loading…
Cancel
Save