From c7846f38fae79618ae187eba41d11b5d8812d246 Mon Sep 17 00:00:00 2001 From: Jingwen Chen Date: Thu, 18 Mar 2021 05:16:10 -0400 Subject: [PATCH] bp2build: cc_library_headers converter should only include that module type Test: bp2build; bazel build //bionic/... Change-Id: I34768b51098c5b801e7c6d9b3a95ec0f37c3bb09 --- cc/library_headers.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cc/library_headers.go b/cc/library_headers.go index dc851a59c..115b775b4 100644 --- a/cc/library_headers.go +++ b/cc/library_headers.go @@ -90,16 +90,12 @@ func CcLibraryHeadersBp2Build(ctx android.TopDownMutatorContext) { return } - lib, ok := module.linker.(*libraryDecorator) - if !ok { - // Not a cc_library module - return - } - if !lib.header() { - // Not a cc_library_headers module + if ctx.ModuleType() != "cc_library_headers" { return } + lib, _ := module.linker.(*libraryDecorator) + // list of directories that will be added to the include path (using -I) for this // module and any module that links against this module. includeDirs := lib.flagExporter.Properties.Export_system_include_dirs