diff --git a/third_party/flatbuffers/flatbuffer.gni b/third_party/flatbuffers/flatbuffer.gni index 59b1a15304b09..9c6a1379af8e2 100644 --- a/third_party/flatbuffers/flatbuffer.gni +++ b/third_party/flatbuffers/flatbuffer.gni @@ -25,6 +25,10 @@ # fail it will try to load relative to the directory of the schema file # 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) # Additional dependencies. # @@ -90,6 +94,10 @@ template("flatbuffer") { } } + if (defined(invoker.mutable) && invoker.mutable) { + args += [ "--gen-mutable" ] + } + args += [ "{{source}}" ] # The deps may have steps that have to run before running flatc.