aboutsummaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-07-08 03:38:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-07-08 03:38:53 +0000
commit687106282174c1ffc2d3b22eabb3e537aa20a728 (patch)
treebaf5f40fb3f9e6985f5fd6f1465deaeae3438aad /cc
parentda84958b15d888f3e325b50e112373150b94300d (diff)
parentfed4d19cbb22a754dc8969cc137fc0e0ee276a8e (diff)
downloadbuild_soong-687106282174c1ffc2d3b22eabb3e537aa20a728.tar.gz
build_soong-687106282174c1ffc2d3b22eabb3e537aa20a728.tar.bz2
build_soong-687106282174c1ffc2d3b22eabb3e537aa20a728.zip
Merge "Allow static/shared modules to be disabled per-arch"
Diffstat (limited to 'cc')
-rw-r--r--cc/cc.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/cc/cc.go b/cc/cc.go
index cea8cdea..66b7b4f2 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -360,11 +360,13 @@ type FlagExporterProperties struct {
type LibraryLinkerProperties struct {
Static struct {
+ Enabled *bool `android:"arch_variant"`
Whole_static_libs []string `android:"arch_variant"`
Static_libs []string `android:"arch_variant"`
Shared_libs []string `android:"arch_variant"`
} `android:"arch_variant"`
Shared struct {
+ Enabled *bool `android:"arch_variant"`
Whole_static_libs []string `android:"arch_variant"`
Static_libs []string `android:"arch_variant"`
Shared_libs []string `android:"arch_variant"`
@@ -1548,6 +1550,21 @@ type libraryLinker struct {
var _ linker = (*libraryLinker)(nil)
+func (library *libraryLinker) begin(ctx BaseModuleContext) {
+ library.baseLinker.begin(ctx)
+ if library.static() {
+ if library.Properties.Static.Enabled != nil &&
+ !*library.Properties.Static.Enabled {
+ ctx.module().Disable()
+ }
+ } else {
+ if library.Properties.Shared.Enabled != nil &&
+ !*library.Properties.Shared.Enabled {
+ ctx.module().Disable()
+ }
+ }
+}
+
func (library *libraryLinker) props() []interface{} {
props := library.baseLinker.props()
return append(props,