aboutsummaryrefslogtreecommitdiffstats
path: root/cc/coverage.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/coverage.go')
-rw-r--r--cc/coverage.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/cc/coverage.go b/cc/coverage.go
index 391b1181..671353c9 100644
--- a/cc/coverage.go
+++ b/cc/coverage.go
@@ -16,6 +16,7 @@ package cc
import (
"android/soong/android"
+ "android/soong/cc/config"
)
type CoverageProperties struct {
@@ -38,6 +39,10 @@ func (cov *coverage) props() []interface{} {
func (cov *coverage) begin(ctx BaseModuleContext) {}
func (cov *coverage) deps(ctx BaseModuleContext, deps Deps) Deps {
+ if cov.Properties.CoverageEnabled {
+ runtimeLibrary := config.ProfileRuntimeLibrary(ctx.toolchain())
+ deps.LateStaticLibs = append(deps.LateStaticLibs, runtimeLibrary)
+ }
return deps
}
@@ -99,9 +104,8 @@ func coverageLinkingMutator(mctx android.BottomUpMutatorContext) {
if !mctx.DeviceConfig().NativeCoverageEnabled() {
// Coverage is disabled globally
- } else if mctx.Host() {
- // TODO(dwillemsen): because of -nodefaultlibs, we must depend on libclang_rt.profile-*.a
- // Just turn off for now.
+ } else if mctx.Darwin() || mctx.Windows() {
+ // Coverage not supported for Darwin and Windows
} else if c.coverage.Properties.Native_coverage != nil {
enabled = *c.coverage.Properties.Native_coverage
} else {