From 7f47d99a8d62d7ed0858dc6b733772fb1f0f44c6 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Wed, 8 Feb 2023 10:44:33 -0800 Subject: [PATCH] [ObjC] Multi source mode disables the use of fwd decls. It isn't worth the effort to try and compute the correct minimal set for each sub file, and the more Swift folks use on top of this, the less it matters as the modules will need everything anyways. PiperOrigin-RevId: 508122902 --- src/google/protobuf/compiler/objectivec/generator.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/google/protobuf/compiler/objectivec/generator.cc b/src/google/protobuf/compiler/objectivec/generator.cc index 66f625c5a2..da4689bd79 100644 --- a/src/google/protobuf/compiler/objectivec/generator.cc +++ b/src/google/protobuf/compiler/objectivec/generator.cc @@ -281,6 +281,12 @@ bool ObjectiveCGenerator::GenerateAll( } } + // Multi source generation forces off the use of fwd decls in favor of + // imports. + if (generation_options.experimental_multi_source_generation) { + generation_options.headers_use_forward_declarations = false; + } + // ----------------------------------------------------------------- // These are not official generation options and could be removed/changed in