bp2build support for instruction_set
Convert `instruction_set: "arm"` to an
"arm_isa_arm" bazel feature.
Bug: 215719349
Test: go tests
Change-Id: Ib976d23d2a57e8c0ab5d83ec994a0b7f3c69a7fe
diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go
index 72feed5..2d1a7ce 100644
--- a/bp2build/cc_library_conversion_test.go
+++ b/bp2build/cc_library_conversion_test.go
@@ -2566,3 +2566,29 @@
},
})
}
+
+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": `["."]`,
+ }),
+ })
+}