Support per-module MakeVars
This allows setting per-module make variables earlier in the build, particularly for prebuilt_build_tool users like LEX/M4/BISON. I moved filegroup over because it's a simpler common interface, but it doesn't strictly need it. With this, the last user of the hardcoded cc.m4Cmd variable is gone. Test: Inspect out/soong/make_vars-*.mk, out/soong/late-*.mk Test: treehugger Change-Id: I195b688131feac0c100c338a0749368aa5d50f4f
This commit is contained in:
@@ -29,6 +29,10 @@ type prebuiltBuildToolProperties struct {
|
||||
|
||||
// Extra files that should trigger rules using this tool to rebuild
|
||||
Deps []string `android:"path,arch_variant"`
|
||||
|
||||
// Create a make variable with the specified name that contains the path to
|
||||
// this prebuilt built tool, relative to the root of the source tree.
|
||||
Export_to_make_var *string
|
||||
}
|
||||
|
||||
type prebuiltBuildTool struct {
|
||||
@@ -81,6 +85,12 @@ func (t *prebuiltBuildTool) HostToolPath() OptionalPath {
|
||||
return t.toolPath
|
||||
}
|
||||
|
||||
func (t *prebuiltBuildTool) MakeVars(ctx MakeVarsModuleContext) {
|
||||
if makeVar := String(t.properties.Export_to_make_var); makeVar != "" {
|
||||
ctx.StrictRaw(makeVar, t.toolPath.String())
|
||||
}
|
||||
}
|
||||
|
||||
var _ HostToolProvider = &prebuiltBuildTool{}
|
||||
|
||||
// prebuilt_build_tool is to declare prebuilts to be used during the build, particularly for use
|
||||
|
Reference in New Issue
Block a user