Allow the clang version used for bindgen to be configured.
This is useful when experimenting with new compiler flags that the existing compiler does not support. Change-Id: I45b8a2980b247d60a7f4e2ba55169267aeceef2b
This commit is contained in:
@@ -31,12 +31,19 @@ var (
|
|||||||
// bindgen should specify its own Clang revision so updating Clang isn't potentially blocked on bindgen failures.
|
// bindgen should specify its own Clang revision so updating Clang isn't potentially blocked on bindgen failures.
|
||||||
bindgenClangVersion = "clang-r399163b"
|
bindgenClangVersion = "clang-r399163b"
|
||||||
|
|
||||||
|
_ = pctx.VariableFunc("bindgenClangVersion", func(ctx android.PackageVarContext) string {
|
||||||
|
if override := ctx.Config().Getenv("LLVM_BINDGEN_PREBUILTS_VERSION"); override != "" {
|
||||||
|
return override
|
||||||
|
}
|
||||||
|
return bindgenClangVersion
|
||||||
|
})
|
||||||
|
|
||||||
//TODO(b/160803703) Use a prebuilt bindgen instead of the built bindgen.
|
//TODO(b/160803703) Use a prebuilt bindgen instead of the built bindgen.
|
||||||
_ = pctx.HostBinToolVariable("bindgenCmd", "bindgen")
|
_ = pctx.HostBinToolVariable("bindgenCmd", "bindgen")
|
||||||
_ = pctx.SourcePathVariable("bindgenClang",
|
_ = pctx.SourcePathVariable("bindgenClang",
|
||||||
"${cc_config.ClangBase}/${config.HostPrebuiltTag}/"+bindgenClangVersion+"/bin/clang")
|
"${cc_config.ClangBase}/${config.HostPrebuiltTag}/${bindgenClangVersion}/bin/clang")
|
||||||
_ = pctx.SourcePathVariable("bindgenLibClang",
|
_ = pctx.SourcePathVariable("bindgenLibClang",
|
||||||
"${cc_config.ClangBase}/${config.HostPrebuiltTag}/"+bindgenClangVersion+"/lib64/")
|
"${cc_config.ClangBase}/${config.HostPrebuiltTag}/${bindgenClangVersion}/lib64/")
|
||||||
|
|
||||||
//TODO(ivanlozano) Switch this to RuleBuilder
|
//TODO(ivanlozano) Switch this to RuleBuilder
|
||||||
bindgen = pctx.AndroidStaticRule("bindgen",
|
bindgen = pctx.AndroidStaticRule("bindgen",
|
||||||
|
Reference in New Issue
Block a user