build.rs: silence error output of compile checks

These compile checks are expected to produce compiler errors on some systems.
The errors show up when there is an unrelated error, this is probably quite
confusing so fix that. Should revisit this later.
This commit is contained in:
Johannes Altmanninger 2023-11-25 19:40:31 +01:00
parent 0aa08cf267
commit 18654b1872

View file

@ -1,6 +1,7 @@
use rsconf::{LinkType, Target};
use std::env;
use std::error::Error;
use std::process::Stdio;
fn main() {
for key in ["DOCDIR", "DATADIR", "SYSCONFDIR", "BINDIR"] {
@ -169,6 +170,8 @@ fn compiles(file: &str) -> bool {
.get_compiler()
.to_command();
command.arg(file);
command.stdout(Stdio::null());
command.stderr(Stdio::null());
command.status().unwrap().success()
}