Reexport whole_static_libs in cc_library_headers

Fixes: 236268577
Test: Unit Tests
Change-Id: I3a13f850d1d593b90c79f668f1eaf5be0035db1f
This commit is contained in:
Trevor Radcliffe
2022-08-18 15:53:00 +00:00
parent 6e294b496e
commit 7f897fcef0
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,