Import foxglove schemas repo
This has to do a couple of things:
* Actually import the repo as an http_archive.
* Modify the cc_static_flatbuffer rule to allow it to handle a
flatbuffer target with multiple fbs files.
* Move foxglove-related third_party files into one directory.
Change-Id: I0123fc8037b107019f9c29b781418c9a03639eca
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/aos/flatbuffers.bzl b/aos/flatbuffers.bzl
index 3db4ca0..c26906a 100644
--- a/aos/flatbuffers.bzl
+++ b/aos/flatbuffers.bzl
@@ -1,16 +1,18 @@
-def cc_static_flatbuffer(name, target, function, visibility = None):
+def cc_static_flatbuffer(name, target, function, bfbs_name = None, visibility = None):
"""Creates a cc_library which encodes a file as a Span.
args:
target, The file to encode.
function, The inline function, with full namespaces, to create.
+ bfbs_name, For flatbuffer targets that have multiple fbs files, this
+ specifies the basename of the bfbs file to generate a schema for.
"""
native.genrule(
name = name + "_gen",
tools = ["@org_frc971//aos:flatbuffers_static"],
srcs = [target],
outs = [name + ".h"],
- cmd = "$(location @org_frc971//aos:flatbuffers_static) $(SRCS) $(OUTS) '" + function + "'",
+ cmd = "$(location @org_frc971//aos:flatbuffers_static) '$(SRCS)' $(OUTS) '" + function + "' " + (bfbs_name if bfbs_name else "-"),
)
native.cc_library(