Merge "Reexport whole_static_libs in cc_library_headers"

This commit is contained in:
Trevor Radcliffe 2022-08-22 20:39:08 +00:00 committed by Gerrit Code Review
commit 218dae74b1
2 changed files with 22 additions and 0 deletions

View file

@ -390,3 +390,24 @@ cc_library_headers {
},
})
}
func TestCcLibraryHeadersWholeStaticLibsReexported(t *testing.T) {
runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
Description: "cc_library_headers whole_static_libs is reexported",
ModuleTypeUnderTest: "cc_library_headers",
ModuleTypeUnderTestFactory: cc.LibraryHeaderFactory,
Filesystem: map[string]string{},
Blueprint: soongCcLibraryHeadersPreamble + `
cc_library_headers {
name: "foo_headers",
whole_static_libs: ["foo_export"],
bazel_module: { bp2build_available: true },
}
` + simpleModuleDoNotConvertBp2build("cc_library_headers", "foo_export"),
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
"deps": `[":foo_export"]`,
}),
},
})
}

View file

@ -126,6 +126,7 @@ func libraryHeadersBp2Build(ctx android.TopDownMutatorContext, module *Module) {
exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, &baseAttributes.includes)
linkerAttrs := baseAttributes.linkerAttributes
(&linkerAttrs.deps).Append(linkerAttrs.dynamicDeps)
(&linkerAttrs.deps).Append(linkerAttrs.wholeArchiveDeps)
attrs := &bazelCcLibraryHeadersAttributes{
Export_includes: exportedIncludes.Includes,