mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-18 14:28:55 +00:00
Add deps attribute to flatbuffer_cc_library (#7107)
I'm not seeing the reason why we didn't attempt to support transitive dependencies for flatbuffer_cc_library, and the current setup makes having to propagate new dependencies to all of their recursive dependents obnoxious.
This commit is contained in:
@@ -116,14 +116,50 @@ cc_library(
|
||||
)
|
||||
|
||||
flatbuffer_cc_library(
|
||||
name = "monster_test_cc_fbs",
|
||||
srcs = ["monster_test.fbs"],
|
||||
include_paths = ["tests/include_test"],
|
||||
includes = [
|
||||
name = "include_test_fbs",
|
||||
srcs = [
|
||||
"include_test/include_test1.fbs",
|
||||
"include_test/sub/include_test2.fbs",
|
||||
],
|
||||
include_paths = ["tests/include_test"],
|
||||
)
|
||||
|
||||
flatbuffer_cc_library(
|
||||
name = "monster_test_cc_fbs",
|
||||
srcs = ["monster_test.fbs"],
|
||||
include_paths = ["tests/include_test"],
|
||||
visibility = ["//grpc/tests:__subpackages__"],
|
||||
deps = [":include_test_fbs"],
|
||||
)
|
||||
|
||||
# Test that running without --no-includes works properly (monster_test doesn't
|
||||
# work cleanly due to the circular dependency in the include_tests/ files).
|
||||
include_test_args = [
|
||||
"--gen-object-api",
|
||||
"--gen-compare",
|
||||
"--gen-mutable",
|
||||
"--reflect-names",
|
||||
"--cpp-ptr-type flatbuffers::unique_ptr",
|
||||
"--force-empty",
|
||||
]
|
||||
|
||||
flatbuffer_cc_library(
|
||||
name = "included_test_fbs",
|
||||
srcs = ["included_test.fbs"],
|
||||
flatc_args = include_test_args,
|
||||
)
|
||||
|
||||
flatbuffer_cc_library(
|
||||
name = "includer_test_fbs",
|
||||
srcs = ["includer_test.fbs"],
|
||||
flatc_args = include_test_args,
|
||||
deps = [":included_test_fbs"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "include_build_test",
|
||||
srcs = ["include_build_test.cc"],
|
||||
deps = [":includer_test_fbs"],
|
||||
)
|
||||
|
||||
flatbuffer_cc_library(
|
||||
|
||||
1
tests/include_build_test.cc
Normal file
1
tests/include_build_test.cc
Normal file
@@ -0,0 +1 @@
|
||||
#include "tests/includer_test_generated.h"
|
||||
3
tests/included_test.fbs
Normal file
3
tests/included_test.fbs
Normal file
@@ -0,0 +1,3 @@
|
||||
table Wrapped {
|
||||
a:double;
|
||||
}
|
||||
5
tests/includer_test.fbs
Normal file
5
tests/includer_test.fbs
Normal file
@@ -0,0 +1,5 @@
|
||||
include "tests/included_test.fbs";
|
||||
|
||||
table Wrapper {
|
||||
a:Wrapped;
|
||||
}
|
||||
Reference in New Issue
Block a user