Handle restricting to device only builds

By default, most module types are only enabled for device. Converting
this behavior and host_supported/device_supported properties allows us
to skip building incompatible targets.

Test: soong tests
Test: bp2build.sh
Change-Id: If1da523b4cc8c4cbf2bb26da063d9923b662cc32
This commit is contained in:
Liz Kammer
2022-05-13 17:20:20 -04:00
parent 0e3d36c582
commit dfeb120324
11 changed files with 454 additions and 133 deletions

View File

@@ -2278,6 +2278,7 @@ func TestCcLibraryDisabledArchAndTarget(t *testing.T) {
blueprint: soongCcProtoPreamble + `cc_library {
name: "foo",
srcs: ["foo.cpp"],
host_supported: true,
target: {
darwin: {
enabled: false,
@@ -2313,6 +2314,7 @@ func TestCcLibraryDisabledArchAndTargetWithDefault(t *testing.T) {
name: "foo",
srcs: ["foo.cpp"],
enabled: false,
host_supported: true,
target: {
darwin: {
enabled: true,
@@ -2377,6 +2379,7 @@ func TestCcLibraryStaticDisabledForSomeArch(t *testing.T) {
moduleTypeUnderTestFactory: cc.LibraryFactory,
blueprint: soongCcProtoPreamble + `cc_library {
name: "foo",
host_supported: true,
srcs: ["foo.cpp"],
shared: {
enabled: false