From 160d39e41b1f174db12886045aad4f24d10d7b8c Mon Sep 17 00:00:00 2001 From: Ast-x64 Date: Tue, 26 Apr 2022 11:08:00 +0800 Subject: [PATCH] Use specified compiler in is_flag_supported Use the compiler specified instead of the default one to test whether a flag can be accepted. Fixes https://github.com/alexcrichton/cc-rs/issues/675. --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 92054549..8868a7c9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -477,6 +477,9 @@ impl Build { .debug(false) .cpp(self.cpp) .cuda(self.cuda); + if let Some(ref c) = self.compiler { + cfg.compiler(c.clone()); + } let mut compiler = cfg.try_get_compiler()?; // Clang uses stderr for verbose output, which yields a false positive