Allow "-mllvm foo" cflags

LLVM backend flags are a pair of flags beginning with "-mllvm". Teach
Soong to allow these flag pairs.

Test: presubmit
Change-Id: Ib2b9cb8ce8704338e14dbd1f1a656e10b86c0ee3
This commit is contained in:
Yi Kong 2023-03-07 15:41:24 +09:00
parent bb7c61ff61
commit 6a0f506f3a

View file

@ -57,6 +57,10 @@ func CheckBadCompilerFlags(ctx BaseModuleContext, prop string, flags []string) {
} else if strings.HasPrefix("../", path) { } else if strings.HasPrefix("../", path) {
ctx.PropertyErrorf(prop, "Path must not start with `../`: `%s`. Use include_dirs to -include from a different directory", flag) ctx.PropertyErrorf(prop, "Path must not start with `../`: `%s`. Use include_dirs to -include from a different directory", flag)
} }
} else if args[0] == "-mllvm" {
if len(args) > 2 {
ctx.PropertyErrorf(prop, "`-mllvm` only takes one argument: `%s`", flag)
}
} else if strings.HasPrefix(flag, "-D") && strings.Contains(flag, "=") { } else if strings.HasPrefix(flag, "-D") && strings.Contains(flag, "=") {
// Do nothing in this case. // Do nothing in this case.
// For now, we allow space characters in -DNAME=def form to allow use cases // For now, we allow space characters in -DNAME=def form to allow use cases