From 59255ceac58f7211635bdbbd41e66fcd756a90c7 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Fri, 3 Nov 2023 15:17:02 -0700 Subject: [PATCH] Pass -Wno-unused-command-line-argument to clang in `is_flag_supported` (#886) --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index ecc5d48f..77f1a1db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -523,6 +523,11 @@ impl Build { if compiler.family.verbose_stderr() { compiler.remove_arg("-v".into()); } + if compiler.family == ToolFamily::Clang { + // Avoid reporting that the arg is unsupported just because the + // compiler complains that it wasn't used. + compiler.push_cc_arg("-Wno-unused-command-line-argument".into()); + } let mut cmd = compiler.to_command(); let is_arm = target.contains("aarch64") || target.contains("arm");