Enable code generation of custom options in C++ lite

PiperOrigin-RevId: 524037847
pull/12464/head
Adam Cozzette 2 years ago committed by Copybara-Service
parent b9e056f779
commit 0f3f1e826d
  1. 10
      src/google/protobuf/compiler/cpp/extension.cc

@ -142,16 +142,6 @@ void ExtensionGenerator::GenerateDeclaration(io::Printer* printer) const {
}
void ExtensionGenerator::GenerateDefinition(io::Printer* printer) {
// If we are building for lite with implicit weak fields, we want to skip over
// any custom options (i.e. extensions of messages from descriptor.proto).
// This prevents the creation of any unnecessary linker references to the
// descriptor messages.
if (options_.lite_implicit_weak_fields &&
descriptor_->containing_type()->file()->name() ==
"net/proto2/proto/descriptor.proto") {
return;
}
Formatter format(printer, variables_);
std::string default_str;
// If this is a class member, it needs to be declared in its class scope.

Loading…
Cancel
Save