blob: 346f9a66f2f67720d1ecc2322d3ff167e4248c05 [file] [log] [blame]
Austin Schuh4ac96a82019-08-14 20:24:23 -07001licenses(["notice"])
2
Alex Perrycb7da4b2019-08-28 19:35:56 -07003load("@//tools:environments.bzl", "mcu_cpus")
4
Austin Schuh4ac96a82019-08-14 20:24:23 -07005package(
6 default_visibility = ["//visibility:public"],
Austin Schuh4ac96a82019-08-14 20:24:23 -07007)
8
9exports_files([
10 "LICENSE",
11])
12
Austin Schuh4ac96a82019-08-14 20:24:23 -070013# Public flatc library to compile flatbuffer files at runtime.
14cc_library(
15 name = "flatbuffers",
Austin Schuh3e95e5d2019-09-20 00:08:54 -070016 copts = ["-Wno-cast-align"],
Austin Schuh7c75e582020-11-14 16:41:18 -080017 hdrs = ["//:public_headers"],
Austin Schuh4ac96a82019-08-14 20:24:23 -070018 linkstatic = 1,
Austin Schuh7c75e582020-11-14 16:41:18 -080019 strip_include_prefix = "/include",
20 deps = ["//src:flatbuffers"],
Austin Schuh4ac96a82019-08-14 20:24:23 -070021)
22
23# Public C++ headers for the Flatbuffers library.
24filegroup(
25 name = "public_headers",
26 srcs = [
27 "include/flatbuffers/base.h",
28 "include/flatbuffers/code_generators.h",
29 "include/flatbuffers/flatbuffers.h",
30 "include/flatbuffers/flexbuffers.h",
Austin Schuh7c75e582020-11-14 16:41:18 -080031 "include/flatbuffers/grpc.h",
Austin Schuh4ac96a82019-08-14 20:24:23 -070032 "include/flatbuffers/hash.h",
33 "include/flatbuffers/idl.h",
34 "include/flatbuffers/minireflect.h",
35 "include/flatbuffers/reflection.h",
36 "include/flatbuffers/reflection_generated.h",
Austin Schuh7c75e582020-11-14 16:41:18 -080037 "include/flatbuffers/registry.h",
Austin Schuh4ac96a82019-08-14 20:24:23 -070038 "include/flatbuffers/stl_emulation.h",
39 "include/flatbuffers/util.h",
40 ],
41)
42
43# Public flatc compiler library.
44cc_library(
45 name = "flatc_library",
Austin Schuh7c75e582020-11-14 16:41:18 -080046 linkstatic = 1,
47 deps = [
48 "//src:flatc_library",
Austin Schuh4ac96a82019-08-14 20:24:23 -070049 ],
50)
51
52# Public flatc compiler.
53cc_binary(
54 name = "flatc",
Alex Perrycb7da4b2019-08-28 19:35:56 -070055 data = [
56 "reflection/reflection.fbs",
57 ],
Austin Schuh4ac96a82019-08-14 20:24:23 -070058 deps = [
Austin Schuh7c75e582020-11-14 16:41:18 -080059 "//src:flatc",
Austin Schuh4ac96a82019-08-14 20:24:23 -070060 ],
61)
62
Austin Schuh7c75e582020-11-14 16:41:18 -080063filegroup(
64 name = "flatc_headers",
65 srcs = [
66 "include/flatbuffers/flatc.h",
67 ],
68 visibility = ["//:__subpackages__"],
69)
70
71# Library used by flatbuffer_cc_library rules.
Austin Schuh4ac96a82019-08-14 20:24:23 -070072cc_library(
73 name = "runtime_cc",
74 hdrs = [
75 "include/flatbuffers/base.h",
76 "include/flatbuffers/flatbuffers.h",
77 "include/flatbuffers/flexbuffers.h",
78 "include/flatbuffers/stl_emulation.h",
79 "include/flatbuffers/util.h",
80 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070081 compatible_with = mcu_cpus,
Austin Schuh4ac96a82019-08-14 20:24:23 -070082 linkstatic = 1,
Austin Schuh7c75e582020-11-14 16:41:18 -080083 strip_include_prefix = "/include",
Austin Schuh4ac96a82019-08-14 20:24:23 -070084)
James Kuszmaulf385c462019-12-24 09:37:34 -080085py_library(
86 name = "flatpy",
87 srcs = glob(["python/flatbuffers/*.py"]),
88 imports = ["python/"],
89)
Alex Perryb3b50792020-01-18 16:13:45 -080090
91filegroup(
92 name = "flatjs",
93 srcs = ["js/flatbuffers.js"],
94)