summaryrefslogtreecommitdiff
path: root/cc/compiler.go
diff options
context:
space:
mode:
author Alix Espino <agespino@google.com> 2022-09-21 19:28:11 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-09-21 19:28:11 +0000
commit62b75f4e4ab9481b5e87c2284af8c6a646c7f45b (patch)
tree2c44aa24f9623eea0391295275029eedcf3c2ea0 /cc/compiler.go
parentf5410382aba9c4924718d51c5d36472944f330a2 (diff)
parentef47e54bec5b9b39a7b0661bff2413c8f9a230ff (diff)
Merge "Revert^2 "deletion of clang_cflags & clang_asflags from Soong""
Diffstat (limited to 'cc/compiler.go')
-rw-r--r--cc/compiler.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/cc/compiler.go b/cc/compiler.go
index f9f7b6fd7..a75175482 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -441,12 +441,24 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
// TODO: debug
flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Release.Cflags)...)
- CheckBadCompilerFlags(ctx, "clang_cflags", compiler.Properties.Clang_cflags)
- CheckBadCompilerFlags(ctx, "clang_asflags", compiler.Properties.Clang_asflags)
+ if !ctx.DeviceConfig().BuildBrokenClangCFlags() && len(compiler.Properties.Clang_cflags) != 0 {
+ ctx.PropertyErrorf("clang_cflags", "property is deprecated, see Changes.md file")
+ } else {
+ CheckBadCompilerFlags(ctx, "clang_cflags", compiler.Properties.Clang_cflags)
+ }
+ if !ctx.DeviceConfig().BuildBrokenClangAsFlags() && len(compiler.Properties.Clang_asflags) != 0 {
+ ctx.PropertyErrorf("clang_asflags", "property is deprecated, see Changes.md file")
+ } else {
+ CheckBadCompilerFlags(ctx, "clang_asflags", compiler.Properties.Clang_asflags)
+ }
flags.Local.CFlags = config.ClangFilterUnknownCflags(flags.Local.CFlags)
- flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Clang_cflags)...)
- flags.Local.AsFlags = append(flags.Local.AsFlags, esc(compiler.Properties.Clang_asflags)...)
+ if !ctx.DeviceConfig().BuildBrokenClangCFlags() {
+ flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Clang_cflags)...)
+ }
+ if !ctx.DeviceConfig().BuildBrokenClangAsFlags() {
+ flags.Local.AsFlags = append(flags.Local.AsFlags, esc(compiler.Properties.Clang_asflags)...)
+ }
flags.Local.CppFlags = config.ClangFilterUnknownCflags(flags.Local.CppFlags)
flags.Local.ConlyFlags = config.ClangFilterUnknownCflags(flags.Local.ConlyFlags)
flags.Local.LdFlags = config.ClangFilterUnknownCflags(flags.Local.LdFlags)