Merge "bp2build: do not convert prebuilt cc binaries"
This commit is contained in:
18
cc/cc.go
18
cc/cc.go
@@ -3453,19 +3453,27 @@ var _ snapshot.RelativeInstallPath = (*Module)(nil)
|
||||
|
||||
// ConvertWithBp2build converts Module to Bazel for bp2build.
|
||||
func (c *Module) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
|
||||
prebuilt := c.IsPrebuilt()
|
||||
if c.Binary() {
|
||||
binaryBp2build(ctx, c, ctx.ModuleType())
|
||||
if !prebuilt {
|
||||
binaryBp2build(ctx, c, ctx.ModuleType())
|
||||
}
|
||||
} else if c.Object() {
|
||||
objectBp2Build(ctx, c)
|
||||
if !prebuilt {
|
||||
objectBp2Build(ctx, c)
|
||||
}
|
||||
} else if c.CcLibrary() {
|
||||
static := c.BuildStaticVariant()
|
||||
shared := c.BuildSharedVariant()
|
||||
prebuilt := c.IsPrebuilt()
|
||||
|
||||
if static && shared {
|
||||
libraryBp2Build(ctx, c)
|
||||
if !prebuilt {
|
||||
libraryBp2Build(ctx, c)
|
||||
}
|
||||
} else if !static && !shared {
|
||||
libraryHeadersBp2Build(ctx, c)
|
||||
if !prebuilt {
|
||||
libraryHeadersBp2Build(ctx, c)
|
||||
}
|
||||
} else if static {
|
||||
if prebuilt {
|
||||
prebuiltLibraryStaticBp2Build(ctx, c)
|
||||
|
@@ -552,7 +552,7 @@ func prebuiltBinaryFactory() android.Module {
|
||||
}
|
||||
|
||||
func NewPrebuiltBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
|
||||
module, binary := NewBinary(hod)
|
||||
module, binary := newBinary(hod, false)
|
||||
module.compiler = nil
|
||||
|
||||
prebuilt := &prebuiltBinaryLinker{
|
||||
|
Reference in New Issue
Block a user