diff --git a/cc/bp2build.go b/cc/bp2build.go index 19855fab8..5c2523cc8 100644 --- a/cc/bp2build.go +++ b/cc/bp2build.go @@ -828,22 +828,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 diff --git a/cc/library.go b/cc/library.go index fdbbccbe7..8f8e0384b 100644 --- a/cc/library.go +++ b/cc/library.go @@ -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 @@ -2450,7 +2450,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 diff --git a/cc/library_headers.go b/cc/library_headers.go index 41ebcc766..cdeb39264 100644 --- a/cc/library_headers.go +++ b/cc/library_headers.go @@ -122,7 +122,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{ diff --git a/cc/prebuilt.go b/cc/prebuilt.go index f54c6f8d6..57f729989 100644 --- a/cc/prebuilt.go +++ b/cc/prebuilt.go @@ -354,7 +354,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,