Hide mutated variant in non-make builds.

This CL hides (using Module.Properties.PreventInstall) either the
sanitized or stock variant for non-make embedded builds (based on
whether a sanitizer is enabled or not) so we don't have duplicate
rules for installing the same target.

Bug: 30227045
Test: OUT_DIR=out build/soong/scripts/build-ndk-prebuilts.sh # no
longer generates a duplicate build error.

Change-Id: I0b2dbb0afd5d426b32da67f951e2a4f9fbb3f3b9
This commit is contained in:
Vishwath Mohan
2017-10-30 20:33:41 -07:00
parent 9ee01976fe
commit 6147c6972a

View File

@@ -574,22 +574,22 @@ func sanitizerMutator(t sanitizerType) func(android.BottomUpMutatorContext) {
modules[1].(*Module).sanitize.Properties.InSanitizerDir = true
modules[1].(*Module).sanitize.SetSanitizer(cfi, false)
}
} else {
}
if mctx.AConfig().EmbeddedInMake() && !mctx.Device() {
if isSanitizerEnabled {
modules[0].(*Module).Properties.HideFromMake = true
} else {
modules[1].(*Module).Properties.HideFromMake = true
}
}
if !mctx.AConfig().EmbeddedInMake() || !mctx.Device() {
if isSanitizerEnabled {
modules[0].(*Module).Properties.PreventInstall = true
} else {
modules[1].(*Module).Properties.PreventInstall = true
}
}
if mctx.AConfig().EmbeddedInMake() {
if !mctx.Device() {
if isSanitizerEnabled {
modules[0].(*Module).Properties.HideFromMake = true
} else {
modules[1].(*Module).Properties.HideFromMake = true
}
}
}
}
c.sanitize.Properties.SanitizeDep = false
}