Add environment variable to globally disable LTO

Allow developers to disable LTO to reduce build time.

Test: m checkbuild
Test: DISABLE_LTO=true m checkbuild
Bug: 62839002
Change-Id: I30642e3cfff60c4874a2f8797d08105b4e07cc6d
This commit is contained in:
Yi Kong
2018-01-31 15:15:08 -08:00
parent 407c2434c8
commit 03d383d038

View File

@@ -60,6 +60,9 @@ func (lto *lto) props() []interface{} {
}
func (lto *lto) begin(ctx BaseModuleContext) {
if ctx.Config().IsEnvTrue("DISABLE_LTO") {
lto.Properties.Lto.Never = boolPtr(true)
}
}
func (lto *lto) deps(ctx BaseModuleContext, deps Deps) Deps {