summaryrefslogtreecommitdiff
path: root/BUILD.bazel
blob: b4f015a0e2926d996db39ea88283ca695a8c3c8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
load("@aspect_rules_js//npm:defs.bzl", "npm_link_package")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

licenses(["notice"])

package(
    default_visibility = ["//visibility:public"],
)

npm_link_all_packages(name = "node_modules")

npm_link_package(
    name = "node_modules/flatbuffers",
    src = "//ts:flatbuffers",
)

exports_files([
    "LICENSE",
    "tsconfig.json",
])

config_setting(
    name = "platform_freebsd",
    constraint_values = [
        "@platforms//os:freebsd",
    ],
)

config_setting(
    name = "platform_openbsd",
    constraint_values = [
        "@platforms//os:openbsd",
    ],
)

filegroup(
    name = "distribution",
    srcs = [
        "BUILD.bazel",
        "WORKSPACE",
        "build_defs.bzl",
        "typescript.bzl",
        "//grpc/src/compiler:distribution",
        "//reflection:distribution",
        "//src:distribution",
        "//ts:distribution",
    ] + glob([
        "include/flatbuffers/*.h",
    ]),
    visibility = ["//visibility:public"],
)

# Public flatc library to compile flatbuffer files at runtime.
cc_library(
    name = "flatbuffers",
    hdrs = ["//:public_headers"],
    linkstatic = 1,
    strip_include_prefix = "/include",
    deps = ["//src:flatbuffers"],
)

# Public C++ headers for the Flatbuffers library.
filegroup(
    name = "public_headers",
    srcs = [
        "include/flatbuffers/allocator.h",
        "include/flatbuffers/array.h",
        "include/flatbuffers/base.h",
        "include/flatbuffers/buffer.h",
        "include/flatbuffers/buffer_ref.h",
        "include/flatbuffers/code_generator.h",
        "include/flatbuffers/code_generators.h",
        "include/flatbuffers/default_allocator.h",
        "include/flatbuffers/detached_buffer.h",
        "include/flatbuffers/file_manager.h",
        "include/flatbuffers/flatbuffer_builder.h",
        "include/flatbuffers/flatbuffers.h",
        "include/flatbuffers/flex_flat_util.h",
        "include/flatbuffers/flexbuffers.h",
        "include/flatbuffers/grpc.h",
        "include/flatbuffers/hash.h",
        "include/flatbuffers/idl.h",
        "include/flatbuffers/minireflect.h",
        "include/flatbuffers/reflection.h",
        "include/flatbuffers/reflection_generated.h",
        "include/flatbuffers/registry.h",
        "include/flatbuffers/stl_emulation.h",
        "include/flatbuffers/string.h",
        "include/flatbuffers/struct.h",
        "include/flatbuffers/table.h",
        "include/flatbuffers/util.h",
        "include/flatbuffers/vector.h",
        "include/flatbuffers/vector_downward.h",
        "include/flatbuffers/verifier.h",
    ],
)

# Public flatc compiler library.
cc_library(
    name = "flatc_library",
    linkstatic = 1,
    deps = [
        "//src:flatc_library",
    ],
)

# Public flatc compiler.
cc_binary(
    name = "flatc",
    data = ["//reflection:reflection_fbs_schema"],
    deps = [
        "//src:flatc",
    ],
)

filegroup(
    name = "flatc_headers",
    srcs = [
        "include/flatbuffers/flatc.h",
    ],
    visibility = ["//:__subpackages__"],
)

# Library used by flatbuffer_cc_library rules.
cc_library(
    name = "runtime_cc",
    hdrs = [
        "include/flatbuffers/base.h",
        "include/flatbuffers/flatbuffers.h",
        "include/flatbuffers/flexbuffers.h",
        "include/flatbuffers/stl_emulation.h",
        "include/flatbuffers/util.h",
        "include/flatbuffers/vector.h",
        "include/flatbuffers/verifier.h",
    ],
    linkstatic = 1,
    strip_include_prefix = "/include",
)