From dc5d28ad1736d31787da910627a3711c4df2a588 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Wed, 16 Mar 2016 11:37:17 -0700 Subject: Allow overriding of Clang prebuilts These are the environment variables used by make to override the llvm/clang prebuilts. As far as I know, these should only be used when building or testing a new clang drop. I would have this handled by make and put in soong.variables, but I expect this to be one of the first options removed from make and exported from Soong to Kati. Change-Id: I7a3a70ee44fc4b1e56a5e200e2a7ced77d4c5692 --- cc/cc.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cc/cc.go b/cc/cc.go index e091be3f..41058116 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -153,7 +153,20 @@ func init() { pctx.PrefixedPathsForOptionalSourceVariable("commonNativehelperInclude", "-I", []string{"libnativehelper/include/nativehelper"}) - pctx.SourcePathVariable("clangPath", "prebuilts/clang/host/${HostPrebuiltTag}/clang-2658975/bin") + pctx.SourcePathVariable("clangDefaultBase", "prebuilts/clang/host") + pctx.VariableFunc("clangBase", func(config interface{}) (string, error) { + if override := config.(common.Config).Getenv("LLVM_PREBUILTS_BASE"); override != "" { + return override, nil + } + return "${clangDefaultBase}", nil + }) + pctx.VariableFunc("clangVersion", func(config interface{}) (string, error) { + if override := config.(common.Config).Getenv("LLVM_PREBUILTS_VERSION"); override != "" { + return override, nil + } + return "clang-2658975", nil + }) + pctx.StaticVariable("clangPath", "${clangBase}/${HostPrebuiltTag}/${clangVersion}/bin") } type CCModuleContext common.AndroidBaseContext -- cgit v1.2.3