diff options
author | Paul Duffin <paulduffin@google.com> | 2020-02-21 16:29:57 +0000 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2020-02-24 14:49:22 +0000 |
commit | 91756d2498fd84e566cd1e805231476072e343a8 (patch) | |
tree | 032218e6629cdf69258d418b65997321fc58ffcf /cc/library_sdk_member.go | |
parent | a78f3a7360336cd8a9245d2242dbbb8d84971ba7 (diff) | |
download | soong-91756d2498fd84e566cd1e805231476072e343a8.tar.gz |
Add support for cc_library_headers in sdk/module_exports
Bug: 148933848
Test: m nothing
Change-Id: Ife6ee0f736238727a11b4421532eaeb29d46c1b7
Diffstat (limited to 'cc/library_sdk_member.go')
-rw-r--r-- | cc/library_sdk_member.go | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/cc/library_sdk_member.go b/cc/library_sdk_member.go index ff292ebc6..a36917eda 100644 --- a/cc/library_sdk_member.go +++ b/cc/library_sdk_member.go @@ -65,12 +65,19 @@ func (mt *librarySdkMemberType) AddDependencies(mctx android.BottomUpMutatorCont if version == "" { version = LatestStubsVersionFor(mctx.Config(), name) } - for _, linkType := range mt.linkTypes { + if mt.linkTypes == nil { mctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{ {Mutator: "image", Variation: android.CoreVariation}, - {Mutator: "link", Variation: linkType}, {Mutator: "version", Variation: version}, }...), dependencyTag, name) + } else { + for _, linkType := range mt.linkTypes { + mctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{ + {Mutator: "image", Variation: android.CoreVariation}, + {Mutator: "link", Variation: linkType}, + {Mutator: "version", Variation: version}, + }...), dependencyTag, name) + } } } } @@ -207,10 +214,14 @@ func (info *nativeLibInfo) generatePrebuiltLibrary(sdkModuleContext android.Modu for _, av := range info.archVariantProperties { archTypeProperties := archProperties.AddPropertySet(av.archType) - // Copy the generated library to the snapshot and add a reference to it in the .bp module. - nativeLibraryPath := nativeLibraryPathFor(av) - builder.CopyToSnapshot(av.outputFile, nativeLibraryPath) - archTypeProperties.AddProperty("srcs", []string{nativeLibraryPath}) + // If the library has some link types then it produces an output binary file, otherwise it + // is header only. + if info.memberType.linkTypes != nil { + // Copy the generated library to the snapshot and add a reference to it in the .bp module. + nativeLibraryPath := nativeLibraryPathFor(av) + builder.CopyToSnapshot(av.outputFile, nativeLibraryPath) + archTypeProperties.AddProperty("srcs", []string{nativeLibraryPath}) + } // Add any arch specific properties inside the appropriate arch: {<arch>: {...}} block addPossiblyArchSpecificProperties(sdkModuleContext, builder, av, archTypeProperties) |