Don't install both variants for host or non-make builds.
This CL ensures that only one of the two generated variants are
installed for non-make builds and for host binaries.
Bug: 30227045
Test: OUT_DIR=/tmp/ndk build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I7ca78af51ea6bd3ae1107a69331abd6ff68f2150
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 7d2b1ca..9e1f02f 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -470,7 +470,6 @@
ret.SubName += ".asan"
}
}
-
}
func (sanitize *sanitize) inSanitizerDir() bool {
@@ -582,12 +581,6 @@
modules[1].(*Module).sanitize.SetSanitizer(cfi, false)
}
} else {
- if isSanitizerEnabled {
- modules[0].(*Module).Properties.PreventInstall = true
- } else {
- modules[1].(*Module).Properties.PreventInstall = true
- }
-
if mctx.AConfig().EmbeddedInMake() {
if isSanitizerEnabled {
modules[0].(*Module).Properties.HideFromMake = true
@@ -596,6 +589,13 @@
}
}
}
+ if !mctx.AConfig().EmbeddedInMake() || !mctx.Device() {
+ if isSanitizerEnabled {
+ modules[0].(*Module).Properties.PreventInstall = true
+ } else {
+ modules[1].(*Module).Properties.PreventInstall = true
+ }
+ }
}
c.sanitize.Properties.SanitizeDep = false
}