Skip to content

protoc - command line option to override the 'optimize_for' option for a particular run #487

Closed
@noisypants

Description

Hello,
I'd like to be able to have one proto file that can be optimized for lite runtime or not based on the command line used to generate the code.

use case:

  • proto file shared between a java server and a c# client.
  • The server doesn't want a lite runtime as it needs reflection
  • The client would use the lite runtime as it's resource restricted and doesn't need the reflection apis.

Right now, there are a few options to achieve what i need:

  • copy the proto file and stamp in the 'optimize_for' setting that you need and then run protoc on the copy
  • run the proto file through a preprocessor before passing to protoc.

My goal would be to not have to edit the proto files in anyway between client and server.

All this is assuming that the serialized formats of the lite runtime vs non-lite runtime are compatible (binary & json).

If there's another way to achieve my goal, please let me know.

Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions