diff options
-rw-r--r-- | cc/cc.go | 14 | ||||
-rw-r--r-- | cc/clang.go | 10 |
2 files changed, 11 insertions, 13 deletions
@@ -115,13 +115,13 @@ func init() { pctx.StaticVariable("commonGlobalCppflags", strings.Join(commonGlobalCppflags, " ")) pctx.StaticVariable("commonClangGlobalCflags", - strings.Join(clangFilterUnknownCflags(commonGlobalCflags), " ")) + strings.Join(append(clangFilterUnknownCflags(commonGlobalCflags), "${clangExtraCflags}"), " ")) pctx.StaticVariable("deviceClangGlobalCflags", - strings.Join(clangFilterUnknownCflags(deviceGlobalCflags), " ")) + strings.Join(append(clangFilterUnknownCflags(deviceGlobalCflags), "${clangExtraTargetCflags}"), " ")) pctx.StaticVariable("hostClangGlobalCflags", strings.Join(clangFilterUnknownCflags(hostGlobalCflags), " ")) pctx.StaticVariable("commonClangGlobalCppflags", - strings.Join(clangFilterUnknownCflags(commonGlobalCppflags), " ")) + strings.Join(append(clangFilterUnknownCflags(commonGlobalCppflags), "${clangExtraCppflags}"), " ")) // Everything in this list is a crime against abstraction and dependency tracking. // Do not add anything to this list. @@ -550,12 +550,6 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha flags.ConlyFlags = clangFilterUnknownCflags(flags.ConlyFlags) flags.LdFlags = clangFilterUnknownCflags(flags.LdFlags) - flags.CFlags = append(flags.CFlags, "${clangExtraCflags}") - flags.ConlyFlags = append(flags.ConlyFlags, "${clangExtraConlyflags}") - if ctx.Device() { - flags.CFlags = append(flags.CFlags, "${clangExtraTargetCflags}") - } - target := "-target " + toolchain.ClangTriple() gccPrefix := "-B" + filepath.Join(toolchain.GccRoot(), toolchain.GccTriple(), "bin") @@ -577,6 +571,8 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha toolchain.ClangCflags(), "${commonClangGlobalCflags}", fmt.Sprintf("${%sClangGlobalCflags}", ctx.HostOrDevice())) + + flags.ConlyFlags = append(flags.ConlyFlags, "${clangExtraConlyflags}") } else { flags.CppFlags = append(flags.CppFlags, "${commonGlobalCppflags}") flags.GlobalFlags = append(flags.GlobalFlags, diff --git a/cc/clang.go b/cc/clang.go index 6a01010d..5e0302a5 100644 --- a/cc/clang.go +++ b/cc/clang.go @@ -84,10 +84,6 @@ func init() { // See http://petereisentraut.blogspot.com/2011/05/ccache-and-clang.html. "-Wno-unused-command-line-argument", - // Disable -Winconsistent-missing-override until we can clean up the existing - // codebase for it. - "-Wno-inconsistent-missing-override", - // Force clang to always output color diagnostics. Ninja will strip the ANSI // color codes if it is not running in a terminal. "-fcolor-diagnostics", @@ -97,6 +93,12 @@ func init() { "-std=gnu99", }, " ")) + pctx.StaticVariable("clangExtraCppflags", strings.Join([]string{ + // Disable -Winconsistent-missing-override until we can clean up the existing + // codebase for it. + "-Wno-inconsistent-missing-override", + }, " ")) + pctx.StaticVariable("clangExtraTargetCflags", strings.Join([]string{ "-nostdlibinc", }, " ")) |