bp2build: support full/lite protos in cc libs

Test: bp2build.sh
Bug: 200601772
Change-Id: I3a7e00546726bc63b5eb8d5604557c5988a5320b
This commit is contained in:
Liz Kammer
2021-09-28 09:19:17 -04:00
parent a9351ef6e6
commit 12615dbbca
13 changed files with 605 additions and 96 deletions

View File

@@ -1419,3 +1419,27 @@ cc_library_static {
},
})
}
func TestCcLibraryStaticProto(t *testing.T) {
runCcLibraryStaticTestCase(t, bp2buildTestCase{
blueprint: soongCcProtoPreamble + `cc_library_static {
name: "foo",
srcs: ["foo.proto"],
proto: {
canonical_path_from_root: false,
export_proto_headers: true,
},
include_build_directory: false,
}`,
expectedBazelTargets: []string{
makeBazelTarget("proto_library", "foo_proto", attrNameToString{
"srcs": `["foo.proto"]`,
}), makeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", attrNameToString{
"deps": `[":foo_proto"]`,
}), makeBazelTarget("cc_library_static", "foo", attrNameToString{
"deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":foo_cc_proto_lite"]`,
}),
},
})
}