diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 27facadb61..e1c9b8e92e 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -352,7 +352,8 @@ def CheckAbseilDependencies(input_api, gn_files, output_api): target_types_to_check = [ 'rtc_library', 'rtc_source_set', - 'rtc_static_library' + 'rtc_static_library', + 'webrtc_fuzzer_test', ] error_msg = ('Abseil dependencies in target "%s" (file: %s) ' 'should be moved to the "absl_deps" parameter.') diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index 87a957e55f..203490f417 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -40,6 +40,10 @@ rtc_library("fuzz_data_helper") { visibility = [ ":*" ] # Only targets in this file can depend on this. } +set_defaults("webrtc_fuzzer_test") { + absl_deps = [] +} + template("webrtc_fuzzer_test") { fuzzer_test(target_name) { forward_variables_from(invoker, "*") @@ -47,6 +51,21 @@ template("webrtc_fuzzer_test") { ":fuzz_data_helper", ":webrtc_fuzzer_main", ] + + # If absl_deps is [], no action is needed. If not [], then it needs to be + # converted to //third_party/abseil-cpp:absl when build_with_chromium=true + # otherwise it just needs to be added to deps. + if (absl_deps != []) { + if (!defined(deps)) { + deps = [] + } + if (build_with_chromium) { + deps += [ "//third_party/abseil-cpp:absl" ] + } else { + deps += absl_deps + } + } + if (!build_with_chromium && is_clang) { suppressed_configs = [ "//build/config/clang:find_bad_constructs" ] } @@ -194,10 +213,8 @@ webrtc_fuzzer_test("rtcp_receiver_fuzzer") { webrtc_fuzzer_test("rtp_packet_fuzzer") { sources = [ "rtp_packet_fuzzer.cc" ] - deps = [ - "../../modules/rtp_rtcp:rtp_rtcp_format", - "//third_party/abseil-cpp/absl/types:optional", - ] + deps = [ "../../modules/rtp_rtcp:rtp_rtcp_format" ] + absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] seed_corpus = "corpora/rtp-corpus" } @@ -461,8 +478,8 @@ webrtc_fuzzer_test("audio_processing_fuzzer") { "../../rtc_base:rtc_task_queue", "../../rtc_base:safe_minmax", "../../system_wrappers:field_trial", - "//third_party/abseil-cpp/absl/memory", ] + absl_deps = [ "//third_party/abseil-cpp/absl/memory" ] seed_corpus = "corpora/audio_processing-corpus" } diff --git a/webrtc.gni b/webrtc.gni index e5fddfae8f..680762f3a1 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -532,8 +532,8 @@ template("rtc_source_set") { public_configs += invoker.public_configs } - # If absl_deps if [], no action is needed. If not [], then if needs to be - # converted to //third_party/abseil-cpp:absl if is_component_build=true + # If absl_deps is [], no action is needed. If not [], then it needs to be + # converted to //third_party/abseil-cpp:absl when build_with_chromium=true # otherwise it just needs to be added to deps. if (absl_deps != []) { if (!defined(deps)) { @@ -621,8 +621,8 @@ template("rtc_static_library") { public_configs += invoker.public_configs } - # If absl_deps if [], no action is needed. If not [], then if needs to be - # converted to //third_party/abseil-cpp:absl if is_component_build=true + # If absl_deps is [], no action is needed. If not [], then it needs to be + # converted to //third_party/abseil-cpp:absl when build_with_chromium=true # otherwise it just needs to be added to deps. if (absl_deps != []) { if (!defined(deps)) { @@ -747,8 +747,8 @@ template("rtc_library") { public_configs += invoker.public_configs } - # If absl_deps if [], no action is needed. If not [], then if needs to be - # converted to //third_party/abseil-cpp:absl if is_component_build=true + # If absl_deps is [], no action is needed. If not [], then it needs to be + # converted to //third_party/abseil-cpp:absl when build_with_chromium=true # otherwise it just needs to be added to deps. if (absl_deps != []) { if (!defined(deps)) {