| # Copyright 2020 The IREE Authors |
| # Licensed under the Apache License v2.0 with LLVM Exceptions. |
| # See https://llvm.org/LICENSE.txt for license information. |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| """Generates FlatBuffer source files with flatcc.""" |
| def iree_flatbuffer_c_library( |
| flatcc_args = ["--common", "--reader"], |
| flatcc = "@com_github_dvidelabs_flatcc//:flatcc" |
| out_stem = "%s" % (srcs[0].replace(".fbs", "")) |
| outs.append("%s_reader.h" % (out_stem)) |
| outs.append("%s_builder.h" % (out_stem)) |
| outs.append("%s_verifier.h" % (out_stem)) |
| outs.append("%s_json_parser.h" % (out_stem)) |
| outs.append("%s_json_printer.h" % (out_stem)) |
| cmd = "$(location %s) %s $(SRCS)" % (flatcc, " ".join(flags)), |