Respect Clang version override env vars.
Bazel fails to respect the environment variables $LLVM_PREBUILTS_VERSION and $LLVM_RELEASE_VERSION, which are commonly used by LLVM developers to build using a custom compiler. Fix it. Bug: 272408039 Change-Id: I3cf18e7814ff52d526017e4fe34b17ab3d8f1080
This commit is contained in:
@@ -95,6 +95,15 @@ func (ev ExportedVariables) ExportVariableConfigMethod(name string, method inter
|
||||
return ev.pctx.VariableConfigMethod(name, method)
|
||||
}
|
||||
|
||||
func (ev ExportedVariables) ExportStringStaticVariableWithEnvOverride(name, envVar, defaultVal string) {
|
||||
ev.ExportVariableConfigMethod(name, func(config Config) string {
|
||||
if override := config.Getenv(envVar); override != "" {
|
||||
return override
|
||||
}
|
||||
return defaultVal
|
||||
})
|
||||
}
|
||||
|
||||
// ExportSourcePathVariable declares a static "source path" variable and exports
|
||||
// it to Bazel's toolchain.
|
||||
func (ev ExportedVariables) ExportSourcePathVariable(name string, value string) {
|
||||
|
Reference in New Issue
Block a user