Skip to content

Commit

Permalink
pw_protobuf_compiler: GN no oneof callbacks
Browse files Browse the repository at this point in the history
Allow downstream GN based project to keep using the old oneof
interfaces.

Change-Id: Iaec07014ddf8653ab49ab01429967922b932449e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/245272
Commit-Queue: Alexei Frolov <[email protected]>
Docs-Not-Needed: Alexei Frolov <[email protected]>
Reviewed-by: Alexei Frolov <[email protected]>
Lint: Lint 🤖 <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
  • Loading branch information
Jason0214 authored and CQ Bot Account committed Oct 29, 2024
1 parent 33cc5e1 commit 2051716
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pw_protobuf_compiler/proto.gni
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ template("_pw_invoke_protoc") {
if (pw_protobuf_compiler_NO_GENERIC_OPTIONS_FILES) {
args += [ "--pwpb-no-generic-options-files" ]
}
if (pw_protobuf_compiler_NO_ONEOF_CALLBACKS) {
args += [ "--pwpb-no-oneof-callbacks" ]
}
if (pw_protobuf_compiler_PROTOC_TARGET != "") {
assert(
pw_protobuf_compiler_PROTOC_BINARY != "",
Expand Down
4 changes: 4 additions & 0 deletions pw_protobuf_compiler/toolchain.gni
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ declare_args() {
# If true, requires the use of the `.pwpb_options` extensions for pw_protobuf
# options files. If false, allows the generic `.options` to be used as well.
pw_protobuf_compiler_NO_GENERIC_OPTIONS_FILES = false

# If true, disables using callback interfaces for oneof fields, and keep the
# legacy "oneof as struct member" interface.
pw_protobuf_compiler_NO_ONEOF_CALLBACKS = false
}

0 comments on commit 2051716

Please sign in to comment.