bp2build support for instruction_set

Convert `instruction_set: "arm"` to an
"arm_isa_arm" bazel feature.

Bug: 215719349
Test: go tests
Change-Id: Ib976d23d2a57e8c0ab5d83ec994a0b7f3c69a7fe
This commit is contained in:
Cole Faust
2022-08-22 14:31:04 -07:00
parent 537112c693
commit 5fa4e961fb
4 changed files with 74 additions and 4 deletions

View File

@@ -2566,3 +2566,29 @@ cc_library {
},
})
}
func TestCcLibraryWithInstructionSet(t *testing.T) {
runCcLibraryTestCase(t, Bp2buildTestCase{
ModuleTypeUnderTest: "cc_library",
ModuleTypeUnderTestFactory: cc.LibraryFactory,
Blueprint: `cc_library {
name: "foo",
arch: {
arm: {
instruction_set: "arm",
}
}
}
`,
ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
"features": `select({
"//build/bazel/platforms/arch:arm": [
"arm_isa_arm",
"-arm_isa_thumb",
],
"//conditions:default": [],
})`,
"local_includes": `["."]`,
}),
})
}