Support multiple fbs files & no root types in static flatbuffers
In order to improve parity with the existing flatbuffer bazel rules, add
support for:
* Multiple srcs files.
* Generating code for files where no root_type has been specified.
Change-Id: I77d909978fd0bf5125b9e789162c7b629d0fe00d
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/flatbuffers/static_flatbuffers.h b/aos/flatbuffers/static_flatbuffers.h
index 47d79e6..6a5f800 100644
--- a/aos/flatbuffers/static_flatbuffers.h
+++ b/aos/flatbuffers/static_flatbuffers.h
@@ -31,7 +31,11 @@
// Produces generated code for all flatbuffer tables in the file corresponding
// to the provided Schema object.
-std::string GenerateCodeForRootTableFile(const reflection::Schema *schema);
+// file_hint is the name of the file that we should be generating code for; this
+// is used if there is no root table specified for the fbs file so that we can
+// infer which objects to generate code for.
+std::string GenerateCodeForRootTableFile(const reflection::Schema *schema,
+ std::string_view file_hint);
// Helper functions to generate the code for individual objects; primarily
// exposed for testing.