blob: f35002892d9d665496c745f07f7b37e00dfab8ba [file] [log] [blame]
# Copyright (c) 2014 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("//build/config/crypto.gni")
import("//build/config/ui.gni")
import("../webrtc.gni")
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
}
config("rtc_base_chromium_config") {
defines = [ "NO_MAIN_THREAD_WRAPPING" ]
}
config("rtc_base_all_dependent_config") {
if (is_ios) {
libs = [
"CFNetwork.framework",
"Foundation.framework",
"Security.framework",
"SystemConfiguration.framework",
"UIKit.framework",
]
}
if (is_mac) {
libs = [
"Cocoa.framework",
"Foundation.framework",
"IOKit.framework",
"Security.framework",
"SystemConfiguration.framework",
]
}
}
if (!rtc_build_ssl) {
config("external_ssl_library") {
assert(rtc_ssl_root != "",
"You must specify rtc_ssl_root when rtc_build_ssl==0.")
include_dirs = [ rtc_ssl_root ]
}
}
rtc_source_set("protobuf_utils") {
visibility = [ "*" ]
sources = [
"protobuf_utils.h",
]
if (rtc_enable_protobuf) {
public_configs = [ "//third_party/protobuf:protobuf_config" ]
deps = [
"//third_party/protobuf:protobuf_lite",
]
}
}
rtc_source_set("compile_assert_c") {
sources = [
"compile_assert_c.h",
]
}
# The subset of rtc_base approved for use outside of libjingle.
# TODO(bugs.webrtc.org/9838): Create small and focused build targets and remove
# the old concept of rtc_base and rtc_base_approved.
rtc_source_set("rtc_base_approved") {
visibility = [ "*" ]
deps = [
":checks",
":rtc_task_queue",
":safe_compare",
":safe_minmax",
":type_traits",
"../api:array_view",
"../system_wrappers:field_trial",
"experiments:field_trial_parser",
"system:arch",
"system:unused",
"third_party/base64",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/types:optional",
]
sources = [
"bind.h",
"bitbuffer.cc",
"bitbuffer.h",
"bitrateallocationstrategy.cc",
"bitrateallocationstrategy.h",
"buffer.h",
"bufferqueue.cc",
"bufferqueue.h",
"bytebuffer.cc",
"bytebuffer.h",
"byteorder.h",
"copyonwritebuffer.cc",
"copyonwritebuffer.h",
"event_tracer.cc",
"event_tracer.h",
"file.cc",
"file.h",
"flags.cc",
"flags.h",
"function_view.h",
"ignore_wundef.h",
"location.cc",
"location.h",
"message_buffer_reader.h",
"numerics/histogram_percentile_counter.cc",
"numerics/histogram_percentile_counter.h",
"numerics/mod_ops.h",
"numerics/moving_max_counter.h",
"numerics/sample_counter.cc",
"numerics/sample_counter.h",
"onetimeevent.h",
"platform_file.cc",
"platform_file.h",
"race_checker.cc",
"race_checker.h",
"random.cc",
"random.h",
"rate_statistics.cc",
"rate_statistics.h",
"ratetracker.cc",
"ratetracker.h",
"swap_queue.h",
"template_util.h",
"timestampaligner.cc",
"timestampaligner.h",
"trace_event.h",
"zero_memory.cc",
"zero_memory.h",
]
if (is_posix || is_fuchsia) {
sources += [ "file_posix.cc" ]
}
if (is_win) {
sources += [
"file_win.cc",
"win/windows_version.cc",
"win/windows_version.h",
]
data_deps = [
"//build/win:runtime_libs",
]
}
if (is_nacl) {
deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
}
if (is_android) {
libs = [ "log" ]
}
public_deps = [ # no-presubmit-check TODO(webrtc:8603)
":atomicops",
":criticalsection",
":logging",
":macromagic",
":platform_thread",
":platform_thread_types",
":ptr_util",
":refcount",
":rtc_event",
":safe_conversions",
":stringutils",
":thread_checker",
":timeutils",
]
}
rtc_source_set("macromagic") {
# TODO(bugs.webrtc.org/9606): This should not be public.
visibility = [ "*" ]
sources = [
"arraysize.h",
"constructormagic.h",
"format_macros.h",
"stringize_macros.h",
"thread_annotations.h",
]
deps = [
"system:arch",
]
}
rtc_source_set("platform_thread_types") {
sources = [
"platform_thread_types.cc",
"platform_thread_types.h",
]
}
rtc_source_set("ptr_util") {
visibility = [ "*" ]
sources = [
"scoped_ref_ptr.h",
]
deps = [
"../api:scoped_refptr",
]
}
rtc_source_set("refcount") {
visibility = [ "*" ]
sources = [
"refcount.h",
"refcountedobject.h",
"refcounter.h",
]
deps = [
":atomicops",
":macromagic",
]
}
rtc_source_set("criticalsection") {
sources = [
"criticalsection.cc",
"criticalsection.h",
]
deps = [
":atomicops",
":checks",
":macromagic",
":platform_thread_types",
"system:unused",
]
}
rtc_source_set("platform_thread") {
visibility = [
":rtc_base_approved",
":rtc_task_queue_libevent",
":rtc_task_queue_win",
":rtc_task_queue_stdlib",
":sequenced_task_checker",
]
sources = [
"platform_thread.cc",
"platform_thread.h",
]
deps = [
":atomicops",
":checks",
":macromagic",
":platform_thread_types",
":rtc_event",
":thread_checker",
":timeutils",
]
}
rtc_source_set("rtc_event") {
deps = [
":checks",
]
if (build_with_chromium) {
# Dependency on chromium's waitable_event (in //base).
deps += [ "//base:base" ]
sources = [
"../../webrtc_overrides/rtc_base/event.cc",
"../../webrtc_overrides/rtc_base/event.h",
]
} else {
sources = [
"event.cc",
"event.h",
]
}
}
rtc_source_set("logging") {
visibility = [ "*" ]
libs = []
deps = [
":checks",
":criticalsection",
":macromagic",
":platform_thread_types",
":stringutils",
":timeutils",
"//third_party/abseil-cpp/absl/strings",
]
if (build_with_chromium) {
# Dependency on chromium's logging (in //base).
deps += [ "//base:base" ]
sources = [
"../../webrtc_overrides/rtc_base/logging.cc",
"../../webrtc_overrides/rtc_base/logging.h",
]
} else {
configs += [
"..:no_exit_time_destructors",
"..:no_global_constructors",
]
sources = [
"logging.cc",
"logging.h",
]
deps += [ "system:inline" ]
if (is_mac) {
deps += [ ":logging_mac" ]
}
# logging.h needs the deprecation header while downstream projects are
# removing code that depends on logging implementation details.
deps += [ ":deprecation" ]
if (is_android) {
libs += [ "log" ]
}
}
}
rtc_source_set("thread_checker") {
sources = [
"thread_checker.h",
"thread_checker_impl.cc",
"thread_checker_impl.h",
]
deps = [
":checks",
":criticalsection",
":macromagic",
":platform_thread_types",
]
}
rtc_source_set("atomicops") {
sources = [
"atomicops.h",
]
}
rtc_source_set("checks") {
# TODO(bugs.webrtc.org/9607): This should not be public.
visibility = [ "*" ]
libs = []
sources = [
"checks.cc",
"checks.h",
]
deps = [
":safe_compare",
"system:inline",
]
if (is_android) {
libs += [ "log" ]
}
}
rtc_source_set("rate_limiter") {
sources = [
"rate_limiter.cc",
"rate_limiter.h",
]
deps = [
":rtc_base_approved",
"../system_wrappers",
"//third_party/abseil-cpp/absl/types:optional",
]
}
rtc_source_set("sanitizer") {
sources = [
"sanitizer.h",
]
deps = [
"//third_party/abseil-cpp/absl/meta:type_traits",
]
}
rtc_source_set("safe_compare") {
sources = [
"numerics/safe_compare.h",
]
deps = [
":type_traits",
]
}
rtc_source_set("safe_minmax") {
sources = [
"numerics/safe_minmax.h",
]
deps = [
":checks",
":safe_compare",
":type_traits",
]
}
rtc_source_set("safe_conversions") {
sources = [
"numerics/safe_conversions.h",
"numerics/safe_conversions_impl.h",
]
deps = [
":checks",
]
}
rtc_source_set("timeutils") {
visibility = [ "*" ]
sources = [
"timeutils.cc",
"timeutils.h",
]
deps = [
":checks",
":safe_conversions",
":stringutils",
]
}
rtc_source_set("stringutils") {
sources = [
"string_to_number.cc",
"string_to_number.h",
"stringencode.cc",
"stringencode.h",
"strings/string_builder.cc",
"strings/string_builder.h",
"stringutils.cc",
"stringutils.h",
]
deps = [
":checks",
":macromagic",
":safe_minmax",
"../api:array_view",
"//third_party/abseil-cpp/absl/strings:strings",
"//third_party/abseil-cpp/absl/types:optional",
]
}
rtc_source_set("audio_format_to_string") {
sources = [
"strings/audio_format_to_string.cc",
"strings/audio_format_to_string.h",
]
deps = [
":stringutils",
"../api/audio_codecs:audio_codecs_api",
]
}
rtc_source_set("type_traits") {
sources = [
"type_traits.h",
]
}
rtc_source_set("deprecation") {
sources = [
"deprecation.h",
]
}
if (is_mac && !build_with_chromium) {
rtc_source_set("logging_mac") {
visibility = [ ":logging" ]
libs = [ "Foundation.framework" ]
sources = [
"logging_mac.h",
"logging_mac.mm",
]
}
}
rtc_source_set("rtc_task_queue") {
visibility = [ "*" ]
deps = []
public_deps = [
":rtc_task_queue_api",
]
if (rtc_link_task_queue_impl) {
deps += [ ":rtc_task_queue_impl" ]
}
}
# WebRTC targets must not directly depend on rtc_task_queue_api or
# rtc_task_queue_impl. Instead, depend on rtc_task_queue.
# The build flag |rtc_link_task_queue_impl| decides if WebRTC targets will link
# to the default implemenation in rtc_task_queue_impl or if an externally
# provided implementation should be used. An external implementation should
# depend on rtc_task_queue_api.
rtc_source_set("rtc_task_queue_api") {
# The visibility list is commented out so that we won't break external
# implementations, but left here to manually test as well as for sake of what
# targets we expect to depend on rtc_task_queue_api.
# visibility = [
# ":rtc_task_queue",
# ":rtc_task_queue_impl",
# ":sequenced_task_checker",
# ]
sources = [
"task_queue.h",
]
deps = [
":macromagic",
":ptr_util",
"system:rtc_export",
"//third_party/abseil-cpp/absl/memory",
]
}
rtc_source_set("rtc_cancelable_task") {
sources = [
"cancelable_periodic_task.h",
"cancelable_task_handle.cc",
"cancelable_task_handle.h",
]
deps = [
":checks",
":logging",
":macromagic",
":ptr_util",
":refcount",
":rtc_task_queue",
":safe_conversions",
":sequenced_task_checker",
":thread_checker",
"//third_party/abseil-cpp/absl/memory",
]
}
if (rtc_enable_libevent) {
rtc_source_set("rtc_task_queue_libevent") {
visibility = [ ":rtc_task_queue_impl" ]
sources = [
"task_queue_libevent.cc",
"task_queue_posix.cc",
"task_queue_posix.h",
]
deps = [
":checks",
":criticalsection",
":logging",
":macromagic",
":platform_thread",
":platform_thread_types",
":ptr_util",
":refcount",
":rtc_task_queue_api",
":safe_conversions",
":timeutils",
"system:unused",
]
if (rtc_build_libevent) {
deps += [ "//base/third_party/libevent" ]
}
}
}
if (is_mac || is_ios) {
rtc_source_set("rtc_task_queue_gcd") {
visibility = [ ":rtc_task_queue_impl" ]
sources = [
"task_queue_gcd.cc",
"task_queue_posix.cc",
"task_queue_posix.h",
]
deps = [
":checks",
":logging",
":ptr_util",
":refcount",
":rtc_task_queue_api",
]
}
}
if (is_win) {
rtc_source_set("rtc_task_queue_win") {
visibility = [ ":rtc_task_queue_impl" ]
sources = [
"task_queue_win.cc",
]
deps = [
":checks",
":criticalsection",
":logging",
":macromagic",
":platform_thread",
":ptr_util",
":refcount",
":rtc_event",
":rtc_task_queue_api",
":safe_conversions",
":timeutils",
]
}
}
rtc_source_set("rtc_task_queue_stdlib") {
visibility = [ ":rtc_task_queue_impl" ]
sources = [
"task_queue_stdlib.cc",
]
deps = [
":checks",
":criticalsection",
":logging",
":macromagic",
":platform_thread",
":ptr_util",
":refcount",
":rtc_event",
":rtc_task_queue_api",
":safe_conversions",
":timeutils",
]
}
rtc_source_set("rtc_task_queue_impl") {
visibility = [ "*" ]
if (rtc_enable_libevent) {
deps = [
":rtc_task_queue_libevent",
]
} else {
if (is_mac || is_ios) {
deps = [
":rtc_task_queue_gcd",
]
}
if (is_win) {
if (current_os == "winuwp") {
deps = [
":rtc_task_queue_stdlib",
]
} else {
deps = [
":rtc_task_queue_win",
]
}
}
}
}
rtc_source_set("sequenced_task_checker") {
sources = [
"sequenced_task_checker.h",
"sequenced_task_checker_impl.cc",
"sequenced_task_checker_impl.h",
]
deps = [
":checks",
":criticalsection",
":macromagic",
":rtc_task_queue",
":thread_checker",
]
}
rtc_static_library("weak_ptr") {
sources = [
"weak_ptr.cc",
"weak_ptr.h",
]
deps = [
":ptr_util",
":refcount",
":sequenced_task_checker",
]
}
rtc_static_library("rtc_numerics") {
sources = [
"numerics/exp_filter.cc",
"numerics/exp_filter.h",
"numerics/moving_average.cc",
"numerics/moving_average.h",
"numerics/moving_median_filter.h",
"numerics/percentile_filter.h",
"numerics/samples_stats_counter.cc",
"numerics/samples_stats_counter.h",
"numerics/sequence_number_util.h",
]
deps = [
":checks",
":rtc_base_approved",
":safe_compare",
"//third_party/abseil-cpp/absl/types:optional",
]
}
rtc_source_set("rtc_json") {
defines = []
sources = [
"strings/json.cc",
"strings/json.h",
]
deps = [
":stringutils",
]
all_dependent_configs = [ "//third_party/jsoncpp:jsoncpp_config" ]
if (rtc_build_json) {
public_deps = [
"//third_party/jsoncpp",
]
} else {
include_dirs = [ "$rtc_jsoncpp_root" ]
# When defined changes the include path for json.h to where it is
# expected to be when building json outside of the standalone build.
defines += [ "WEBRTC_EXTERNAL_JSON" ]
}
}
rtc_source_set("nethelpers") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "nethelpers.cc",
# "nethelpers.h",
# ]
}
rtc_source_set("asyncresolverinterface") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "asyncresolverinterface.cc",
# "asyncresolverinterface.h",
# ]
}
rtc_source_set("ipaddress") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "ipaddress.cc",
# "ipaddress.h",
# ]
}
rtc_source_set("socketaddress") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "socketaddress.cc",
# "socketaddress.h",
# ]
}
rtc_source_set("nullsocketserver") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "nullsocketserver.cc",
# "nullsocketserver.h",
# ]
}
rtc_source_set("socketserver") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "socketserver.h",
# ]
}
rtc_source_set("threading") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "asyncresolver.cc",
# "asyncresolver.h",
# "defaultsocketserver.cc",
# "defaultsocketserver.h",
# "messagehandler.cc",
# "messagehandler.h",
# "messagequeue.cc",
# "messagequeue.h",
# "networkmonitor.cc",
# "networkmonitor.h",
# "physicalsocketserver.cc",
# "physicalsocketserver.h",
# "signalthread.cc",
# "signalthread.h",
# "thread.cc",
# "thread.h",
# ]
}
rtc_source_set("socketfactory") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "socketfactory.h",
# ]
}
rtc_source_set("asyncsocket") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "asyncsocket.cc",
# "asyncsocket.h",
# ]
}
rtc_source_set("socket") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "socket.cc",
# "socket.h",
# ]
}
rtc_source_set("network_constants") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "network_constants.h",
# ]
}
if (is_android) {
rtc_source_set("ifaddrs_android") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "ifaddrs-android.cc",
# "ifaddrs-android.h",
# ]
}
}
if (is_win) {
rtc_source_set("win32") {
# TODO(bugs.webrtc.org/9987): This build target will soon contain
# the following files:
# sources = [
# "win32.cc",
# "win32.h",
# ]
}
}
rtc_static_library("rtc_base") {
visibility = [ "*" ]
cflags = []
cflags_cc = []
libs = []
defines = []
deps = [
":checks",
":stringutils",
"..:webrtc_common",
"../api:array_view",
"network:sent_packet",
"third_party/base64",
"third_party/sigslot",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
]
public_deps = [
":rtc_base_approved",
]
public_configs = []
all_dependent_configs = [ ":rtc_base_all_dependent_config" ]
sources = [
"asyncinvoker-inl.h",
"asyncinvoker.cc",
"asyncinvoker.h",
"asyncpacketsocket.cc",
"asyncpacketsocket.h",
"asyncresolverinterface.cc",
"asyncresolverinterface.h",
"asyncsocket.cc",
"asyncsocket.h",
"asynctcpsocket.cc",
"asynctcpsocket.h",
"asyncudpsocket.cc",
"asyncudpsocket.h",
"crc32.cc",
"crc32.h",
"cryptstring.cc",
"cryptstring.h",
"data_rate_limiter.cc",
"data_rate_limiter.h",
"dscp.h",
"filerotatingstream.cc",
"filerotatingstream.h",
"gunit_prod.h",
"helpers.cc",
"helpers.h",
"httpcommon.cc",
"httpcommon.h",
"ipaddress.cc",
"ipaddress.h",
"keep_ref_until_done.h",
"key_derivation.cc",
"key_derivation.h",
"mdns_responder_interface.h",
"messagedigest.cc",
"messagedigest.h",
"messagehandler.cc",
"messagehandler.h",
"messagequeue.cc",
"messagequeue.h",
"nethelper.cc",
"nethelper.h",
"nethelpers.cc",
"nethelpers.h",
"network.cc",
"network.h",
"network_constants.h",
"networkmonitor.cc",
"networkmonitor.h",
"networkroute.h",
"nullsocketserver.cc",
"nullsocketserver.h",
"openssl.h",
"openssl_key_derivation_hkdf.cc",
"openssl_key_derivation_hkdf.h",
"openssladapter.cc",
"openssladapter.h",
"opensslcertificate.cc",
"opensslcertificate.h",
"openssldigest.cc",
"openssldigest.h",
"opensslidentity.cc",
"opensslidentity.h",
"opensslsessioncache.cc",
"opensslsessioncache.h",
"opensslstreamadapter.cc",
"opensslstreamadapter.h",
"opensslutility.cc",
"opensslutility.h",
"physicalsocketserver.cc",
"physicalsocketserver.h",
"proxyinfo.cc",
"proxyinfo.h",
"rtccertificate.cc",
"rtccertificate.h",
"rtccertificategenerator.cc",
"rtccertificategenerator.h",
"signalthread.cc",
"signalthread.h",
"sigslotrepeater.h",
"socket.cc",
"socket.h",
"socketadapters.cc",
"socketadapters.h",
"socketaddress.cc",
"socketaddress.h",
"socketaddresspair.cc",
"socketaddresspair.h",
"socketfactory.h",
"socketserver.h",
"ssladapter.cc",
"ssladapter.h",
"sslcertificate.cc",
"sslcertificate.h",
"sslfingerprint.cc",
"sslfingerprint.h",
"sslidentity.cc",
"sslidentity.h",
"sslstreamadapter.cc",
"sslstreamadapter.h",
"stream.cc",
"stream.h",
"thread.cc",
"thread.h",
]
if (build_with_chromium) {
include_dirs = [ "../../boringssl/src/include" ]
public_configs += [ ":rtc_base_chromium_config" ]
} else {
sources += [
"callback.h",
"logsinks.cc",
"logsinks.h",
"numerics/mathutils.h",
"rollingaccumulator.h",
"sslroots.h",
]
if (is_win) {
sources += [ "win32socketinit.h" ]
if (current_os != "winuwp") {
sources += [
"win32socketserver.cc",
"win32socketserver.h",
]
}
}
} # !build_with_chromium
if (rtc_build_ssl) {
deps += [ "//third_party/boringssl" ]
} else {
configs += [ ":external_ssl_library" ]
}
if (is_android) {
sources += [
"ifaddrs-android.cc",
"ifaddrs-android.h",
]
libs += [
"log",
"GLESv2",
]
}
if (is_ios || is_mac) {
sources += [ "macifaddrs_converter.cc" ]
deps += [ "system:cocoa_threading" ]
}
if (rtc_use_x11) {
libs += [
"dl",
"rt",
"Xext",
"X11",
"Xcomposite",
"Xrender",
]
}
if (is_linux) {
libs += [
"dl",
"rt",
]
}
if (is_mac) {
sources += [
"macutils.cc",
"macutils.h",
]
}
if (is_win) {
sources += [
"win32.cc",
"win32.h",
"win32window.cc",
"win32window.h",
]
libs += [
"crypt32.lib",
"iphlpapi.lib",
"secur32.lib",
]
defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
}
if (is_posix || is_fuchsia) {
sources += [
"ifaddrs_converter.cc",
"ifaddrs_converter.h",
]
}
if (is_nacl) {
deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
defines += [ "timezone=_timezone" ]
sources -= [ "ifaddrs_converter.cc" ]
}
}
rtc_source_set("gtest_prod") {
visibility = [ "*" ]
sources = [
"gtest_prod_util.h",
]
}
rtc_source_set("gunit_helpers") {
testonly = true
sources = [
"gunit.cc",
"gunit.h",
]
deps = [
":logging",
":rtc_base",
":rtc_base_tests_utils",
":stringutils",
"../test:test_support",
"//third_party/abseil-cpp/absl/strings",
]
}
rtc_source_set("testclient") {
testonly = true
sources = [
"testclient.cc",
"testclient.h",
]
deps = [
":criticalsection",
":gunit_helpers",
":macromagic",
":rtc_base",
":rtc_base_tests_utils",
":timeutils",
"//third_party/abseil-cpp/absl/memory",
]
}
rtc_source_set("rtc_base_tests_utils") {
testonly = true
sources = [
"cpu_time.cc",
"cpu_time.h",
"fake_mdns_responder.h",
"fakeclock.cc",
"fakeclock.h",
"fakenetwork.h",
"fakesslidentity.cc",
"fakesslidentity.h",
"firewallsocketserver.cc",
"firewallsocketserver.h",
"memory_stream.cc",
"memory_stream.h",
"memory_usage.cc",
"memory_usage.h",
"natserver.cc",
"natserver.h",
"natsocketfactory.cc",
"natsocketfactory.h",
"nattypes.cc",
"nattypes.h",
"proxyserver.cc",
"proxyserver.h",
"server_socket_adapters.cc",
"server_socket_adapters.h",
"sigslottester.h",
"sigslottester.h.pump",
"socketstream.cc",
"socketstream.h",
"testbase64.h",
"testcertificateverifier.h",
"testechoserver.cc",
"testechoserver.h",
"testutils.cc",
"testutils.h",
"virtualsocketserver.cc",
"virtualsocketserver.h",
]
deps = [
":checks",
":rtc_base",
"../api/units:time_delta",
"third_party/sigslot",
"//third_party/abseil-cpp/absl/memory",
]
}
rtc_source_set("rtc_task_queue_for_test") {
visibility = [ "*" ]
testonly = true
sources = [
"task_queue_for_test.cc",
"task_queue_for_test.h",
]
deps = [
":checks",
":rtc_base_approved",
":rtc_task_queue",
]
}
if (rtc_include_tests) {
rtc_source_set("sigslot_unittest") {
testonly = true
sources = [
"sigslot_unittest.cc",
]
deps = [
":gunit_helpers",
":rtc_base",
":rtc_base_tests_utils",
"../test:test_support",
"third_party/sigslot",
]
}
rtc_source_set("rtc_base_tests_main") {
testonly = true
sources = [
"unittest_main.cc",
]
deps = [
":gunit_helpers",
":rtc_base",
":rtc_base_approved",
":rtc_base_tests_utils",
"../system_wrappers:field_trial",
"../system_wrappers:metrics",
"../test:field_trial",
"../test:test_support",
]
public_deps = [
"//testing/gtest",
]
}
rtc_source_set("rtc_base_nonparallel_tests") {
testonly = true
sources = [
"cpu_time_unittest.cc",
"filerotatingstream_unittest.cc",
"nullsocketserver_unittest.cc",
"physicalsocketserver_unittest.cc",
"socket_unittest.cc",
"socket_unittest.h",
"socketaddress_unittest.cc",
]
deps = [
":checks",
":gunit_helpers",
":rtc_base",
":rtc_base_tests_main",
":rtc_base_tests_utils",
":testclient",
"../system_wrappers:system_wrappers",
"../test:fileutils",
"../test:test_support",
"third_party/sigslot:sigslot",
"//testing/gtest",
"//third_party/abseil-cpp/absl/memory",
]
if (is_win) {
sources += [ "win32socketserver_unittest.cc" ]
}
}
rtc_source_set("rtc_base_approved_unittests") {
testonly = true
if (is_msan) {
cflags = [ "-fsanitize=memory" ]
}
sources = [
"atomicops_unittest.cc",
"base64_unittest.cc",
"bind_unittest.cc",
"bitbuffer_unittest.cc",
"bitrateallocationstrategy_unittest.cc",
"buffer_unittest.cc",
"bufferqueue_unittest.cc",
"bytebuffer_unittest.cc",
"byteorder_unittest.cc",
"copyonwritebuffer_unittest.cc",
"criticalsection_unittest.cc",
"event_tracer_unittest.cc",
"event_unittest.cc",
"file_unittest.cc",
"function_view_unittest.cc",
"logging_unittest.cc",
"numerics/histogram_percentile_counter_unittest.cc",
"numerics/mod_ops_unittest.cc",
"numerics/moving_max_counter_unittest.cc",
"numerics/safe_compare_unittest.cc",
"numerics/safe_minmax_unittest.cc",
"numerics/sample_counter_unittest.cc",
"onetimeevent_unittest.cc",
"platform_file_unittest.cc",
"platform_thread_unittest.cc",
"random_unittest.cc",
"rate_limiter_unittest.cc",
"rate_statistics_unittest.cc",
"ratetracker_unittest.cc",
"refcountedobject_unittest.cc",
"sanitizer_unittest.cc",
"string_to_number_unittest.cc",
"stringencode_unittest.cc",
"stringize_macros_unittest.cc",
"strings/string_builder_unittest.cc",
"stringutils_unittest.cc",
"swap_queue_unittest.cc",
"thread_annotations_unittest.cc",
"thread_checker_unittest.cc",
"timestampaligner_unittest.cc",
"timeutils_unittest.cc",
"virtualsocket_unittest.cc",
"zero_memory_unittest.cc",
]
if (is_win) {
sources += [ "win/windows_version_unittest.cc" ]
}
deps = [
":checks",
":gunit_helpers",
":rate_limiter",
":rtc_base",
":rtc_base_approved",
":rtc_base_tests_main",
":rtc_base_tests_utils",
":rtc_task_queue",
":safe_compare",
":safe_minmax",
":sanitizer",
":stringutils",
":testclient",
"../api:array_view",
"../api/units:time_delta",
"../system_wrappers:system_wrappers",
"../test:fileutils",
"../test:test_support",
"memory:unittests",
"third_party/base64",
"third_party/sigslot:sigslot",
"//third_party/abseil-cpp/absl/memory",
]
}
rtc_source_set("rtc_task_queue_unittests") {
visibility = [ "*" ]
testonly = true
sources = [
"cancelable_periodic_task_unittest.cc",
"task_queue_unittest.cc",
]
deps = [
":gunit_helpers",
":rtc_base_approved",
":rtc_base_tests_main",
":rtc_base_tests_utils",
":rtc_cancelable_task",
":rtc_task_queue",
":rtc_task_queue_for_test",
"../test:test_support",
"//third_party/abseil-cpp/absl/memory",
]
}
rtc_source_set("sequenced_task_checker_unittests") {
testonly = true
sources = [
"sequenced_task_checker_unittest.cc",
]
deps = [
":checks",
":rtc_base_approved",
":rtc_base_tests_main",
":rtc_task_queue",
":sequenced_task_checker",
"../test:test_support",
]
}
rtc_source_set("weak_ptr_unittests") {
testonly = true
sources = [
"weak_ptr_unittest.cc",
]
deps = [
":gunit_helpers",
":rtc_base_approved",
":rtc_base_tests_main",
":rtc_base_tests_utils",
":rtc_event",
":rtc_task_queue",
":weak_ptr",
"../test:test_support",
"//third_party/abseil-cpp/absl/memory",
]
}
rtc_source_set("rtc_numerics_unittests") {
testonly = true
sources = [
"numerics/exp_filter_unittest.cc",
"numerics/moving_average_unittest.cc",
"numerics/moving_median_filter_unittest.cc",
"numerics/percentile_filter_unittest.cc",
"numerics/samples_stats_counter_unittest.cc",
"numerics/sequence_number_util_unittest.cc",
]
deps = [
":rtc_base_approved",
":rtc_base_tests_main",
":rtc_numerics",
"../test:test_support",
]
}
rtc_source_set("rtc_json_unittests") {
testonly = true
sources = [
"strings/json_unittest.cc",
]
deps = [
":gunit_helpers",
":rtc_base_tests_main",
":rtc_base_tests_utils",
":rtc_json",
"../test:test_support",
]
}
rtc_source_set("rtc_base_unittests") {
testonly = true
defines = []
sources = [
"callback_unittest.cc",
"crc32_unittest.cc",
"data_rate_limiter_unittest.cc",
"helpers_unittest.cc",
"ipaddress_unittest.cc",
"memory_usage_unittest.cc",
"messagedigest_unittest.cc",
"messagequeue_unittest.cc",
"nat_unittest.cc",
"network_unittest.cc",
"proxy_unittest.cc",
"rollingaccumulator_unittest.cc",
"rtccertificate_unittest.cc",
"rtccertificategenerator_unittest.cc",
"signalthread_unittest.cc",
"sigslottester_unittest.cc",
"stream_unittest.cc",
"testclient_unittest.cc",
"thread_unittest.cc",
]
if (is_win) {
sources += [
"win32_unittest.cc",
"win32window_unittest.cc",
]
}
if (is_posix || is_fuchsia) {
sources += [
"openssl_key_derivation_hkdf_unittest.cc",
"openssladapter_unittest.cc",
"opensslsessioncache_unittest.cc",
"opensslutility_unittest.cc",
"ssladapter_unittest.cc",
"sslidentity_unittest.cc",
"sslstreamadapter_unittest.cc",
]
}
deps = [
":checks",
":gunit_helpers",
":rtc_base_tests_main",
":rtc_base_tests_utils",
":stringutils",
":testclient",
"../api:array_view",
"../test:fileutils",
"../test:test_support",
"third_party/sigslot",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/types:optional",
]
public_deps = [
":rtc_base",
]
if (build_with_chromium) {
include_dirs = [ "../../boringssl/src/include" ]
}
if (rtc_build_ssl) {
deps += [ "//third_party/boringssl" ]
} else {
configs += [ ":external_ssl_library" ]
}
}
}
if (is_android) {
rtc_android_library("base_java") {
java_files = [
"java/src/org/webrtc/ContextUtils.java",
"java/src/org/webrtc/Loggable.java",
"java/src/org/webrtc/Logging.java",
"java/src/org/webrtc/Size.java",
"java/src/org/webrtc/ThreadUtils.java",
]
deps = [
"//third_party/android_deps:android_support_annotations_java",
]
}
}