Chromium Code Reviews| Index: third_party/flatbuffers/BUILD.gn |
| diff --git a/third_party/flatbuffers/BUILD.gn b/third_party/flatbuffers/BUILD.gn |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f4071a82da96ce912a4d17861d906eaf548be7dc |
| --- /dev/null |
| +++ b/third_party/flatbuffers/BUILD.gn |
| @@ -0,0 +1,73 @@ |
| +# Copyright 2016 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +config("flatbuffers_config") { |
| + include_dirs = [ "src/include" ] |
| +} |
| + |
| +static_library("flatbuffers") { |
| + sources = [ |
| + "src/include/flatbuffers/flatbuffers.h", |
| + "src/include/flatbuffers/hash.h", |
| + "src/src/flathash.cpp", |
| + ] |
| + |
| + configs -= [ "//build/config/compiler:chromium_code" ] |
| + configs += [ "//build/config/compiler:no_chromium_code" ] |
| + public_configs = [ ":flatbuffers_config" ] |
| +} |
| + |
| +compiler_files = [ |
|
jochen (gone - plz use gerrit)
2016/04/21 14:59:00
should be a source_set
battre
2016/04/21 15:31:34
Done.
|
| + "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_js.cpp", |
| + "src/src/idl_gen_php.cpp", |
| + "src/src/idl_gen_python.cpp", |
| + "src/src/idl_gen_text.cpp", |
| + "src/src/idl_parser.cpp", |
| + "src/src/reflection.cpp", |
| + "src/src/util.cpp", |
| + "src/include/idl.h", |
| + "src/include/util.h", |
| +] |
| + |
| +executable("flatc") { |
| + sources = compiler_files + [ "src/src/flatc.cpp" ] |
| + deps = [ |
| + ":flatbuffers", |
| + ] |
| +} |
| + |
| +# The following is just for testing. |
| + |
| +import("//third_party/flatbuffers/flatc.gni") |
| + |
| +flatbuffers_library("flatbuffers_samplebuffer") { |
| + sources = [ |
|
jochen (gone - plz use gerrit)
2016/04/21 14:59:00
can you mark this library as test only
battre
2016/04/21 15:31:34
Done.
|
| + "src/tests/include_test1.fbs", |
| + "src/tests/include_test2.fbs", |
| + "src/tests/monster_test.fbs", |
| + "src/tests/namespace_test/namespace_test1.fbs", |
| + "src/tests/namespace_test/namespace_test2.fbs", |
| + ] |
| +} |
| + |
| +executable("flatbuffers_unittest") { |
| + sources = compiler_files + [ |
|
jochen (gone - plz use gerrit)
2016/04/21 14:59:00
same here
battre
2016/04/21 15:31:34
Done.
|
| + # 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_generated.h", |
| + "src/include/reflection.h", |
| + |
| + # This is the actual test. |
| + "src/tests/test.cpp", |
| + ] |
| + deps = [ |
| + ":flatbuffers", |
| + ":flatbuffers_samplebuffer", |
| + ] |
| +} |