diff --git a/src/google/protobuf/compiler/objectivec/generator.cc b/src/google/protobuf/compiler/objectivec/generator.cc index 32d11f28f5..c467c20b77 100644 --- a/src/google/protobuf/compiler/objectivec/generator.cc +++ b/src/google/protobuf/compiler/objectivec/generator.cc @@ -319,10 +319,12 @@ bool ObjectiveCGenerator::GenerateAll( } } - // Multi source generation forces off the use of fwd decls in favor of - // imports. + // Multi source generation forces: + // - off the use of fwd decls in favor of imports + // - on the minimal imports support if (generation_options.experimental_multi_source_generation) { generation_options.headers_use_forward_declarations = false; + generation_options.generate_minimal_imports = true; } if (generation_options.experimental_strip_nonfunctional_codegen) { generation_options.generate_minimal_imports = true; diff --git a/src/google/protobuf/compiler/objectivec/options.h b/src/google/protobuf/compiler/objectivec/options.h index b852ca09c8..c1d4afa79d 100644 --- a/src/google/protobuf/compiler/objectivec/options.h +++ b/src/google/protobuf/compiler/objectivec/options.h @@ -43,16 +43,14 @@ struct GenerationOptions { std::string generate_for_named_framework; std::string named_framework_to_proto_path_mappings_path; std::string runtime_import_prefix; - // TODO(thomasvl): Eventually flip this default to false for better interop - // with Swift if proto usages span modules made from ObjC sources. - bool headers_use_forward_declarations = true; - // TODO(thomasvl): Removing this so there is one less path to validate in - // code generation. + + bool headers_use_forward_declarations = false; bool strip_custom_options = true; - // TODO(thomasvl): Eventually flip this default to true. - bool generate_minimal_imports = false; + bool generate_minimal_imports = true; + + // These are experiments that are not officially supported. They can change + // in behavior or go away at any time. bool experimental_multi_source_generation = false; - // This is used by some of the protobuf infrastructure. bool experimental_strip_nonfunctional_codegen = false; };