Define CLANG_TIDY_UNKNOWN_CFLAGS for build/make.

Bug: 110538415
Test: build with WITH_TIDY=1
Change-Id: I6c5b5a0cb3ad3c2756bbae5e7c0234a0dafe5991
This commit is contained in:
Chih-Hung Hsieh 2018-06-25 13:48:42 -07:00
parent 297d9bceda
commit ad47a27d9c
2 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,13 @@ import (
"strings"
)
// clang-tidy doesn't recognize every flag that clang does. This is unlikely to
// be a complete list, but we can populate this with the ones we know to avoid
// issues with clang-diagnostic-unused-command-line-argument.
var ClangTidyUnknownCflags = sorted([]string{
"-Wa,%",
})
func init() {
// Most Android source files are not clang-tidy clean yet.
// Global tidy checks include only google*, performance*,

View File

@ -75,6 +75,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
ctx.Strict("LLVM_OBJCOPY", "${config.ClangBin}/llvm-objcopy")
ctx.Strict("LLVM_STRIP", "${config.ClangBin}/llvm-strip")
ctx.Strict("PATH_TO_CLANG_TIDY", "${config.ClangBin}/clang-tidy")
ctx.Strict("CLANG_TIDY_UNKNOWN_CFLAGS", strings.Join(config.ClangTidyUnknownCflags, " "))
ctx.StrictSorted("CLANG_CONFIG_UNKNOWN_CFLAGS", strings.Join(config.ClangUnknownCflags, " "))
ctx.Strict("RS_LLVM_PREBUILTS_VERSION", "${config.RSClangVersion}")