bp2build: cc_library converter for //bionic/libdl:libdl_android

This CL contains the converter for libdl_android, a cc_library that
expands into a cc_shared_library and a regular cc_library.

Test: TH
Test: bp2build; bazel test //build/bazel/tests/...

Change-Id: If70641a538211b0d6b2aac0e4d0d06912318304d
This commit is contained in:
Jingwen Chen
2021-03-24 10:04:33 -04:00
parent 190ba3ea82
commit 6393098ecf
15 changed files with 584 additions and 85 deletions

View File

@@ -113,6 +113,7 @@ func ObjectFactory() android.Module {
// For bp2build conversion.
type bazelObjectAttributes struct {
Srcs bazel.LabelListAttribute
Hdrs bazel.LabelListAttribute
Deps bazel.LabelListAttribute
Copts bazel.StringListAttribute
Asflags []string
@@ -156,16 +157,11 @@ func ObjectBp2Build(ctx android.TopDownMutatorContext) {
}
// Set arch-specific configurable attributes
var srcs bazel.LabelListAttribute
copts, srcs, hdrs := bp2BuildParseCompilerProps(ctx, m)
var localIncludeDirs []string
var asFlags []string
for _, props := range m.compiler.compilerProps() {
if baseCompilerProps, ok := props.(*BaseCompilerProperties); ok {
srcs = bazel.MakeLabelListAttribute(
android.BazelLabelForModuleSrcExcludes(
ctx,
baseCompilerProps.Srcs,
baseCompilerProps.Exclude_srcs))
localIncludeDirs = baseCompilerProps.Local_include_dirs
break
}
@@ -208,8 +204,9 @@ func ObjectBp2Build(ctx android.TopDownMutatorContext) {
attrs := &bazelObjectAttributes{
Srcs: srcs,
Hdrs: hdrs,
Deps: deps,
Copts: bp2BuildParseCflags(ctx, m),
Copts: copts,
Asflags: asFlags,
Local_include_dirs: localIncludeDirs,
}