Merge "Remove library decorator for extracting headers"
This commit is contained in:
commit
707f65d3d5
4 changed files with 5 additions and 20 deletions
|
@ -835,22 +835,7 @@ type BazelIncludes struct {
|
|||
SystemIncludes bazel.StringListAttribute
|
||||
}
|
||||
|
||||
func bp2BuildParseExportedIncludes(ctx android.BazelConversionPathContext, module *Module, existingIncludes BazelIncludes) BazelIncludes {
|
||||
libraryDecorator := module.linker.(*libraryDecorator)
|
||||
return bp2BuildParseExportedIncludesHelper(ctx, module, libraryDecorator, &existingIncludes)
|
||||
}
|
||||
|
||||
// Bp2buildParseExportedIncludesForPrebuiltLibrary returns a BazelIncludes with Bazel-ified values
|
||||
// to export includes from the underlying module's properties.
|
||||
func Bp2BuildParseExportedIncludesForPrebuiltLibrary(ctx android.BazelConversionPathContext, module *Module) BazelIncludes {
|
||||
prebuiltLibraryLinker := module.linker.(*prebuiltLibraryLinker)
|
||||
libraryDecorator := prebuiltLibraryLinker.libraryDecorator
|
||||
return bp2BuildParseExportedIncludesHelper(ctx, module, libraryDecorator, nil)
|
||||
}
|
||||
|
||||
// bp2BuildParseExportedIncludes creates a string list attribute contains the
|
||||
// exported included directories of a module.
|
||||
func bp2BuildParseExportedIncludesHelper(ctx android.BazelConversionPathContext, module *Module, libraryDecorator *libraryDecorator, includes *BazelIncludes) BazelIncludes {
|
||||
func bp2BuildParseExportedIncludes(ctx android.BazelConversionPathContext, module *Module, includes *BazelIncludes) BazelIncludes {
|
||||
var exported BazelIncludes
|
||||
if includes != nil {
|
||||
exported = *includes
|
||||
|
|
|
@ -289,7 +289,7 @@ func libraryBp2Build(ctx android.TopDownMutatorContext, m *Module) {
|
|||
baseAttributes := bp2BuildParseBaseProps(ctx, m)
|
||||
compilerAttrs := baseAttributes.compilerAttributes
|
||||
linkerAttrs := baseAttributes.linkerAttributes
|
||||
exportedIncludes := bp2BuildParseExportedIncludes(ctx, m, compilerAttrs.includes)
|
||||
exportedIncludes := bp2BuildParseExportedIncludes(ctx, m, &compilerAttrs.includes)
|
||||
|
||||
srcs := compilerAttrs.srcs
|
||||
|
||||
|
@ -2446,7 +2446,7 @@ func sharedOrStaticLibraryBp2Build(ctx android.TopDownMutatorContext, module *Mo
|
|||
compilerAttrs := baseAttributes.compilerAttributes
|
||||
linkerAttrs := baseAttributes.linkerAttributes
|
||||
|
||||
exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, compilerAttrs.includes)
|
||||
exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, &compilerAttrs.includes)
|
||||
|
||||
// Append shared/static{} stanza properties. These won't be specified on
|
||||
// cc_library_* itself, but may be specified in cc_defaults that this module
|
||||
|
|
|
@ -123,7 +123,7 @@ type bazelCcLibraryHeadersAttributes struct {
|
|||
|
||||
func libraryHeadersBp2Build(ctx android.TopDownMutatorContext, module *Module) {
|
||||
baseAttributes := bp2BuildParseBaseProps(ctx, module)
|
||||
exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, baseAttributes.includes)
|
||||
exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, &baseAttributes.includes)
|
||||
linkerAttrs := baseAttributes.linkerAttributes
|
||||
|
||||
attrs := &bazelCcLibraryHeadersAttributes{
|
||||
|
|
|
@ -355,7 +355,7 @@ func prebuiltLibraryBp2Build(ctx android.TopDownMutatorContext, module *Module)
|
|||
|
||||
func prebuiltLibraryStaticBp2Build(ctx android.TopDownMutatorContext, module *Module, fullBuild bool) {
|
||||
prebuiltAttrs := Bp2BuildParsePrebuiltLibraryProps(ctx, module, true)
|
||||
exportedIncludes := Bp2BuildParseExportedIncludesForPrebuiltLibrary(ctx, module)
|
||||
exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, nil)
|
||||
|
||||
attrs := &bazelPrebuiltLibraryStaticAttributes{
|
||||
Static_library: prebuiltAttrs.Src,
|
||||
|
|
Loading…
Reference in a new issue