Enable Mixed Builds for Prebuilt Library

This change provides support for mixed builds for
cc_prebuilt_library modules and allowlists some such modules.

Fixes: 225938765
Test: Unit tests, run mixed builds and verify correctness
Change-Id: I04396c79661df6b9a43907859e4f96d0191e8e1b
This commit is contained in:
Trevor Radcliffe
2022-05-17 21:59:36 +00:00
parent 59d37c8bb6
commit 5d6fa4d857
5 changed files with 219 additions and 47 deletions

View File

@@ -1789,13 +1789,20 @@ func GetSubnameProperty(actx android.ModuleContext, c LinkableInterface) string
var _ android.MixedBuildBuildable = (*Module)(nil)
func (c *Module) getBazelModuleLabel(ctx android.BaseModuleContext) string {
var bazelModuleLabel string
if c.typ() == fullLibrary && c.static() {
// cc_library is a special case in bp2build; two targets are generated -- one for each
// of the shared and static variants. The shared variant keeps the module name, but the
// static variant uses a different suffixed name.
return bazelLabelForStaticModule(ctx, c)
bazelModuleLabel = bazelLabelForStaticModule(ctx, c)
} else {
bazelModuleLabel = c.GetBazelLabel(ctx, c)
}
return c.GetBazelLabel(ctx, c)
labelNoPrebuilt := bazelModuleLabel
if c.IsPrebuilt() {
labelNoPrebuilt = android.RemoveOptionalPrebuiltPrefixFromBazelLabel(bazelModuleLabel)
}
return labelNoPrebuilt
}
func (c *Module) QueueBazelCall(ctx android.BaseModuleContext) {