forked from BigfootDev/flatbuffers
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(
|
||||
|
||||
Reference in New Issue
Block a user