fuzzer: add proto_library_deps to fuzzable_proto_library
Add proto_library_deps type so that the dep is propagated to proto_library target. With this CL and https://crrev.com/c/5897794, we can specify indirect inputs deps came from imported protos in BUILD.gn correctly via input variable of configs in proto_library template. Bug: 366137880 Change-Id: I5448540cf8a2e9828f436aa6ad6b73f60a2f0569 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5922617 Auto-Submit: Takuto Ikuta <tikuta@chromium.org> Commit-Queue: Brendon Tiszka <tiszka@chromium.org> Reviewed-by: Brendon Tiszka <tiszka@chromium.org> Reviewed-by: Nathan Memmott <memmott@chromium.org> Cr-Commit-Position: refs/heads/main@{#1369652}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
fa201e276f
commit
1d684f7f20
@ -23,5 +23,5 @@ fuzzer_test("sql_recovery_lpm_fuzzer") {
|
||||
fuzzable_proto_library("sql_disk_corruption_proto") {
|
||||
import_dirs = [ "//third_party/sqlite/fuzz/" ]
|
||||
sources = [ "sql_disk_corruption.proto" ]
|
||||
deps = [ "//third_party/sqlite:sqlite3_lpm_fuzzer_input" ]
|
||||
proto_library_deps = [ "//third_party/sqlite:sqlite3_lpm_fuzzer_input" ]
|
||||
}
|
||||
|
@ -21,7 +21,25 @@ template("fuzzable_proto_library") {
|
||||
if (use_fuzzing_engine_with_lpm &&
|
||||
current_toolchain != "//build/toolchain/cros:target") {
|
||||
proto_library("proto_library_" + target_name) {
|
||||
forward_variables_from(invoker, "*")
|
||||
forward_variables_from(invoker,
|
||||
"*",
|
||||
[
|
||||
"deps",
|
||||
"proto_library_deps",
|
||||
])
|
||||
|
||||
deps = []
|
||||
if (defined(invoker.deps)) {
|
||||
foreach(dep, invoker.deps) {
|
||||
dep_dir = get_label_info(dep, "dir")
|
||||
dep_name = get_label_info(dep, "name")
|
||||
deps += [ "${dep_dir}:proto_library_${dep_name}" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (defined(invoker.proto_library_deps)) {
|
||||
deps += invoker.proto_library_deps
|
||||
}
|
||||
|
||||
# Override LITE_RUNTIME settings in the protobuf files.
|
||||
cc_generator_options = "speed"
|
||||
@ -53,7 +71,19 @@ template("fuzzable_proto_library") {
|
||||
# fuzzable_proto_library should behave like a proto_library when
|
||||
# !use_libfuzzer.
|
||||
proto_library(target_name) {
|
||||
forward_variables_from(invoker, "*")
|
||||
forward_variables_from(invoker,
|
||||
"*",
|
||||
[
|
||||
"deps",
|
||||
"proto_library_deps",
|
||||
])
|
||||
deps = []
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
if (defined(invoker.proto_library_deps)) {
|
||||
deps += invoker.proto_library_deps
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user