From 49932f3e6975f5a39d8f9f5b064431d105740ada Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Fri, 9 Aug 2019 14:44:36 +0900 Subject: Build native coverage variant of APEXes when needed When the native coverage is enabled, APEXes (and files there) are built for native coverage as well. Bug: 138952487 Test: make -j NATIVE_COVERAGE=true COVERAGE_PATHS='*' com.android.resolv find out -name "*.gcno" | grep DnsResolver shows files Test: libnetd_resolv.zip is found under $(TARGET_OUT)/apex/com.android.resolv/lib directory Merged-In: I97bcee9bf8ffc0dc71453abbdb613ed56ea2cdb4 (cherry picked from commit ee9a98d88ec9a792c3d67b9aed9e4571bf2544cf) Change-Id: I97bcee9bf8ffc0dc71453abbdb613ed56ea2cdb4 --- cc/cc.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cc/cc.go') diff --git a/cc/cc.go b/cc/cc.go index 0668fd9a..89beee49 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -311,6 +311,7 @@ type linker interface { unstrippedOutputFilePath() android.Path nativeCoverage() bool + coverageOutputFilePath() android.OptionalPath } type installer interface { @@ -419,6 +420,13 @@ func (c *Module) UnstrippedOutputFile() android.Path { return nil } +func (c *Module) CoverageOutputFile() android.OptionalPath { + if c.linker != nil { + return c.linker.coverageOutputFilePath() + } + return android.OptionalPath{} +} + func (c *Module) RelativeInstallPath() string { if c.installer != nil { return c.installer.relativeInstallPath() -- cgit v1.2.3