Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/flatbuffers/BUILD.gn

Issue 1907603005: Add a dependency for FlatBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: testonly for generated files Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..adf08f743f078311ca445cec50eef91df265a929
--- /dev/null
+++ b/third_party/flatbuffers/BUILD.gn
@@ -0,0 +1,84 @@
+# 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") {
brettw 2016/04/21 20:00:03 This should be a source_set.
battre 2016/04/25 14:31:47 Done. I have also deleted flathash.cpp, which shou
+ 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" ]
+}
+
+source_set("compiler_files") {
+ sources = [
brettw 2016/04/21 20:00:03 Can you set visibility = [ ":*" ] here so target
battre 2016/04/25 14:31:47 Done.
+ "src/include/idl.h",
+ "src/include/util.h",
+ "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",
+ ]
+ deps = [
+ ":flatbuffers",
+ ]
+}
+
+executable("flatc") {
+ sources = [
+ "src/src/flatc.cpp",
+ ]
+ deps = [
+ ":compiler_files",
+ ":flatbuffers",
+ ]
+}
+
+# The following is just for testing.
+
+import("//third_party/flatbuffers/flatc.gni")
+
+flatbuffers_library("flatbuffers_samplebuffer") {
+ testonly = true
+ sources = [
+ "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") {
brettw 2016/04/21 20:00:02 This should use the test() template in //testing/t
battre 2016/04/25 14:31:47 Done.
+ testonly = true
+ 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",
+ ]
+ deps = [
+ ":compiler_files",
+ ":flatbuffers",
+ ":flatbuffers_samplebuffer",
+ ]
+}
« no previous file with comments | « DEPS ('k') | third_party/flatbuffers/LICENSE » ('j') | third_party/flatbuffers/flatc.gni » ('J')

Powered by Google App Engine
This is Rietveld 408576698