Skip to content

Commit

Permalink
Explicitly enable cross-compilation in ./configure
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Nov 22, 2021
1 parent dee44af commit cef0acf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ fn build(target_os: &str) -> io::Result<()> {

configure.arg(format!("--prefix={}", search().to_string_lossy()));

if env::var("TARGET").unwrap() != env::var("HOST").unwrap() {
let target = env::var("TARGET").unwrap();
let host = env::var("HOST").unwrap();
if target != host {
configure.arg("--enable-cross-compile");

// Rust targets are subtly different than naming scheme for compiler prefixes.
// The cc crate has the messy logic of guessing a working prefix,
// and this is a messy way of reusing that logic.
Expand Down

0 comments on commit cef0acf

Please sign in to comment.