diff --git a/build.rs b/build.rs index 1e6e41c5..65ce304d 100644 --- a/build.rs +++ b/build.rs @@ -48,7 +48,6 @@ fn has_feature(feature: &str) -> bool { fn can_compile>(test: T) -> bool { use std::process::Stdio; - let out_dir = var("OUT_DIR").unwrap(); let rustc = var("RUSTC").unwrap(); let target = var("TARGET").unwrap(); @@ -72,8 +71,9 @@ fn can_compile>(test: T) -> bool { .arg("--emit=metadata") // Do as little as possible but still parse. .arg("--target") .arg(target) - .arg("--out-dir") - .arg(out_dir); // Put the output somewhere inconsequential. + .arg("-o") + .arg("-") + .stdout(Stdio::null()); // We don't care about the output (only whether it builds or not) // If Cargo wants to set RUSTFLAGS, use that. if let Ok(rustflags) = var("CARGO_ENCODED_RUSTFLAGS") { diff --git a/cap-async-std/build.rs b/cap-async-std/build.rs index 3706ce13..434559ec 100644 --- a/cap-async-std/build.rs +++ b/cap-async-std/build.rs @@ -35,7 +35,6 @@ fn has_feature(feature: &str) -> bool { fn can_compile>(test: T) -> bool { use std::process::Stdio; - let out_dir = var("OUT_DIR").unwrap(); let rustc = var("RUSTC").unwrap(); let target = var("TARGET").unwrap(); @@ -59,8 +58,9 @@ fn can_compile>(test: T) -> bool { .arg("--emit=metadata") // Do as little as possible but still parse. .arg("--target") .arg(target) - .arg("--out-dir") - .arg(out_dir); // Put the output somewhere inconsequential. + .arg("-o") + .arg("-") + .stdout(Stdio::null()); // We don't care about the output (only whether it builds or not) // If Cargo wants to set RUSTFLAGS, use that. if let Ok(rustflags) = var("CARGO_ENCODED_RUSTFLAGS") { diff --git a/cap-fs-ext/build.rs b/cap-fs-ext/build.rs index b8ccb4dd..1716d753 100644 --- a/cap-fs-ext/build.rs +++ b/cap-fs-ext/build.rs @@ -32,7 +32,6 @@ fn has_feature(feature: &str) -> bool { fn can_compile>(test: T) -> bool { use std::process::Stdio; - let out_dir = var("OUT_DIR").unwrap(); let rustc = var("RUSTC").unwrap(); let target = var("TARGET").unwrap(); @@ -56,8 +55,9 @@ fn can_compile>(test: T) -> bool { .arg("--emit=metadata") // Do as little as possible but still parse. .arg("--target") .arg(target) - .arg("--out-dir") - .arg(out_dir); // Put the output somewhere inconsequential. + .arg("-o") + .arg("-") + .stdout(Stdio::null()); // We don't care about the output (only whether it builds or not) // If Cargo wants to set RUSTFLAGS, use that. if let Ok(rustflags) = var("CARGO_ENCODED_RUSTFLAGS") { diff --git a/cap-primitives/build.rs b/cap-primitives/build.rs index b92c0bce..8bab65a3 100644 --- a/cap-primitives/build.rs +++ b/cap-primitives/build.rs @@ -42,7 +42,6 @@ fn has_feature(feature: &str) -> bool { fn can_compile>(test: T) -> bool { use std::process::Stdio; - let out_dir = var("OUT_DIR").unwrap(); let rustc = var("RUSTC").unwrap(); let target = var("TARGET").unwrap(); @@ -66,8 +65,9 @@ fn can_compile>(test: T) -> bool { .arg("--emit=metadata") // Do as little as possible but still parse. .arg("--target") .arg(target) - .arg("--out-dir") - .arg(out_dir); // Put the output somewhere inconsequential. + .arg("-o") + .arg("-") + .stdout(Stdio::null()); // We don't care about the output (only whether it builds or not) // If Cargo wants to set RUSTFLAGS, use that. if let Ok(rustflags) = var("CARGO_ENCODED_RUSTFLAGS") { diff --git a/cap-std/build.rs b/cap-std/build.rs index 0004c698..f3afe13c 100644 --- a/cap-std/build.rs +++ b/cap-std/build.rs @@ -37,7 +37,6 @@ fn has_feature(feature: &str) -> bool { fn can_compile>(test: T) -> bool { use std::process::Stdio; - let out_dir = var("OUT_DIR").unwrap(); let rustc = var("RUSTC").unwrap(); let target = var("TARGET").unwrap(); @@ -61,8 +60,9 @@ fn can_compile>(test: T) -> bool { .arg("--emit=metadata") // Do as little as possible but still parse. .arg("--target") .arg(target) - .arg("--out-dir") - .arg(out_dir); // Put the output somewhere inconsequential. + .arg("-o") + .arg("-") + .stdout(Stdio::null()); // We don't care about the output (only whether it builds or not) // If Cargo wants to set RUSTFLAGS, use that. if let Ok(rustflags) = var("CARGO_ENCODED_RUSTFLAGS") {