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
This commit is contained in:
Dan Willemsen 2016-03-16 11:37:17 -07:00
parent b50381684a
commit dc5d28ad17

View file

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