Loading cc/bp2build.go +8 −1 Original line number Diff line number Diff line Loading @@ -65,6 +65,8 @@ type staticOrSharedAttributes struct { Native_coverage *bool Apex_available []string sdkAttributes tidyAttributes Loading Loading @@ -220,7 +222,7 @@ func bp2BuildPropParseHelper(ctx android.ArchVariantContext, module *Module, pro } // Parses properties common to static and shared libraries. Also used for prebuilt libraries. func bp2buildParseStaticOrSharedProps(ctx android.BazelConversionPathContext, module *Module, _ *libraryDecorator, isStatic bool) staticOrSharedAttributes { func bp2buildParseStaticOrSharedProps(ctx android.BazelConversionPathContext, module *Module, lib *libraryDecorator, isStatic bool) staticOrSharedAttributes { attrs := staticOrSharedAttributes{} setAttrs := func(axis bazel.ConfigurationAxis, config string, props StaticOrSharedProperties) { Loading @@ -244,13 +246,16 @@ func bp2buildParseStaticOrSharedProps(ctx android.BazelConversionPathContext, mo // empty list -> no values specified attrs.System_dynamic_deps.ForceSpecifyEmptyList = true var apexAvailable []string if isStatic { apexAvailable = lib.StaticProperties.Static.Apex_available bp2BuildPropParseHelper(ctx, module, &StaticProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) { if staticOrSharedProps, ok := props.(*StaticProperties); ok { setAttrs(axis, config, staticOrSharedProps.Static) } }) } else { apexAvailable = lib.SharedProperties.Shared.Apex_available bp2BuildPropParseHelper(ctx, module, &SharedProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) { if staticOrSharedProps, ok := props.(*SharedProperties); ok { setAttrs(axis, config, staticOrSharedProps.Shared) Loading @@ -263,6 +268,8 @@ func bp2buildParseStaticOrSharedProps(ctx android.BazelConversionPathContext, mo attrs.Srcs_c = partitionedSrcs[cSrcPartition] attrs.Srcs_as = partitionedSrcs[asSrcPartition] attrs.Apex_available = android.ConvertApexAvailableToTags(apexAvailable) if !partitionedSrcs[protoSrcPartition].IsEmpty() { // TODO(b/208815215): determine whether this is used and add support if necessary ctx.ModuleErrorf("Migrating static/shared only proto srcs is not currently supported") Loading cc/library.go +2 −0 Original line number Diff line number Diff line Loading @@ -428,8 +428,10 @@ func libraryBp2Build(ctx android.TopDownMutatorContext, m *Module) { if compilerAttrs.stubsSymbolFile == nil && len(compilerAttrs.stubsVersions.Value) == 0 { tagsForStaticVariant = android.ApexAvailableTags(m) } tagsForStaticVariant.Append(bazel.StringListAttribute{Value: staticAttrs.Apex_available}) tagsForSharedVariant := android.ApexAvailableTags(m) tagsForSharedVariant.Append(bazel.StringListAttribute{Value: sharedAttrs.Apex_available}) ctx.CreateBazelTargetModuleWithRestrictions(staticProps, android.CommonAttributes{ Loading Loading
cc/bp2build.go +8 −1 Original line number Diff line number Diff line Loading @@ -65,6 +65,8 @@ type staticOrSharedAttributes struct { Native_coverage *bool Apex_available []string sdkAttributes tidyAttributes Loading Loading @@ -220,7 +222,7 @@ func bp2BuildPropParseHelper(ctx android.ArchVariantContext, module *Module, pro } // Parses properties common to static and shared libraries. Also used for prebuilt libraries. func bp2buildParseStaticOrSharedProps(ctx android.BazelConversionPathContext, module *Module, _ *libraryDecorator, isStatic bool) staticOrSharedAttributes { func bp2buildParseStaticOrSharedProps(ctx android.BazelConversionPathContext, module *Module, lib *libraryDecorator, isStatic bool) staticOrSharedAttributes { attrs := staticOrSharedAttributes{} setAttrs := func(axis bazel.ConfigurationAxis, config string, props StaticOrSharedProperties) { Loading @@ -244,13 +246,16 @@ func bp2buildParseStaticOrSharedProps(ctx android.BazelConversionPathContext, mo // empty list -> no values specified attrs.System_dynamic_deps.ForceSpecifyEmptyList = true var apexAvailable []string if isStatic { apexAvailable = lib.StaticProperties.Static.Apex_available bp2BuildPropParseHelper(ctx, module, &StaticProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) { if staticOrSharedProps, ok := props.(*StaticProperties); ok { setAttrs(axis, config, staticOrSharedProps.Static) } }) } else { apexAvailable = lib.SharedProperties.Shared.Apex_available bp2BuildPropParseHelper(ctx, module, &SharedProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) { if staticOrSharedProps, ok := props.(*SharedProperties); ok { setAttrs(axis, config, staticOrSharedProps.Shared) Loading @@ -263,6 +268,8 @@ func bp2buildParseStaticOrSharedProps(ctx android.BazelConversionPathContext, mo attrs.Srcs_c = partitionedSrcs[cSrcPartition] attrs.Srcs_as = partitionedSrcs[asSrcPartition] attrs.Apex_available = android.ConvertApexAvailableToTags(apexAvailable) if !partitionedSrcs[protoSrcPartition].IsEmpty() { // TODO(b/208815215): determine whether this is used and add support if necessary ctx.ModuleErrorf("Migrating static/shared only proto srcs is not currently supported") Loading
cc/library.go +2 −0 Original line number Diff line number Diff line Loading @@ -428,8 +428,10 @@ func libraryBp2Build(ctx android.TopDownMutatorContext, m *Module) { if compilerAttrs.stubsSymbolFile == nil && len(compilerAttrs.stubsVersions.Value) == 0 { tagsForStaticVariant = android.ApexAvailableTags(m) } tagsForStaticVariant.Append(bazel.StringListAttribute{Value: staticAttrs.Apex_available}) tagsForSharedVariant := android.ApexAvailableTags(m) tagsForSharedVariant.Append(bazel.StringListAttribute{Value: sharedAttrs.Apex_available}) ctx.CreateBazelTargetModuleWithRestrictions(staticProps, android.CommonAttributes{ Loading