Add option to allow unknown warning options
Some build targets pulls cflags from build/soong but has its own choice
of compiler version. This causes errors for due to unknown warning
options. This allows them to suppress such checks.
Test: presubmit
Change-Id: Ia89508d6b92481fb1ed0c90f1fdb4d8e54566349
diff --git a/cc/config/global.go b/cc/config/global.go
index a40f5ea..26d93ab 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -375,6 +375,10 @@
flags = append(flags, llvmNextExtraCommonGlobalCflags...)
}
+ if ctx.Config().IsEnvTrue("ALLOW_UNKNOWN_WARNING_OPTION") {
+ flags = append(flags, "-Wno-error=unknown-warning-option")
+ }
+
return strings.Join(flags, " ")
})