Skip to content

Commit cef0acf

Browse files
committed
Explicitly enable cross-compilation in ./configure
1 parent dee44af commit cef0acf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ fn build(target_os: &str) -> io::Result<()> {
200200

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

203-
if env::var("TARGET").unwrap() != env::var("HOST").unwrap() {
203+
let target = env::var("TARGET").unwrap();
204+
let host = env::var("HOST").unwrap();
205+
if target != host {
206+
configure.arg("--enable-cross-compile");
207+
204208
// Rust targets are subtly different than naming scheme for compiler prefixes.
205209
// The cc crate has the messy logic of guessing a working prefix,
206210
// and this is a messy way of reusing that logic.

0 commit comments

Comments
 (0)