Allow boards to turn overriding commands into an error
am: 3d60b115a0
Change-Id: I6eb0d7d34a206922be59bc9501b11ca141fbbe18
This commit is contained in:
commit
faf45dedac
3 changed files with 20 additions and 0 deletions
|
@ -48,6 +48,8 @@ type configImpl struct {
|
||||||
ninjaArgs []string
|
ninjaArgs []string
|
||||||
katiSuffix string
|
katiSuffix string
|
||||||
targetDevice string
|
targetDevice string
|
||||||
|
|
||||||
|
brokenDupRules bool
|
||||||
}
|
}
|
||||||
|
|
||||||
const srcDirFileCheck = "build/soong/root.bp"
|
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)
|
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
|
||||||
|
}
|
||||||
|
|
|
@ -156,6 +156,9 @@ func runMakeProductConfig(ctx Context, config Config) {
|
||||||
|
|
||||||
// To find target/product/<DEVICE>
|
// To find target/product/<DEVICE>
|
||||||
"TARGET_DEVICE",
|
"TARGET_DEVICE",
|
||||||
|
|
||||||
|
// Whether --werror_overriding_commands will work
|
||||||
|
"BUILD_BROKEN_DUP_RULES",
|
||||||
}, exportEnvVars...), BannerVars...)
|
}, exportEnvVars...), BannerVars...)
|
||||||
|
|
||||||
make_vars, err := dumpMakeVars(ctx, config, config.Arguments(), allVars, true)
|
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.SetKatiArgs(strings.Fields(make_vars["KATI_GOALS"]))
|
||||||
config.SetNinjaArgs(strings.Fields(make_vars["NINJA_GOALS"]))
|
config.SetNinjaArgs(strings.Fields(make_vars["NINJA_GOALS"]))
|
||||||
config.SetTargetDevice(make_vars["TARGET_DEVICE"])
|
config.SetTargetDevice(make_vars["TARGET_DEVICE"])
|
||||||
|
|
||||||
|
config.SetBuildBrokenDupRules(make_vars["BUILD_BROKEN_DUP_RULES"] != "false")
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,10 @@ func runKati(ctx Context, config Config) {
|
||||||
"-f", "build/make/core/main.mk",
|
"-f", "build/make/core/main.mk",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !config.BuildBrokenDupRules() {
|
||||||
|
args = append(args, "--werror_overriding_commands")
|
||||||
|
}
|
||||||
|
|
||||||
if !config.Environment().IsFalse("KATI_EMULATE_FIND") {
|
if !config.Environment().IsFalse("KATI_EMULATE_FIND") {
|
||||||
args = append(args, "--use_find_emulator")
|
args = append(args, "--use_find_emulator")
|
||||||
}
|
}
|
||||||
|
@ -190,6 +194,7 @@ func runKatiCleanSpec(ctx Context, config Config) {
|
||||||
"--color_warnings",
|
"--color_warnings",
|
||||||
"--gen_all_targets",
|
"--gen_all_targets",
|
||||||
"--werror_find_emulator",
|
"--werror_find_emulator",
|
||||||
|
"--werror_overriding_commands",
|
||||||
"--use_find_emulator",
|
"--use_find_emulator",
|
||||||
"-f", "build/make/core/cleanbuild.mk",
|
"-f", "build/make/core/cleanbuild.mk",
|
||||||
"BUILDING_WITH_NINJA=true",
|
"BUILDING_WITH_NINJA=true",
|
||||||
|
|
Loading…
Reference in a new issue