aboutsummaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2018-04-03 13:22:50 -0700
committerYifan Hong <elsk@google.com>2018-04-03 16:15:37 -0700
commitd452a42d9dadca384e50f309b05b586507c29b20 (patch)
treed218ec6bfcaa95dfc5cc441e3c6007e19097b8fa /cc
parentc41090955097759212ae6055e76dc8af17823102 (diff)
downloadbuild_soong-d452a42d9dadca384e50f309b05b586507c29b20.tar.gz
build_soong-d452a42d9dadca384e50f309b05b586507c29b20.tar.bz2
build_soong-d452a42d9dadca384e50f309b05b586507c29b20.zip
Add overrides to cc_binary
Test: use it for healthd, it is not installed. Bug: 77541952 Change-Id: I170a31d1b4d15f20de6a6b6279a2eeda49ca7447 Merged-In: I170a31d1b4d15f20de6a6b6279a2eeda49ca7447
Diffstat (limited to 'cc')
-rw-r--r--cc/androidmk.go4
-rw-r--r--cc/binary.go7
2 files changed, 11 insertions, 0 deletions
diff --git a/cc/androidmk.go b/cc/androidmk.go
index 56ff713c..9bcb7835 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -228,6 +228,10 @@ func (binary *binaryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.Andr
if binary.coverageOutputFile.Valid() {
fmt.Fprintln(w, "LOCAL_PREBUILT_COVERAGE_ARCHIVE :=", binary.coverageOutputFile.String())
}
+
+ if len(binary.Properties.Overrides) > 0 {
+ fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES := "+strings.Join(binary.Properties.Overrides, " "))
+ }
})
}
diff --git a/cc/binary.go b/cc/binary.go
index 7794eab6..c3e899a0 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -45,6 +45,13 @@ type BinaryLinkerProperties struct {
No_pie *bool `android:"arch_variant"`
DynamicLinker string `blueprint:"mutated"`
+
+ // Names of modules to be overridden. Listed modules can only be other binaries
+ // (in Make or Soong).
+ // This does not completely prevent installation of the overridden binaries, but if both
+ // binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
+ // from PRODUCT_PACKAGES.
+ Overrides []string
}
func init() {