Revert^2 "deletion of clang_cflags & clang_asflags from Soong"

e9a6865bc7

Change-Id: I20be0561628ee9da5c1431975f364459b6184330
This commit is contained in:
Alix Espino
2022-09-14 19:10:51 +00:00
parent e9a6865bc7
commit ef47e54bec
4 changed files with 116 additions and 4 deletions

View File

@@ -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)