Add absl_deps field for rtc_test and rtc_executable

To be able to build these targets in chromium we need to replace all abseil dependencies with "//third_party/abseil-cpp:absl".

Bug: webrtc:12404
Change-Id: Ie0f6af73f2abc73e5744520cfd9a6414e2f948e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202762
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33108}
This commit is contained in:
Andrey Logvin 2021-01-29 10:50:19 +00:00 committed by Commit Bot
parent b79acd8ce9
commit 7864600a6e
9 changed files with 48 additions and 7 deletions

View file

@ -220,8 +220,8 @@ if (rtc_include_tests) {
"../test:test_support",
"../test/pc/e2e:network_quality_metrics_reporter",
"//testing/gtest",
"//third_party/abseil-cpp/absl/flags:flag",
]
absl_deps = [ "//third_party/abseil-cpp/absl/flags:flag" ]
if (is_android) {
deps += [ "//testing/android/native_test:native_test_native_code" ]
}

View file

@ -118,10 +118,11 @@ if (rtc_include_tests) {
"../test:test_support",
"../test:video_test_common",
"//testing/gtest",
"//third_party/abseil-cpp/absl/types:optional",
"//third_party/libyuv",
]
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
data = common_video_resources
if (is_android) {
deps += [ "//testing/android/native_test:native_test_support" ]

View file

@ -613,6 +613,8 @@ if (rtc_include_tests) {
"../test:test_main",
"../test:test_support",
"../test:video_test_common",
]
absl_deps = [
"//third_party/abseil-cpp/absl/algorithm:container",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",

View file

@ -1454,7 +1454,6 @@ if (rtc_include_tests) {
defines = audio_coding_defines
deps = audio_coding_deps + [
"//third_party/abseil-cpp/absl/strings",
"../../api/audio:audio_frame_api",
"../../rtc_base:checks",
":audio_coding",
@ -1466,6 +1465,8 @@ if (rtc_include_tests) {
"../../test:test_support",
"//testing/gtest",
]
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
}
audio_decoder_unittests_resources =
@ -1657,8 +1658,6 @@ if (rtc_include_tests) {
testonly = true
deps = audio_coding_deps + [
"//third_party/abseil-cpp/absl/flags:flag",
"//third_party/abseil-cpp/absl/flags:parse",
":audio_coding",
":audio_encoder_cng",
":neteq_input_audio_tools",
@ -1670,6 +1669,8 @@ if (rtc_include_tests) {
"../../api/audio_codecs/isac:audio_encoder_isac",
"../../api/audio_codecs/opus:audio_encoder_opus",
"../../rtc_base:safe_conversions",
"//third_party/abseil-cpp/absl/flags:flag",
"//third_party/abseil-cpp/absl/flags:parse",
"//third_party/abseil-cpp/absl/memory",
]

View file

@ -88,6 +88,7 @@ if (rtc_include_tests) {
deps = [
":av1_svc_config",
"../../../../api/video_codecs:video_codecs_api",
"../../../../test:test_support",
]
if (enable_libaom) {
@ -104,7 +105,6 @@ if (rtc_include_tests) {
"../../../../api/units:data_size",
"../../../../api/units:time_delta",
"../../../../api/video:video_frame",
"../../../../test:test_support",
"../../svc:scalability_structures",
"../../svc:scalable_video_controller",
]

View file

@ -113,6 +113,12 @@ rtc_library("video_quality_analysis") {
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}
# Abseil dependencies are not moved to the absl_deps field deliberately.
# If build_with_chromium is true, the absl_deps replaces the dependencies with
# the "//third_party/abseil-cpp:absl" target. Which doesn't include absl/flags
# (and some others) because they cannot be used in Chromiums. Special exception
# for the "frame_analyzer" target in "third_party/abseil-cpp/absl.gni" allows
# it to be build in chromium.
rtc_executable("frame_analyzer") {
visibility = [ "*" ]
testonly = true
@ -148,6 +154,13 @@ if (!is_component_build) {
# This target can be built from Chromium but it doesn't support
# is_component_build=true because it depends on WebRTC testonly code
# which is not part of //third_party/webrtc_overrides:webrtc_component.
# Abseil dependencies are not moved to the absl_deps field deliberately.
# If build_with_chromium is true, the absl_deps replaces the dependencies with
# the "//third_party/abseil-cpp:absl" target. Which doesn't include absl/flags
# (and some others) because they cannot be used in Chromiums. Special exception
# for the "frame_analyzer" target in "third_party/abseil-cpp/absl.gni" allows
# it to be build in chromium.
rtc_executable("rtp_generator") {
visibility = [ "*" ]
testonly = true
@ -201,6 +214,13 @@ if (!is_component_build) {
# This target can be built from Chromium but it doesn't support
# is_component_build=true because it depends on WebRTC testonly code
# which is not part of //third_party/webrtc_overrides:webrtc_component.
# Abseil dependencies are not moved to the absl_deps field deliberately.
# If build_with_chromium is true, the absl_deps replaces the dependencies with
# the "//third_party/abseil-cpp:absl" target. Which doesn't include absl/flags
# (and some others) because they cannot be used in Chromiums. Special exception
# for the "frame_analyzer" target in "third_party/abseil-cpp/absl.gni" allows
# it to be build in chromium.
rtc_executable("video_replay") {
visibility = [ "*" ]
testonly = true

View file

@ -130,9 +130,10 @@ if (rtc_include_tests) {
"../test:test_main",
"../test:test_support",
"//testing/gtest",
"//third_party/abseil-cpp/absl/strings",
]
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
if (is_android) {
deps += [ "//testing/android/native_test:native_test_support" ]

View file

@ -335,6 +335,7 @@ if (rtc_include_tests) {
"../test:test_support",
]
}
rtc_library("video_quality_test") {
testonly = true

View file

@ -475,6 +475,21 @@ template("rtc_test") {
xctest_module_target = "//base/test:google_test_runner"
}
}
# 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 (defined(absl_deps) && absl_deps != []) {
if (!defined(deps)) {
deps = []
}
if (build_with_chromium) {
deps += [ "//third_party/abseil-cpp:absl" ]
} else {
deps += absl_deps
}
}
if (using_sanitizer) {
if (is_linux) {
if (!defined(invoker.data)) {