From b977cf5c7e2a4d13fbd0ec03b3f4dfffd880c576 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Thu, 9 Feb 2023 12:02:43 -0800 Subject: [PATCH] Mark some targets with target_compatible_with. objc_library really will only build for Apple platforms, so tag it as such. The objc conformance test really will only build/run on macOS, so tag it as such. With these two changes, it should be safer for recursive builds that include this directory no matter what the host platform is. PiperOrigin-RevId: 508438744 --- objectivec/BUILD.bazel | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/objectivec/BUILD.bazel b/objectivec/BUILD.bazel index 612667c01f..1c45357462 100644 --- a/objectivec/BUILD.bazel +++ b/objectivec/BUILD.bazel @@ -88,6 +88,13 @@ objc_library( "GPBWireFormat.m", "GPBWrappers.pbobjc.m", ], + target_compatible_with = select({ + "@platforms//os:macos": [], + "@platforms//os:ios": [], + "@platforms//os:tvos": [], + "@platforms//os:watchos": [], + "//conditions:default": ["@platforms//:incompatible"], + }), visibility = ["//visibility:public"], ) @@ -99,6 +106,7 @@ conformance_test( name = "conformance_test", failure_list = "//conformance:failure_list_objc.txt", testee = "//conformance:conformance_objc", + target_compatible_with = ["@platforms//os:macos"], ) # -------------------------------------------------------------------