webrtc/rtc_tools/network_tester/BUILD.gn
Mirko Bonadei e5f4c6b8d2 Reland "Refactor rtc_base build targets."
This is a reland of 69241a93fb

Fix: The problem was related to NO_MAIN_THREAD_WRAPPING, which
affects https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/rtc_base/thread.cc;l=257-263;drc=7acc2d9fe3a6e3c4d8881d2bdfc9b8968a724cd5.
The original CL didn't attach the definition of the macro
NO_MAIN_THREAD_WRAPPING when building for Chromium (which doesn't have
to be related to //rtc_base anymore but to //rtc_base:threading).

Original change's description:
> Refactor rtc_base build targets.
>
> The "//rtc_base:rtc_base" build target has historically been one of the
> biggest targets in the WebRTC build. Big targets are the main source of
> circular dependencies and non-API types leakage.
>
> This CL is a step forward into splitting "//rtc_base:rtc_base" into
> smaller targets (as originally started in 2018).
>
> The only non-automated changes are (like re-wiring the build system):
> * The creation of //rtc_base/async_resolver.{h,cc} which allows to
>   break a circular dependency (is has been extracted from
>   //rtc_base/net_helpers.{h,cc}).
> * The creation of //rtc_base/internal/default_socket_server.{h,cc} to
>   break another circular dependency.
>
> Bug: webrtc:9987
> Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32941}

Bug: webrtc:9987
Change-Id: I7cdf49d2aac8357f1f50f90010bf2c2f62fa19f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202021
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33001}
2021-01-15 17:00:05 +00:00

169 lines
4.8 KiB
Text

# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
import("../../webrtc.gni")
if (rtc_enable_protobuf) {
import("//third_party/protobuf/proto_library.gni")
}
if (rtc_enable_protobuf) {
proto_library("network_tester_config_proto") {
sources = [ "network_tester_config.proto" ]
proto_out_dir = "rtc_tools/network_tester"
}
proto_library("network_tester_packet_proto") {
sources = [ "network_tester_packet.proto" ]
proto_out_dir = "rtc_tools/network_tester"
}
rtc_library("network_tester") {
sources = [
"config_reader.cc",
"config_reader.h",
"packet_logger.cc",
"packet_logger.h",
"packet_sender.cc",
"packet_sender.h",
"test_controller.cc",
"test_controller.h",
]
defines = [ "WEBRTC_NETWORK_TESTER_PROTO" ]
deps = [
":network_tester_config_proto",
":network_tester_packet_proto",
"../../api/task_queue",
"../../api/task_queue:default_task_queue_factory",
"../../p2p",
"../../rtc_base",
"../../rtc_base:checks",
"../../rtc_base:ignore_wundef",
"../../rtc_base:ip_address",
"../../rtc_base:protobuf_utils",
"../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_task_queue",
"../../rtc_base:socket_address",
"../../rtc_base:threading",
"../../rtc_base/synchronization:mutex",
"../../rtc_base/synchronization:sequence_checker",
"../../rtc_base/system:no_unique_address",
"../../rtc_base/third_party/sigslot",
]
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}
network_tester_unittests_resources = [
"../../resources/network_tester/client_config.dat",
"../../resources/network_tester/server_config.dat",
]
if (is_ios) {
bundle_data("network_tester_unittests_bundle_data") {
testonly = true
sources = network_tester_unittests_resources
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
}
}
rtc_library("network_tester_unittests") {
testonly = true
sources = [ "network_tester_unittest.cc" ]
deps = [
":network_tester",
"../../rtc_base:gunit_helpers",
"../../test:fileutils",
"../../test:test_support",
"//testing/gtest",
]
if (is_ios) {
deps += [ ":network_tester_unittests_bundle_data" ]
}
defines = [ "WEBRTC_NETWORK_TESTER_TEST_ENABLED" ]
data = network_tester_unittests_resources
}
rtc_executable("network_tester_server") {
sources = [ "server.cc" ]
deps = [ ":network_tester" ]
}
}
if (is_android) {
rtc_android_apk("NetworkTesterMobile") {
testonly = true
apk_name = "NetworkTesterMobile"
android_manifest = "androidapp/AndroidManifest.xml"
min_sdk_version = 21
target_sdk_version = 24
deps = [
":NetworkTesterMobile_javalib",
":NetworkTesterMobile_resources",
"../../rtc_base:base_java",
]
shared_libraries = [ "../../rtc_tools/network_tester:network_tester_so" ]
}
rtc_android_library("NetworkTesterMobile_javalib") {
testonly = true
android_manifest = "androidapp/AndroidManifest.xml"
sources = [
"androidapp/src/com/google/media/networktester/MainActivity.java",
"androidapp/src/com/google/media/networktester/NetworkTester.java",
]
resources_package = "com.google.media.networktester"
deps = [
":NetworkTesterMobile_resources",
"../../rtc_base:base_java",
]
}
android_resources("NetworkTesterMobile_resources") {
testonly = true
custom_package = "com.google.media.networktester"
sources = [
"androidapp/res/layout/activity_main.xml",
"androidapp/res/mipmap-hdpi/ic_launcher.png",
"androidapp/res/mipmap-mdpi/ic_launcher.png",
"androidapp/res/mipmap-xhdpi/ic_launcher.png",
"androidapp/res/mipmap-xxhdpi/ic_launcher.png",
"androidapp/res/mipmap-xxxhdpi/ic_launcher.png",
"androidapp/res/values-v17/styles.xml",
"androidapp/res/values-w820dp/dimens.xml",
"androidapp/res/values/colors.xml",
"androidapp/res/values/dimens.xml",
"androidapp/res/values/strings.xml",
]
# Needed for Bazel converter.
resource_dirs = [ "androidapp/res" ]
assert(resource_dirs != []) # Mark as used.
}
rtc_shared_library("network_tester_so") {
sources = [ "jni.cpp" ]
deps = [ ":network_tester" ]
suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ "//build/config/android:hide_all_but_jni" ]
output_extension = "so"
}
}