Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 1 | package( |
| 2 | default_visibility = ["//visibility:public"], |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 3 | ) |
| 4 | |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 5 | licenses(["notice"]) |
| 6 | |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 7 | exports_files([ |
| 8 | "LICENSE", |
Philipp Schrader | e625ba2 | 2020-11-16 20:11:37 -0800 | [diff] [blame] | 9 | "tsconfig.json", |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 10 | ]) |
| 11 | |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 12 | # Public flatc library to compile flatbuffer files at runtime. |
| 13 | cc_library( |
| 14 | name = "flatbuffers", |
Austin Schuh | 7c75e58 | 2020-11-14 16:41:18 -0800 | [diff] [blame] | 15 | hdrs = ["//:public_headers"], |
Philipp Schrader | e625ba2 | 2020-11-16 20:11:37 -0800 | [diff] [blame] | 16 | copts = ["-Wno-cast-align"], |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 17 | linkstatic = 1, |
Austin Schuh | 7c75e58 | 2020-11-14 16:41:18 -0800 | [diff] [blame] | 18 | strip_include_prefix = "/include", |
| 19 | deps = ["//src:flatbuffers"], |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 20 | ) |
| 21 | |
| 22 | # Public C++ headers for the Flatbuffers library. |
| 23 | filegroup( |
| 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", |
Austin Schuh | 7c75e58 | 2020-11-14 16:41:18 -0800 | [diff] [blame] | 30 | "include/flatbuffers/grpc.h", |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 31 | "include/flatbuffers/hash.h", |
| 32 | "include/flatbuffers/idl.h", |
| 33 | "include/flatbuffers/minireflect.h", |
| 34 | "include/flatbuffers/reflection.h", |
| 35 | "include/flatbuffers/reflection_generated.h", |
Austin Schuh | 7c75e58 | 2020-11-14 16:41:18 -0800 | [diff] [blame] | 36 | "include/flatbuffers/registry.h", |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 37 | "include/flatbuffers/stl_emulation.h", |
| 38 | "include/flatbuffers/util.h", |
| 39 | ], |
| 40 | ) |
| 41 | |
| 42 | # Public flatc compiler library. |
| 43 | cc_library( |
| 44 | name = "flatc_library", |
Austin Schuh | 7c75e58 | 2020-11-14 16:41:18 -0800 | [diff] [blame] | 45 | linkstatic = 1, |
| 46 | deps = [ |
| 47 | "//src:flatc_library", |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 48 | ], |
| 49 | ) |
| 50 | |
| 51 | # Public flatc compiler. |
| 52 | cc_binary( |
| 53 | name = "flatc", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 54 | data = [ |
| 55 | "reflection/reflection.fbs", |
| 56 | ], |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 57 | deps = [ |
Austin Schuh | 7c75e58 | 2020-11-14 16:41:18 -0800 | [diff] [blame] | 58 | "//src:flatc", |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 59 | ], |
| 60 | ) |
| 61 | |
Austin Schuh | 7c75e58 | 2020-11-14 16:41:18 -0800 | [diff] [blame] | 62 | filegroup( |
| 63 | name = "flatc_headers", |
| 64 | srcs = [ |
| 65 | "include/flatbuffers/flatc.h", |
| 66 | ], |
| 67 | visibility = ["//:__subpackages__"], |
| 68 | ) |
| 69 | |
| 70 | # Library used by flatbuffer_cc_library rules. |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 71 | cc_library( |
| 72 | name = "runtime_cc", |
| 73 | hdrs = [ |
| 74 | "include/flatbuffers/base.h", |
| 75 | "include/flatbuffers/flatbuffers.h", |
| 76 | "include/flatbuffers/flexbuffers.h", |
| 77 | "include/flatbuffers/stl_emulation.h", |
| 78 | "include/flatbuffers/util.h", |
| 79 | ], |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 80 | linkstatic = 1, |
Austin Schuh | 7c75e58 | 2020-11-14 16:41:18 -0800 | [diff] [blame] | 81 | strip_include_prefix = "/include", |
Austin Schuh | 4ac96a8 | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 82 | ) |
Philipp Schrader | e625ba2 | 2020-11-16 20:11:37 -0800 | [diff] [blame] | 83 | |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 84 | py_library( |
| 85 | name = "flatpy", |
| 86 | srcs = glob(["python/flatbuffers/*.py"]), |
| 87 | imports = ["python/"], |
| 88 | ) |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 89 | |
| 90 | filegroup( |
| 91 | name = "flatjs", |
| 92 | srcs = ["js/flatbuffers.js"], |
| 93 | ) |