From 2cef5370a9423ba4c2689ba403a8a0bff6754a3b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 26 Nov 2022 18:29:31 +1100 Subject: [PATCH] Fix `Build::is_flag_supported`: Check exit status of the compiler Signed-off-by: Jiahao XU --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index fa899df0..a8dd5717 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -538,7 +538,7 @@ impl Build { cmd.arg(&src); let output = cmd.output()?; - let is_supported = output.stderr.is_empty(); + let is_supported = output.status.success() && output.stderr.is_empty(); known_status.insert(flag.to_owned(), is_supported); Ok(is_supported)