Index: third_party/flatbuffers/BUILD.gn |
diff --git a/third_party/flatbuffers/BUILD.gn b/third_party/flatbuffers/BUILD.gn |
index 5a3c3de5356d9671aa0acdfe60e657408c333cdd..bb55134db76f923f45b1706a0561aae89fe1b4c2 100644 |
--- a/third_party/flatbuffers/BUILD.gn |
+++ b/third_party/flatbuffers/BUILD.gn |
@@ -9,26 +9,45 @@ config("flatbuffers_config") { |
include_dirs = [ "src/include" ] |
} |
+# The part of FlatBuffers that Chrome is interested in. |
source_set("flatbuffers") { |
sources = [ |
"src/include/flatbuffers/flatbuffers.h", |
- "src/include/flatbuffers/hash.h", |
] |
configs -= [ "//build/config/compiler:chromium_code" ] |
configs += [ "//build/config/compiler:no_chromium_code" ] |
+ |
public_configs = [ ":flatbuffers_config" ] |
} |
+# The complete FlatBuffers library, as required to build the flatc compiler and |
+# some of the tests. |
source_set("compiler_files") { |
+ include_dirs = [ "src/grpc" ] |
sources = [ |
+ "src/grpc/src/compiler/config.h", |
+ "src/grpc/src/compiler/cpp_generator.cc", |
+ "src/grpc/src/compiler/cpp_generator.h", |
+ "src/grpc/src/compiler/go_generator.cc", |
+ "src/grpc/src/compiler/go_generator.h", |
+ "src/grpc/src/compiler/schema_interface.h", |
"src/include/flatbuffers/code_generators.h", |
+ "src/include/flatbuffers/flatc.h", |
+ "src/include/flatbuffers/flexbuffers.h", |
+ "src/include/flatbuffers/grpc.h", |
+ "src/include/flatbuffers/hash.h", |
"src/include/flatbuffers/idl.h", |
+ "src/include/flatbuffers/reflection.h", |
+ "src/include/flatbuffers/reflection_generated.h", |
"src/include/flatbuffers/util.h", |
+ "src/src/code_generators.cpp", |
+ "src/src/flatc.cpp", |
"src/src/idl_gen_cpp.cpp", |
"src/src/idl_gen_fbs.cpp", |
"src/src/idl_gen_general.cpp", |
"src/src/idl_gen_go.cpp", |
+ "src/src/idl_gen_grpc.cpp", |
"src/src/idl_gen_js.cpp", |
"src/src/idl_gen_php.cpp", |
"src/src/idl_gen_python.cpp", |
@@ -45,7 +64,7 @@ source_set("compiler_files") { |
executable("flatc") { |
sources = [ |
- "src/src/flatc.cpp", |
+ "src/src/flatc_main.cpp", |
] |
deps = [ |
":compiler_files", |
@@ -70,15 +89,7 @@ flatbuffer("flatbuffers_samplebuffer") { |
test("flatbuffers_unittest") { |
sources = [ |
- # The following files are not included in :flatbuffers |
- # but are listed here because test.cpp tests more than what will |
- # get included into Chrome (reflection and generation). |
- "src/include/reflection.h", |
- "src/include/reflection_generated.h", |
- |
- # This is the actual test. |
"src/tests/test.cpp", |
- "src/tests/test.h", |
] |
deps = [ |
":compiler_files", |
@@ -88,4 +99,13 @@ test("flatbuffers_unittest") { |
data = [ |
"src/tests/", |
] |
+ defines = [ "FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE" ] |
+ |
+ if (!is_android) { |
+ defines += [ |
+ # TODO(pkalinnikov): Figure out why some of the tests guarded by this |
+ # flag crash in release mode. |
+ "FLATBUFFERS_NO_FILE_TESTS", |
palmer
2017/05/16 22:14:42
Can you characterize the tests and the crashes? An
pkalinnikov
2017/05/26 11:30:24
I was running this test incorrectly. It actually w
|
+ ] |
+ } |
} |