Merge "Define PATH_TO_CLANG_TIDY_SHELL for build/make rules."

am: 4b42edbca0

Change-Id: Ie19f560057ef5d3e2ef0671e8af42dd3d1261626
This commit is contained in:
Chih-hung Hsieh 2018-08-28 12:21:36 -07:00 committed by android-build-merger
commit 4cef9cbbad
3 changed files with 4 additions and 4 deletions

View File

@ -150,12 +150,10 @@ var (
},
"crossCompile")
_ = pctx.SourcePathVariable("tidyPath", "build/soong/scripts/clang-tidy.sh")
clangTidy = pctx.AndroidStaticRule("clangTidy",
blueprint.RuleParams{
Command: "rm -f $out && CLANG_TIDY=${config.ClangBin}/clang-tidy $tidyPath $tidyFlags $in -- $cFlags && touch $out",
CommandDeps: []string{"${config.ClangBin}/clang-tidy", "$tidyPath"},
Command: "rm -f $out && CLANG_TIDY=${config.ClangBin}/clang-tidy ${config.ClangTidyShellPath} $tidyFlags $in -- $cFlags && touch $out",
CommandDeps: []string{"${config.ClangBin}/clang-tidy", "${config.ClangTidyShellPath}"},
},
"cFlags", "tidyFlags")

View File

@ -209,6 +209,7 @@ func init() {
})
pctx.StaticVariable("ClangPath", "${ClangBase}/${HostPrebuiltTag}/${ClangVersion}")
pctx.StaticVariable("ClangBin", "${ClangPath}/bin")
pctx.StaticVariable("ClangTidyShellPath", "build/soong/scripts/clang-tidy.sh")
pctx.VariableFunc("ClangShortVersion", func(ctx android.PackageVarContext) string {
if override := ctx.Config().Getenv("LLVM_RELEASE_VERSION"); override != "" {

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("PATH_TO_CLANG_TIDY_SHELL", "${config.ClangTidyShellPath}")
ctx.StrictSorted("CLANG_CONFIG_UNKNOWN_CFLAGS", strings.Join(config.ClangUnknownCflags, " "))
ctx.Strict("RS_LLVM_PREBUILTS_VERSION", "${config.RSClangVersion}")