• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
2
3licenses(["notice"])
4
5package(
6    default_visibility = ["//visibility:public"],
7)
8
9exports_files([
10    "LICENSE",
11    "tsconfig.json",
12])
13
14config_setting(
15    name = "platform_freebsd",
16    constraint_values = [
17        "@platforms//os:freebsd",
18    ],
19)
20
21config_setting(
22    name = "platform_openbsd",
23    constraint_values = [
24        "@platforms//os:openbsd",
25    ],
26)
27
28# Public flatc library to compile flatbuffer files at runtime.
29cc_library(
30    name = "flatbuffers",
31    hdrs = ["//:public_headers"],
32    linkstatic = 1,
33    strip_include_prefix = "/include",
34    deps = ["//src:flatbuffers"],
35)
36
37# Public C++ headers for the Flatbuffers library.
38filegroup(
39    name = "public_headers",
40    srcs = [
41        "include/flatbuffers/allocator.h",
42        "include/flatbuffers/array.h",
43        "include/flatbuffers/base.h",
44        "include/flatbuffers/bfbs_generator.h",
45        "include/flatbuffers/buffer.h",
46        "include/flatbuffers/buffer_ref.h",
47        "include/flatbuffers/code_generators.h",
48        "include/flatbuffers/default_allocator.h",
49        "include/flatbuffers/detached_buffer.h",
50        "include/flatbuffers/flatbuffer_builder.h",
51        "include/flatbuffers/flatbuffers.h",
52        "include/flatbuffers/flex_flat_util.h",
53        "include/flatbuffers/flexbuffers.h",
54        "include/flatbuffers/grpc.h",
55        "include/flatbuffers/hash.h",
56        "include/flatbuffers/idl.h",
57        "include/flatbuffers/minireflect.h",
58        "include/flatbuffers/reflection.h",
59        "include/flatbuffers/reflection_generated.h",
60        "include/flatbuffers/registry.h",
61        "include/flatbuffers/stl_emulation.h",
62        "include/flatbuffers/string.h",
63        "include/flatbuffers/struct.h",
64        "include/flatbuffers/table.h",
65        "include/flatbuffers/util.h",
66        "include/flatbuffers/vector.h",
67        "include/flatbuffers/vector_downward.h",
68        "include/flatbuffers/verifier.h",
69    ],
70)
71
72# Public flatc compiler library.
73cc_library(
74    name = "flatc_library",
75    linkstatic = 1,
76    deps = [
77        "//src:flatc_library",
78    ],
79)
80
81# Public flatc compiler.
82cc_binary(
83    name = "flatc",
84    data = ["//reflection:reflection_fbs_schema"],
85    deps = [
86        "//src:flatc",
87    ],
88)
89
90filegroup(
91    name = "flatc_headers",
92    srcs = [
93        "include/flatbuffers/flatc.h",
94    ],
95    visibility = ["//:__subpackages__"],
96)
97
98# Library used by flatbuffer_cc_library rules.
99cc_library(
100    name = "runtime_cc",
101    hdrs = [
102        "include/flatbuffers/base.h",
103        "include/flatbuffers/flatbuffers.h",
104        "include/flatbuffers/flexbuffers.h",
105        "include/flatbuffers/stl_emulation.h",
106        "include/flatbuffers/util.h",
107        "include/flatbuffers/vector.h",
108        "include/flatbuffers/verifier.h",
109    ],
110    linkstatic = 1,
111    strip_include_prefix = "/include",
112)
113