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
diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go
index 4f720f5..662d9d1 100644
--- a/bp2build/cc_library_conversion_test.go
+++ b/bp2build/cc_library_conversion_test.go
@@ -118,6 +118,7 @@
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 @@
darwin: {
srcs: ["darwin.cpp"],
},
+ bionic: {
+ srcs: ["bionic.cpp"]
+ },
},
}
`,
@@ -190,6 +194,9 @@
"//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": [],
}),
)`}})
}