bp2build: Handle export_generated_header property

The generated_header property resides in BaseCompilerProperties, while
export_generated_header resides in BaseLinkerProperties. Previously
bp2build handled these property structs separately; however, these two
related properties residing in separate structs requires restructuring
the code to allow access to both BaseCompilerProperties and
BaseLinkerProperties for a single axis/configuration combination to
resolve which generated headers are exported/not for the
axis/configuration..

Test: go test soong tests
Test: build/bazel/ci/bp2build.sh
Change-Id: Id150003637fd19d87e8dc5d6941e9f36dc4031dd
This commit is contained in:
Liz Kammer
2021-10-19 13:56:10 -04:00
parent e852d69f88
commit e6583482a8
7 changed files with 325 additions and 308 deletions

View File

@@ -997,14 +997,21 @@ genrule {
cmd: "nothing to see here",
}
genrule {
name: "export_generated_hdr",
cmd: "nothing to see here",
}
cc_library_static {
name: "foo_static",
srcs: ["cpp_src.cpp", "as_src.S", "c_src.c"],
generated_headers: ["generated_hdr"],
generated_headers: ["generated_hdr", "export_generated_hdr"],
export_generated_headers: ["export_generated_hdr"],
include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
hdrs = [":export_generated_hdr"],
srcs = [
"cpp_src.cpp",
":generated_hdr",