Skip to content

Commit cc28f49

Browse files
cccclaifacebook-github-bot
authored andcommitted
Add buck file for third-party flatbuffers
Summary: As title Reviewed By: dbort Differential Revision: D47521022 fbshipit-source-id: f8eb03805102084f72ac46b890546c243b2f5cdd
1 parent f2aa5d1 commit cc28f49

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

third-party/targets.bzl

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
load("@fbsource//xplat/executorch/build/runtime_wrapper.bzl", "runtime")
2+
3+
def define_common_targets():
4+
runtime.cxx_library(
5+
name = "flatbuffers-api",
6+
public_include_directories = ["flatbuffers/include"],
7+
raw_headers = [
8+
"flatbuffers/include/flatbuffers/base.h",
9+
"flatbuffers/include/flatbuffers/flatbuffers.h",
10+
"flatbuffers/include/flatbuffers/stl_emulation.h",
11+
],
12+
link_style = "static",
13+
visibility = ["PUBLIC"],
14+
)
15+
16+
runtime.cxx_library(
17+
name = "flatc_library",
18+
srcs = [
19+
"flatbuffers/src/code_generators.cpp",
20+
"flatbuffers/src/flatc.cpp",
21+
"flatbuffers/src/idl_gen_fbs.cpp",
22+
"flatbuffers/src/idl_gen_text.cpp",
23+
"flatbuffers/src/idl_parser.cpp",
24+
"flatbuffers/src/reflection.cpp",
25+
"flatbuffers/src/util.cpp",
26+
],
27+
public_include_directories = [
28+
"flatbuffers/grpc",
29+
"flatbuffers/include",
30+
],
31+
raw_headers = [
32+
"flatbuffers/include/flatbuffers/flatc.h",
33+
"flatbuffers/include/flatbuffers/base.h",
34+
"flatbuffers/include/flatbuffers/flatbuffers.h",
35+
"flatbuffers/include/flatbuffers/stl_emulation.h",
36+
"flatbuffers/include/flatbuffers/code_generators.h",
37+
"flatbuffers/include/flatbuffers/flexbuffers.h",
38+
"flatbuffers/include/flatbuffers/hash.h",
39+
"flatbuffers/include/flatbuffers/idl.h",
40+
"flatbuffers/include/flatbuffers/minireflect.h",
41+
"flatbuffers/include/flatbuffers/reflection.h",
42+
"flatbuffers/include/flatbuffers/reflection_generated.h",
43+
"flatbuffers/include/flatbuffers/util.h",
44+
],
45+
link_style = "static",
46+
visibility = ["PUBLIC"],
47+
)
48+
49+
runtime.cxx_binary(
50+
name = "flatc",
51+
srcs = [
52+
"flatbuffers/grpc/src/compiler/cpp_generator.cc",
53+
"flatbuffers/grpc/src/compiler/go_generator.cc",
54+
"flatbuffers/grpc/src/compiler/java_generator.cc",
55+
"flatbuffers/grpc/src/compiler/python_generator.cc",
56+
"flatbuffers/grpc/src/compiler/swift_generator.cc",
57+
"flatbuffers/grpc/src/compiler/ts_generator.cc",
58+
"flatbuffers/src/flatc_main.cpp",
59+
"flatbuffers/src/idl_gen_cpp.cpp",
60+
"flatbuffers/src/idl_gen_csharp.cpp",
61+
"flatbuffers/src/idl_gen_dart.cpp",
62+
"flatbuffers/src/idl_gen_go.cpp",
63+
"flatbuffers/src/idl_gen_grpc.cpp",
64+
"flatbuffers/src/idl_gen_java.cpp",
65+
"flatbuffers/src/idl_gen_js_ts.cpp",
66+
"flatbuffers/src/idl_gen_json_schema.cpp",
67+
"flatbuffers/src/idl_gen_kotlin.cpp",
68+
"flatbuffers/src/idl_gen_lobster.cpp",
69+
"flatbuffers/src/idl_gen_lua.cpp",
70+
"flatbuffers/src/idl_gen_php.cpp",
71+
"flatbuffers/src/idl_gen_python.cpp",
72+
"flatbuffers/src/idl_gen_rust.cpp",
73+
"flatbuffers/src/idl_gen_swift.cpp",
74+
"flatbuffers/src/idl_gen_text.cpp",
75+
"flatbuffers/src/util.cpp",
76+
],
77+
include_directories = [
78+
"flatbuffers/grpc",
79+
"flatbuffers/include",
80+
],
81+
raw_headers = [
82+
"flatbuffers/grpc/src/compiler/config.h",
83+
"flatbuffers/grpc/src/compiler/cpp_generator.h",
84+
"flatbuffers/grpc/src/compiler/go_generator.h",
85+
"flatbuffers/grpc/src/compiler/java_generator.h",
86+
"flatbuffers/grpc/src/compiler/python_generator.h",
87+
"flatbuffers/grpc/src/compiler/python_private_generator.h",
88+
"flatbuffers/grpc/src/compiler/schema_interface.h",
89+
"flatbuffers/grpc/src/compiler/swift_generator.h",
90+
"flatbuffers/grpc/src/compiler/ts_generator.h",
91+
],
92+
visibility = ["PUBLIC"],
93+
deps = [":flatc_library"],
94+
link_style = "static",
95+
)

0 commit comments

Comments
 (0)