Do not build tests with ThinLTO

There's not a great return on investment for spending additional
compilation/link time on tests that may only be run once or very few
times (as compared to actual library code that ships and is run orders
of magnitude more times).

Bug: 195134194
Bug: 203737712
Test: m GLOBAL_THINLTO=true dist device-tests platform_tests
Change-Id: I7149c4140f7c52b22bedbe322f1bf2c81f7ad66b
This commit is contained in:
Yi Kong
2021-10-24 17:01:43 +08:00
parent 139fd3655b
commit 85d7297318

View File

@@ -137,8 +137,9 @@ func (lto *lto) LTO(ctx BaseModuleContext) bool {
func (lto *lto) DefaultThinLTO(ctx BaseModuleContext) bool {
host := ctx.Host()
test := ctx.testBinary()
vndk := ctx.isVndk() // b/169217596
return GlobalThinLTO(ctx) && !lto.Never() && !host && !vndk
return GlobalThinLTO(ctx) && !lto.Never() && !host && !test && !vndk
}
func (lto *lto) FullLTO() bool {