Add support for PRODUCT_RELEASE_CONFIG_MAPS

This allows product config to determine what build flags are present in
a product's build, as well as their value.

As product config moves to a declarative specification, this can be
handled with less unnecessary work.

Bug: b/302593603
Test: manual
Change-Id: If6ae19e3da8471eaba8d6e048769f8ac6b244155
This commit is contained in:
LaMont Jones
2023-10-11 17:58:14 +00:00
parent e19a173a48
commit 772e21ba27
2 changed files with 23 additions and 0 deletions

View File

@@ -92,6 +92,20 @@ func dumpMakeVars(ctx Context, config Config, goals, vars []string, write_soong_
}
defer tool.Finish()
releaseConfigVars := []string{
"PRODUCT_RELEASE_CONFIG_MAPS",
}
if !config.productReleaseConfigMapsLoaded {
// Get the PRODUCT_RELEASE_CONFIG_MAPS for this product, to avoid polluting the environment
// when we run product config to get the rest of the make vars.
config.productReleaseConfigMapsLoaded = true
releaseMapVars, err := dumpMakeVars(ctx, config, goals, releaseConfigVars, false, "")
if err != nil {
ctx.Fatalln("Error getting PRODUCT_RELEASE_CONFIG_MAPS:", err)
}
config.productReleaseConfigMaps = releaseMapVars["PRODUCT_RELEASE_CONFIG_MAPS"]
}
cmd := Command(ctx, config, "dumpvars",
config.PrebuiltBuildTool("ckati"),
"-f", "build/make/core/config.mk",
@@ -191,6 +205,9 @@ func runMakeProductConfig(ctx Context, config Config) {
"TARGET_BUILD_APPS",
"TARGET_BUILD_UNBUNDLED",
// Additional release config maps
"PRODUCT_RELEASE_CONFIG_MAPS",
// compiler wrappers set up by make
"CC_WRAPPER",
"CXX_WRAPPER",