diff options
author | 2024-05-15 23:01:54 +0900 | |
---|---|---|
committer | 2024-05-16 18:23:20 +0900 | |
commit | 3ea9b659905b72332885a4d55527f8ee4bbc1326 (patch) | |
tree | b69996e377ea4be2951779dfa0af99beaafd7854 /android/packaging.go | |
parent | 162098358cb0b1fa90a8bdc4467c2b7eff9a2499 (diff) |
filesystem modules gathers first target only
With this change, the deps property in filesystem modules gather the
first target of the filesystem module only.
To gather dependencies across both targets, use multilib.both.deps
instead.
Bug: N/A
Test: go test ./...
Change-Id: Ie2ff0c48f08c61c8b219fc2c1540476ff8e4b1fc
Diffstat (limited to 'android/packaging.go')
-rw-r--r-- | android/packaging.go | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/android/packaging.go b/android/packaging.go index 383f828bd..080dcfea0 100644 --- a/android/packaging.go +++ b/android/packaging.go @@ -142,6 +142,10 @@ type PackagingBase struct { // for rare cases like when there's a dependency to a module which exists in certain repo // checkouts, this is needed. IgnoreMissingDependencies bool + + // If this is set to true by a module type inheriting PackagingBase, the deps property + // collects the first target only even with compile_multilib: true. + DepsCollectFirstTargetOnly bool } type depsProperty struct { @@ -154,6 +158,7 @@ type packagingMultilibProperties struct { Common depsProperty `android:"arch_variant"` Lib32 depsProperty `android:"arch_variant"` Lib64 depsProperty `android:"arch_variant"` + Both depsProperty `android:"arch_variant"` } type packagingArchProperties struct { @@ -194,11 +199,28 @@ func (p *PackagingBase) getDepsForArch(ctx BaseModuleContext, arch ArchType) []s ret = append(ret, p.properties.Multilib.Common.Deps...) } - for i, t := range ctx.MultiTargets() { - if t.Arch.ArchType == arch { - ret = append(ret, p.properties.Deps...) - if i == 0 { - ret = append(ret, p.properties.Multilib.First.Deps...) + if p.DepsCollectFirstTargetOnly { + if len(p.properties.Multilib.First.Deps) > 0 { + ctx.PropertyErrorf("multilib.first.deps", "not supported. use \"deps\" instead") + } + for i, t := range ctx.MultiTargets() { + if t.Arch.ArchType == arch { + ret = append(ret, p.properties.Multilib.Both.Deps...) + if i == 0 { + ret = append(ret, p.properties.Deps...) + } + } + } + } else { + if len(p.properties.Multilib.Both.Deps) > 0 { + ctx.PropertyErrorf("multilib.both.deps", "not supported. use \"deps\" instead") + } + for i, t := range ctx.MultiTargets() { + if t.Arch.ArchType == arch { + ret = append(ret, p.properties.Deps...) + if i == 0 { + ret = append(ret, p.properties.Multilib.First.Deps...) + } } } } |