diff options
author | Dan Willemsen <dwillemsen@google.com> | 2016-03-16 11:37:17 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2016-03-16 13:18:07 -0700 |
commit | dc5d28ad1736d31787da910627a3711c4df2a588 (patch) | |
tree | 22316f6ee3dc7122201b762b18f83e8821bd47be /cc | |
parent | b50381684a619208bc1b0778f69add13c6a0c10a (diff) | |
download | build_soong-dc5d28ad1736d31787da910627a3711c4df2a588.tar.gz build_soong-dc5d28ad1736d31787da910627a3711c4df2a588.tar.bz2 build_soong-dc5d28ad1736d31787da910627a3711c4df2a588.zip |
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
Diffstat (limited to 'cc')
-rw-r--r-- | cc/cc.go | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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 |