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

@@ -581,3 +581,32 @@ cc_library {
},
})
}
func TestCcBinaryWithInstructionSet(t *testing.T) {
runCcBinaryTests(t, ccBinaryBp2buildTestCase{
description: "instruction set",
blueprint: `
{rule_name} {
name: "foo",
arch: {
arm: {
instruction_set: "arm",
}
}
}
`,
targets: []testBazelTarget{
{"cc_binary", "foo", AttrNameToString{
"features": `select({
"//build/bazel/platforms/arch:arm": [
"arm_isa_arm",
"-arm_isa_thumb",
],
"//conditions:default": [],
})`,
"local_includes": `["."]`,
},
},
},
})
}