Handle target.bionic in bp2build.

Soong supports some hand-crafted target.<type> that match multiple os or
arch types to simplify configuring for similar targets. target.bionic is
used to match on both android and linux_bionic OSes for cases where they
should be handled the same way.

Test: build/bazel/ci/bp2build.sh
Change-Id: I47b6aaf3279e4d242c4fd0e12f24117eb98e0665
This commit is contained in:
Liz Kammer
2021-07-16 16:33:47 -04:00
parent 393bffee78
commit 01a16e8275
4 changed files with 34 additions and 8 deletions

View File

@@ -118,6 +118,7 @@ func TestCcLibrarySimple(t *testing.T) {
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
filesystem: map[string]string{
"android.cpp": "",
"bionic.cpp": "",
"darwin.cpp": "",
// Refer to cc.headerExts for the supported header extensions in Soong.
"header.h": "",
@@ -164,6 +165,9 @@ cc_library {
darwin: {
srcs: ["darwin.cpp"],
},
bionic: {
srcs: ["bionic.cpp"]
},
},
}
`,
@@ -190,6 +194,9 @@ cc_library {
"//build/bazel/platforms/os:darwin": ["darwin.cpp"],
"//build/bazel/platforms/os:linux": ["linux.cpp"],
"//conditions:default": [],
}) + select({
"//build/bazel/platforms/os:bionic": ["bionic.cpp"],
"//conditions:default": [],
}),
)`}})
}