Add extra cflags for LLVM_NEXT

The staging compiler update sometimes needs additional cflags to build, but those flags may not be recognised by the current compiler. Add a
new `llvmNextExtraCommonGlobalCflags` section and only append those
flags when LLVM_NEXT is set.

Test: LLVM_NEXT=true m
Bug: 236798112
Change-Id: Icc4687950acd44798b2cf09131a425ddfd919214
This commit is contained in:
Yi Kong
2022-07-13 14:50:33 +08:00
parent ee81400fbb
commit b79fc584c7

View File

@@ -280,6 +280,11 @@ var (
"-Wno-string-concatenation",
}
llvmNextExtraCommonGlobalCflags = []string{
"-Wno-unqualified-std-cast-call",
"-Wno-deprecated-non-prototype",
}
IllegalFlags = []string{
"-w",
}
@@ -361,6 +366,11 @@ func init() {
if ctx.Config().IsEnvTrue("USE_CCACHE") {
flags = append(flags, "-Wno-unused-command-line-argument")
}
if ctx.Config().IsEnvTrue("LLVM_NEXT") {
flags = append(flags, llvmNextExtraCommonGlobalCflags...)
}
return strings.Join(flags, " ")
})