Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 config("flatbuffers_config") { | |
| 6 include_dirs = [ "src/include" ] | |
| 7 } | |
| 8 | |
| 9 source_set("flatbuffers") { | |
| 10 sources = [ | |
| 11 "src/include/flatbuffers/flatbuffers.h", | |
| 12 "src/include/flatbuffers/hash.h", | |
| 13 ] | |
| 14 | |
| 15 configs -= [ "//build/config/compiler:chromium_code" ] | |
| 16 configs += [ "//build/config/compiler:no_chromium_code" ] | |
| 17 public_configs = [ ":flatbuffers_config" ] | |
| 18 } | |
| 19 | |
| 20 source_set("compiler_files") { | |
| 21 sources = [ | |
| 22 "src/include/idl.h", | |
| 23 "src/include/util.h", | |
| 24 "src/src/idl_gen_cpp.cpp", | |
| 25 "src/src/idl_gen_fbs.cpp", | |
| 26 "src/src/idl_gen_general.cpp", | |
| 27 "src/src/idl_gen_go.cpp", | |
| 28 "src/src/idl_gen_js.cpp", | |
| 29 "src/src/idl_gen_php.cpp", | |
| 30 "src/src/idl_gen_python.cpp", | |
| 31 "src/src/idl_gen_text.cpp", | |
| 32 "src/src/idl_parser.cpp", | |
| 33 "src/src/reflection.cpp", | |
| 34 "src/src/util.cpp", | |
| 35 ] | |
| 36 visibility = [ ":*" ] | |
| 37 deps = [ | |
| 38 ":flatbuffers", | |
| 39 ] | |
| 40 } | |
| 41 | |
| 42 executable("flatc") { | |
| 43 sources = [ | |
| 44 "src/src/flatc.cpp", | |
| 45 ] | |
| 46 deps = [ | |
| 47 ":compiler_files", | |
| 48 ":flatbuffers", | |
| 49 ] | |
| 50 } | |
| 51 | |
| 52 # The following is just for testing. | |
| 53 | |
| 54 import("//third_party/flatbuffers/flatbuffer.gni") | |
|
brettw
2016/05/02 17:13:25
Can you put all the imports at the top, sorted lik
| |
| 55 | |
| 56 flatbuffer("flatbuffers_samplebuffer") { | |
| 57 testonly = true | |
| 58 sources = [ | |
| 59 "src/tests/include_test1.fbs", | |
| 60 "src/tests/include_test2.fbs", | |
| 61 "src/tests/monster_test.fbs", | |
| 62 "src/tests/namespace_test/namespace_test1.fbs", | |
| 63 "src/tests/namespace_test/namespace_test2.fbs", | |
| 64 ] | |
| 65 } | |
| 66 | |
| 67 import("//testing/test.gni") | |
|
brettw
2016/05/02 17:13:25
Ditto
| |
| 68 | |
| 69 test("flatbuffers_unittest") { | |
| 70 sources = [ | |
| 71 # The following files are not included in :flatbuffers | |
| 72 # but are listed here because test.cpp tests more than what will | |
| 73 # get included into Chrome (reflection and generation). | |
| 74 "src/include/reflection.h", | |
| 75 "src/include/reflection_generated.h", | |
| 76 | |
| 77 # This is the actual test. | |
| 78 "src/tests/test.cpp", | |
| 79 ] | |
| 80 deps = [ | |
| 81 ":compiler_files", | |
| 82 ":flatbuffers", | |
| 83 ":flatbuffers_samplebuffer", | |
| 84 ] | |
| 85 data = [ | |
| 86 "src/tests/", | |
| 87 ] | |
| 88 } | |
| OLD | NEW |