Allow boards to turn overriding commands into an error

am: 3d60b115a0

Change-Id: I6eb0d7d34a206922be59bc9501b11ca141fbbe18
This commit is contained in:
Dan Willemsen 2018-04-06 09:08:41 -07:00 committed by android-build-merger
commit faf45dedac
3 changed files with 20 additions and 0 deletions

View file

@ -48,6 +48,8 @@ type configImpl struct {
ninjaArgs []string
katiSuffix string
targetDevice string
brokenDupRules bool
}
const srcDirFileCheck = "build/soong/root.bp"
@ -556,3 +558,11 @@ func (c *configImpl) PrebuiltBuildTool(name string) string {
}
return filepath.Join("prebuilts/build-tools", c.HostPrebuiltTag(), "bin", name)
}
func (c *configImpl) SetBuildBrokenDupRules(val bool) {
c.brokenDupRules = val
}
func (c *configImpl) BuildBrokenDupRules() bool {
return c.brokenDupRules
}

View file

@ -156,6 +156,9 @@ func runMakeProductConfig(ctx Context, config Config) {
// To find target/product/<DEVICE>
"TARGET_DEVICE",
// Whether --werror_overriding_commands will work
"BUILD_BROKEN_DUP_RULES",
}, exportEnvVars...), BannerVars...)
make_vars, err := dumpMakeVars(ctx, config, config.Arguments(), allVars, true)
@ -179,4 +182,6 @@ func runMakeProductConfig(ctx Context, config Config) {
config.SetKatiArgs(strings.Fields(make_vars["KATI_GOALS"]))
config.SetNinjaArgs(strings.Fields(make_vars["NINJA_GOALS"]))
config.SetTargetDevice(make_vars["TARGET_DEVICE"])
config.SetBuildBrokenDupRules(make_vars["BUILD_BROKEN_DUP_RULES"] != "false")
}

View file

@ -81,6 +81,10 @@ func runKati(ctx Context, config Config) {
"-f", "build/make/core/main.mk",
}
if !config.BuildBrokenDupRules() {
args = append(args, "--werror_overriding_commands")
}
if !config.Environment().IsFalse("KATI_EMULATE_FIND") {
args = append(args, "--use_find_emulator")
}
@ -190,6 +194,7 @@ func runKatiCleanSpec(ctx Context, config Config) {
"--color_warnings",
"--gen_all_targets",
"--werror_find_emulator",
"--werror_overriding_commands",
"--use_find_emulator",
"-f", "build/make/core/cleanbuild.mk",
"BUILDING_WITH_NINJA=true",