diff options
author | Dan Willemsen <dwillemsen@google.com> | 2016-07-08 03:38:53 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-07-08 03:38:53 +0000 |
commit | 687106282174c1ffc2d3b22eabb3e537aa20a728 (patch) | |
tree | baf5f40fb3f9e6985f5fd6f1465deaeae3438aad /cc | |
parent | da84958b15d888f3e325b50e112373150b94300d (diff) | |
parent | fed4d19cbb22a754dc8969cc137fc0e0ee276a8e (diff) | |
download | build_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.go | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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, |