• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1licenses(["notice"])
2
3load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
4
5package(
6    default_visibility = ["//visibility:public"],
7)
8
9exports_files([
10    "LICENSE",
11])
12
13# Public flatc library to compile flatbuffer files at runtime.
14cc_library(
15    name = "flatbuffers",
16    hdrs = ["//:public_headers"],
17    linkstatic = 1,
18    strip_include_prefix = "/include",
19    deps = ["//src:flatbuffers"],
20)
21
22# Public C++ headers for the Flatbuffers library.
23filegroup(
24    name = "public_headers",
25    srcs = [
26        "include/flatbuffers/base.h",
27        "include/flatbuffers/code_generators.h",
28        "include/flatbuffers/flatbuffers.h",
29        "include/flatbuffers/flexbuffers.h",
30        "include/flatbuffers/hash.h",
31        "include/flatbuffers/idl.h",
32        "include/flatbuffers/minireflect.h",
33        "include/flatbuffers/reflection.h",
34        "include/flatbuffers/reflection_generated.h",
35        "include/flatbuffers/registry.h",
36        "include/flatbuffers/stl_emulation.h",
37        "include/flatbuffers/util.h",
38    ],
39)
40
41# Public flatc compiler library.
42cc_library(
43    name = "flatc_library",
44    linkstatic = 1,
45    deps = [
46        "//src:flatc_library",
47    ],
48)
49
50# Public flatc compiler.
51cc_binary(
52    name = "flatc",
53    deps = [
54        "//src:flatc",
55    ],
56)
57
58filegroup(
59    name = "flatc_headers",
60    srcs = [
61        "include/flatbuffers/flatc.h",
62    ],
63    visibility = ["//:__subpackages__"],
64)
65
66# Library used by flatbuffer_cc_library rules.
67cc_library(
68    name = "runtime_cc",
69    hdrs = [
70        "include/flatbuffers/base.h",
71        "include/flatbuffers/flatbuffers.h",
72        "include/flatbuffers/flexbuffers.h",
73        "include/flatbuffers/stl_emulation.h",
74        "include/flatbuffers/util.h",
75    ],
76    linkstatic = 1,
77    strip_include_prefix = "/include",
78)
79