Allow specifying the pool for soong_build calls.

Test: Presubmits.
Change-Id: Iff0edf595b1868ccdda4ea6391c1057e0f86cd9b
This commit is contained in:
Lukacs T. Berki 2022-01-04 14:49:54 +01:00
parent a08e722192
commit 3dab5143bd
2 changed files with 8 additions and 1 deletions

View file

@ -138,7 +138,7 @@ var (
Depfile: "$out.d", Depfile: "$out.d",
Restat: true, Restat: true,
}, },
"builder", "extra") "builder", "extra", "pool")
// Work around a Ninja issue. See https://github.com/martine/ninja/pull/634 // Work around a Ninja issue. See https://github.com/martine/ninja/pull/634
phony = pctx.StaticRule("phony", phony = pctx.StaticRule("phony",
@ -679,6 +679,11 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
flags = append(flags, primaryBuilderCmdlinePrefix...) flags = append(flags, primaryBuilderCmdlinePrefix...)
flags = append(flags, i.Args...) flags = append(flags, i.Args...)
pool := ""
if i.Console {
pool = "console"
}
// Build the main build.ninja // Build the main build.ninja
ctx.Build(pctx, blueprint.BuildParams{ ctx.Build(pctx, blueprint.BuildParams{
Rule: generateBuildNinja, Rule: generateBuildNinja,
@ -687,6 +692,7 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
Args: map[string]string{ Args: map[string]string{
"builder": primaryBuilderFile, "builder": primaryBuilderFile,
"extra": strings.Join(flags, " "), "extra": strings.Join(flags, " "),
"pool": pool,
}, },
// soong_ui explicitly requests what it wants to be build. This is // soong_ui explicitly requests what it wants to be build. This is
// because the same Ninja file contains instructions to run // because the same Ninja file contains instructions to run

View file

@ -108,5 +108,6 @@ type PrimaryBuilderInvocation struct {
Inputs []string Inputs []string
Outputs []string Outputs []string
Args []string Args []string
Console bool
Description string Description string
} }