diff --git a/objectivec/BUILD.bazel b/objectivec/BUILD.bazel index 87f1ec04d1..1079838069 100644 --- a/objectivec/BUILD.bazel +++ b/objectivec/BUILD.bazel @@ -7,11 +7,9 @@ load(":defs.bzl", "objc_proto_camel_case_name") # The WKTs have to be checked in to support the CocoaPods and Xcode builds. This # generule and test ensure the source are current. # -# Within the ":objectivec" target, the outputs of the genrule are then used to -# ensure they are always "current". This implementation is basically the same -# has how the WKTs are handled in src/google/protobuf/BUILD.bazel for the C++ -# version. They share the potential downsides around layer checks and that -# someone could #include the header with the `wkt/` prefix on the name. +# TODO: Improve the bazel build so it uses these generated headers so it is +# always current, and only the builds that can't easily build protoc and +# generate the files rely on the checked in ones. _WELL_KNOWN_TYPES = [ "any", @@ -62,6 +60,16 @@ staleness_test( objc_library( name = "objectivec", hdrs = [ + "GPBAny.pbobjc.h", + "GPBApi.pbobjc.h", + "GPBDuration.pbobjc.h", + "GPBEmpty.pbobjc.h", + "GPBFieldMask.pbobjc.h", + "GPBSourceContext.pbobjc.h", + "GPBStruct.pbobjc.h", + "GPBTimestamp.pbobjc.h", + "GPBType.pbobjc.h", + "GPBWrappers.pbobjc.h", "GPBArray.h", "GPBBootstrap.h", "GPBCodedInputStream.h", @@ -102,30 +110,39 @@ objc_library( "GPBUnknownFieldSet_PackagePrivate.h", "GPBUnknownField_PackagePrivate.h", "GPBUtilities_PackagePrivate.h", - ] + ["wkt/GPB" + wkt + ".pbobjc.h" for wkt in _OBJC_WKT_NAMES], + ], copts = [ "-Wno-vla", ], includes = [ ".", - "wkt", ], non_arc_srcs = [ + "GPBAny.pbobjc.m", + "GPBApi.pbobjc.m", "GPBArray.m", "GPBCodedInputStream.m", "GPBCodedOutputStream.m", "GPBDescriptor.m", "GPBDictionary.m", + "GPBDuration.pbobjc.m", + "GPBEmpty.pbobjc.m", "GPBExtensionInternals.m", "GPBExtensionRegistry.m", + "GPBFieldMask.pbobjc.m", "GPBMessage.m", "GPBRootObject.m", + "GPBSourceContext.pbobjc.m", + "GPBStruct.pbobjc.m", + "GPBTimestamp.pbobjc.m", + "GPBType.pbobjc.m", "GPBUnknownField.m", "GPBUnknownFieldSet.m", "GPBUtilities.m", "GPBWellKnownTypes.m", "GPBWireFormat.m", - ] + ["wkt/GPB" + wkt + ".pbobjc.m" for wkt in _OBJC_WKT_NAMES], + "GPBWrappers.pbobjc.m", + ], target_compatible_with = select({ "@platforms//os:macos": [], "@platforms//os:ios": [],