From 220c9f6eaec7627b3cad20629898f5a905c39bb6 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Sat, 7 Oct 2023 13:06:51 -0700 Subject: [PATCH] Pass -Wno-unused-command-line-argument to clang in `is_flag_supported` --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 219d82cd7..d91545d41 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -522,6 +522,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");