Commit e1f913d7 authored by Fish Lin's avatar Fish Lin Committed by Commit Bot

Let flatbuffer.gni supports to generate mutable header

This change adds a "mutable" option to flatbuffer template,
let it using "--gen-mutable" flag to compile flatbuffer with
non-const accessors for mutating FlatBuffers in-place.

Bug: 1149150
Test: Compile flatbuffer see if it generates mutable header
Change-Id: I42ce7dfcac5ee8496db56548391b205d0b056aa3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2534550
Commit-Queue: Fish Lin <linfish@google.com>
Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827709}
parent 70737268
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
# fail it will try to load relative to the directory of the schema file # fail it will try to load relative to the directory of the schema file
# being parsed. # being parsed.
# #
# mutable (optional)
# Boolean to compile flatbuffers with the "--gen-mutable" argument, which
# generates non-const accessors for mutating FlatBuffers in-place.
#
# deps (optional) # deps (optional)
# Additional dependencies. # Additional dependencies.
# #
...@@ -90,6 +94,10 @@ template("flatbuffer") { ...@@ -90,6 +94,10 @@ template("flatbuffer") {
} }
} }
if (defined(invoker.mutable) && invoker.mutable) {
args += [ "--gen-mutable" ]
}
args += [ "{{source}}" ] args += [ "{{source}}" ]
# The deps may have steps that have to run before running flatc. # The deps may have steps that have to run before running flatc.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment