blob: 0805a5c549387f15081fc6ccc5e76ead6e0ad80e [file] [log] [blame]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
Henrik Kjellander73e21802017-06-20 08:38:58 +02002#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
Henrik Kjellanderc0362762017-06-29 08:03:04 +02009import("//build/config/crypto.gni")
10import("//build/config/ui.gni")
Henrik Kjellander73e21802017-06-20 08:38:58 +020011import("../webrtc.gni")
12
13if (is_android) {
14 import("//build/config/android/config.gni")
15 import("//build/config/android/rules.gni")
16}
17
Niels Moller9d1840c2019-05-21 07:26:37 +000018config("rtc_base_chromium_config") {
19 defines = [ "NO_MAIN_THREAD_WRAPPING" ]
20}
21
Dan Minor9cdd8762018-01-16 10:40:39 -050022if (!rtc_build_ssl) {
Henrik Kjellanderc0362762017-06-29 08:03:04 +020023 config("external_ssl_library") {
24 assert(rtc_ssl_root != "",
25 "You must specify rtc_ssl_root when rtc_build_ssl==0.")
26 include_dirs = [ rtc_ssl_root ]
27 }
28}
29
Oleh Prypindd214742018-07-17 13:49:46 +020030rtc_source_set("protobuf_utils") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010031 sources = [ "protobuf_utils.h" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +020032 if (rtc_enable_protobuf) {
Mirko Bonadeid8661a02018-08-13 15:04:25 +020033 public_configs = [ "//third_party/protobuf:protobuf_config" ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010034 deps = [ "//third_party/protobuf:protobuf_lite" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +020035 }
36}
37
Oleh Prypindd214742018-07-17 13:49:46 +020038rtc_source_set("compile_assert_c") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010039 sources = [ "compile_assert_c.h" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +020040}
41
Mirko Bonadei3663ed32019-10-19 12:03:23 +020042rtc_source_set("ignore_wundef") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010043 sources = [ "ignore_wundef.h" ]
Mirko Bonadei3663ed32019-10-19 12:03:23 +020044}
45
Mirko Bonadeica270912018-10-10 15:51:03 +020046# The subset of rtc_base approved for use outside of libjingle.
Ilya Nikolaevskiy26341992018-11-05 12:55:18 +010047# TODO(bugs.webrtc.org/9838): Create small and focused build targets and remove
Mirko Bonadeica270912018-10-10 15:51:03 +020048# the old concept of rtc_base and rtc_base_approved.
Mirko Bonadei86d053c2019-10-17 21:32:04 +020049rtc_library("rtc_base_approved") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000050 visibility = [ "*" ]
Mirko Bonadeica270912018-10-10 15:51:03 +020051 deps = [
52 ":checks",
53 ":rtc_task_queue",
54 ":safe_compare",
55 ":type_traits",
Mirko Bonadeica270912018-10-10 15:51:03 +020056 "../api:array_view",
Mirko Bonadeid9708072019-01-25 20:26:48 +010057 "../api:scoped_refptr",
Mirko Bonadeica270912018-10-10 15:51:03 +020058 "system:arch",
Mirko Bonadei35214fc2019-09-23 14:54:28 +020059 "system:rtc_export",
Mirko Bonadeica270912018-10-10 15:51:03 +020060 "system:unused",
61 "third_party/base64",
Mirko Bonadeica270912018-10-10 15:51:03 +020062 "//third_party/abseil-cpp/absl/types:optional",
63 ]
Mirko Bonadeia7d8f192019-03-29 13:34:46 +010064 public_deps = [] # no-presubmit-check TODO(webrtc:8603)
Mirko Bonadeica270912018-10-10 15:51:03 +020065
66 sources = [
67 "bind.h",
Steve Anton10542f22019-01-11 09:11:00 -080068 "bit_buffer.cc",
69 "bit_buffer.h",
Mirko Bonadeica270912018-10-10 15:51:03 +020070 "buffer.h",
Steve Anton10542f22019-01-11 09:11:00 -080071 "buffer_queue.cc",
72 "buffer_queue.h",
73 "byte_buffer.cc",
74 "byte_buffer.h",
75 "byte_order.h",
76 "copy_on_write_buffer.cc",
77 "copy_on_write_buffer.h",
Mirko Bonadeica270912018-10-10 15:51:03 +020078 "event_tracer.cc",
79 "event_tracer.h",
Mirko Bonadeica270912018-10-10 15:51:03 +020080 "location.cc",
81 "location.h",
82 "message_buffer_reader.h",
83 "numerics/histogram_percentile_counter.cc",
84 "numerics/histogram_percentile_counter.h",
85 "numerics/mod_ops.h",
86 "numerics/moving_max_counter.h",
87 "numerics/sample_counter.cc",
88 "numerics/sample_counter.h",
Steve Anton10542f22019-01-11 09:11:00 -080089 "one_time_event.h",
Mirko Bonadeica270912018-10-10 15:51:03 +020090 "race_checker.cc",
91 "race_checker.h",
92 "random.cc",
93 "random.h",
94 "rate_statistics.cc",
95 "rate_statistics.h",
Steve Anton10542f22019-01-11 09:11:00 -080096 "rate_tracker.cc",
97 "rate_tracker.h",
Mirko Bonadeica270912018-10-10 15:51:03 +020098 "swap_queue.h",
Steve Anton10542f22019-01-11 09:11:00 -080099 "timestamp_aligner.cc",
100 "timestamp_aligner.h",
Mirko Bonadeica270912018-10-10 15:51:03 +0200101 "trace_event.h",
102 "zero_memory.cc",
103 "zero_memory.h",
104 ]
105
Mirko Bonadeica270912018-10-10 15:51:03 +0200106 if (is_win) {
107 sources += [
Mirko Bonadeica270912018-10-10 15:51:03 +0200108 "win/windows_version.cc",
109 "win/windows_version.h",
110 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100111 data_deps = [ "//build/win:runtime_libs" ]
Mirko Bonadeica270912018-10-10 15:51:03 +0200112 }
113
114 if (is_nacl) {
Mirko Bonadeia7d8f192019-03-29 13:34:46 +0100115 public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ] # no-presubmit-check TODO(webrtc:8603)
Mirko Bonadeica270912018-10-10 15:51:03 +0200116 }
117
118 if (is_android) {
119 libs = [ "log" ]
120 }
121
Mirko Bonadeia7d8f192019-03-29 13:34:46 +0100122 public_deps += [ # no-presubmit-check TODO(webrtc:8603)
Tommi8d2c5a82018-03-19 11:12:48 +0100123 ":atomicops",
124 ":criticalsection",
125 ":logging",
126 ":macromagic",
127 ":platform_thread",
128 ":platform_thread_types",
Tommi8d2c5a82018-03-19 11:12:48 +0100129 ":refcount",
Tommi8d2c5a82018-03-19 11:12:48 +0100130 ":rtc_event",
131 ":safe_conversions",
132 ":stringutils",
133 ":thread_checker",
134 ":timeutils",
mbonadeibc378472017-09-11 03:43:34 -0700135 ]
mbonadeibc378472017-09-11 03:43:34 -0700136}
137
Tommi8d2c5a82018-03-19 11:12:48 +0100138rtc_source_set("macromagic") {
Mirko Bonadei2ad8c432018-08-09 10:54:40 +0200139 # TODO(bugs.webrtc.org/9606): This should not be public.
140 visibility = [ "*" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100141 sources = [
142 "arraysize.h",
Steve Anton10542f22019-01-11 09:11:00 -0800143 "constructor_magic.h",
Tommi8d2c5a82018-03-19 11:12:48 +0100144 "format_macros.h",
145 "stringize_macros.h",
146 "thread_annotations.h",
147 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100148 deps = [ "system:arch" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100149}
150
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200151rtc_library("platform_thread_types") {
Tommi8d2c5a82018-03-19 11:12:48 +0100152 sources = [
153 "platform_thread_types.cc",
154 "platform_thread_types.h",
155 ]
156}
157
Tommi8d2c5a82018-03-19 11:12:48 +0100158rtc_source_set("refcount") {
Mirko Bonadeica14a3a2018-08-09 09:47:12 +0200159 visibility = [ "*" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100160 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800161 "ref_count.h",
162 "ref_counted_object.h",
163 "ref_counter.h",
Tommi8d2c5a82018-03-19 11:12:48 +0100164 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100165 deps = [ ":macromagic" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100166}
167
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200168rtc_library("criticalsection") {
Tommi8d2c5a82018-03-19 11:12:48 +0100169 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800170 "critical_section.cc",
171 "critical_section.h",
Tommi8d2c5a82018-03-19 11:12:48 +0100172 ]
173 deps = [
174 ":atomicops",
175 ":checks",
176 ":macromagic",
177 ":platform_thread_types",
Mirko Bonadeic66e0042019-10-18 09:52:22 +0200178 "system:rtc_export",
Niels Möllera12c42a2018-07-25 16:05:48 +0200179 "system:unused",
Tommi8d2c5a82018-03-19 11:12:48 +0100180 ]
181}
182
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200183rtc_library("platform_thread") {
Tommi8d2c5a82018-03-19 11:12:48 +0100184 visibility = [
185 ":rtc_base_approved",
Tommi8d2c5a82018-03-19 11:12:48 +0100186 ":rtc_task_queue_libevent",
187 ":rtc_task_queue_win",
Robin Raymond22027b92018-11-23 09:07:50 -0500188 ":rtc_task_queue_stdlib",
Sebastian Janssonb55015e2019-04-09 13:44:04 +0200189 "synchronization:sequence_checker",
Tommi8d2c5a82018-03-19 11:12:48 +0100190 ]
191 sources = [
192 "platform_thread.cc",
193 "platform_thread.h",
194 ]
195 deps = [
196 ":atomicops",
197 ":checks",
198 ":macromagic",
199 ":platform_thread_types",
200 ":rtc_event",
201 ":thread_checker",
202 ":timeutils",
Danil Chapovalov5a1a6db2019-01-17 19:55:46 +0100203 "//third_party/abseil-cpp/absl/strings",
Tommi8d2c5a82018-03-19 11:12:48 +0100204 ]
205}
206
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200207rtc_library("rtc_event") {
Tommi8d2c5a82018-03-19 11:12:48 +0100208 if (build_with_chromium) {
209 sources = [
210 "../../webrtc_overrides/rtc_base/event.cc",
211 "../../webrtc_overrides/rtc_base/event.h",
212 ]
Karl Wiberg98417032019-03-24 19:12:40 +0100213 deps = [
214 ":checks",
Mirko Bonadeid4002a72019-11-12 20:11:48 +0100215 "system:rtc_export", # Only Chromium's rtc::Event use RTC_EXPORT.
Karl Wiberg98417032019-03-24 19:12:40 +0100216 "//base", # Dependency on chromium's waitable_event.
217 ]
Tommi8d2c5a82018-03-19 11:12:48 +0100218 } else {
219 sources = [
220 "event.cc",
221 "event.h",
222 ]
Karl Wiberg98417032019-03-24 19:12:40 +0100223 deps = [
224 ":checks",
225 "synchronization:yield_policy",
226 "system:warn_current_thread_is_deadlocked",
Karl Wibergfc47c862019-04-11 10:31:24 +0200227 "//third_party/abseil-cpp/absl/types:optional",
Karl Wiberg98417032019-03-24 19:12:40 +0100228 ]
Tommi8d2c5a82018-03-19 11:12:48 +0100229 }
Tommi8d2c5a82018-03-19 11:12:48 +0100230}
231
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200232rtc_library("logging") {
Mirko Bonadei2ad8c432018-08-09 10:54:40 +0200233 visibility = [ "*" ]
Patrik Höglund77301932018-10-09 15:09:51 +0200234 libs = []
Tommi8d2c5a82018-03-19 11:12:48 +0100235 deps = [
Yves Gerey988cc082018-10-23 12:03:01 +0200236 ":checks",
Tommi8d2c5a82018-03-19 11:12:48 +0100237 ":criticalsection",
238 ":macromagic",
239 ":platform_thread_types",
240 ":stringutils",
241 ":timeutils",
Danil Chapovalovef98ae62019-10-11 17:18:29 +0200242 "//third_party/abseil-cpp/absl/base:core_headers",
Sebastian Janssonf4e085a2019-05-20 18:34:07 +0200243 "//third_party/abseil-cpp/absl/meta:type_traits",
Jonas Olssonf2ce37c2018-09-12 15:32:47 +0200244 "//third_party/abseil-cpp/absl/strings",
Tommi8d2c5a82018-03-19 11:12:48 +0100245 ]
246
247 if (build_with_chromium) {
248 # Dependency on chromium's logging (in //base).
Artem Titov94b57c02019-03-21 13:35:10 +0100249 deps += [ "//base" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100250 sources = [
251 "../../webrtc_overrides/rtc_base/logging.cc",
252 "../../webrtc_overrides/rtc_base/logging.h",
253 ]
254 } else {
Mirko Bonadei96ede162018-09-06 13:45:44 +0200255 configs += [
256 "..:no_exit_time_destructors",
257 "..:no_global_constructors",
258 ]
Tommi8d2c5a82018-03-19 11:12:48 +0100259 sources = [
260 "logging.cc",
261 "logging.h",
262 ]
Karl Wibergcefc4652018-05-23 23:20:38 +0200263 deps += [ "system:inline" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100264
Mirko Bonadei99a70a22018-10-09 16:45:14 +0200265 if (is_mac) {
Niels Möller171bd262019-05-28 15:16:47 +0200266 libs += [ "Foundation.framework" ]
Mirko Bonadei99a70a22018-10-09 16:45:14 +0200267 }
268
Tommi8d2c5a82018-03-19 11:12:48 +0100269 # logging.h needs the deprecation header while downstream projects are
270 # removing code that depends on logging implementation details.
271 deps += [ ":deprecation" ]
Patrik Höglund77301932018-10-09 15:09:51 +0200272
273 if (is_android) {
274 libs += [ "log" ]
275 }
Tommi8d2c5a82018-03-19 11:12:48 +0100276 }
277}
278
279rtc_source_set("thread_checker") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100280 sources = [ "thread_checker.h" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100281 deps = [
Sebastian Janssonc01367d2019-04-08 15:20:44 +0200282 ":deprecation",
Sebastian Janssondf5e4e02019-03-29 10:34:45 +0100283 "synchronization:sequence_checker",
Tommi8d2c5a82018-03-19 11:12:48 +0100284 ]
285}
286
287rtc_source_set("atomicops") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100288 sources = [ "atomic_ops.h" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100289}
290
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200291rtc_library("checks") {
Mirko Bonadei2ad8c432018-08-09 10:54:40 +0200292 # TODO(bugs.webrtc.org/9607): This should not be public.
293 visibility = [ "*" ]
Patrik Höglund77301932018-10-09 15:09:51 +0200294 libs = []
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100295 sources = [
296 "checks.cc",
297 "checks.h",
298 ]
299 deps = [
300 ":safe_compare",
Jonas Olssonf8e5c112018-06-14 13:14:22 +0200301 "system:inline",
Mirko Bonadei35214fc2019-09-23 14:54:28 +0200302 "system:rtc_export",
Sebastian Janssonf4e085a2019-05-20 18:34:07 +0200303 "//third_party/abseil-cpp/absl/meta:type_traits",
Mirko Bonadeid4a37a62019-03-11 10:31:22 +0100304 "//third_party/abseil-cpp/absl/strings",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100305 ]
Patrik Höglund77301932018-10-09 15:09:51 +0200306 if (is_android) {
307 libs += [ "log" ]
308 }
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100309}
310
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200311rtc_library("rate_limiter") {
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100312 sources = [
Patrik Höglund3e113432017-12-15 14:40:10 +0100313 "rate_limiter.cc",
314 "rate_limiter.h",
315 ]
316 deps = [
317 ":rtc_base_approved",
318 "../system_wrappers",
Yves Gerey988cc082018-10-23 12:03:01 +0200319 "//third_party/abseil-cpp/absl/types:optional",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100320 ]
321}
322
323rtc_source_set("sanitizer") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100324 sources = [ "sanitizer.h" ]
325 deps = [ "//third_party/abseil-cpp/absl/meta:type_traits" ]
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100326}
327
Danil Chapovalov33b83fd2019-09-18 15:48:23 +0200328rtc_source_set("divide_round") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100329 sources = [ "numerics/divide_round.h" ]
Danil Chapovalov33b83fd2019-09-18 15:48:23 +0200330 deps = [
331 ":checks",
332 ":safe_compare",
333 ]
334}
335
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100336rtc_source_set("safe_compare") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100337 sources = [ "numerics/safe_compare.h" ]
338 deps = [ ":type_traits" ]
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100339}
340
Karl Wiberg12edf4c2018-03-07 14:18:56 +0100341rtc_source_set("safe_minmax") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100342 sources = [ "numerics/safe_minmax.h" ]
Karl Wiberg12edf4c2018-03-07 14:18:56 +0100343 deps = [
344 ":checks",
345 ":safe_compare",
346 ":type_traits",
347 ]
348}
349
Tommi8d2c5a82018-03-19 11:12:48 +0100350rtc_source_set("safe_conversions") {
351 sources = [
352 "numerics/safe_conversions.h",
353 "numerics/safe_conversions_impl.h",
354 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100355 deps = [ ":checks" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100356}
357
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200358rtc_library("timeutils") {
Mirko Bonadei2ad8c432018-08-09 10:54:40 +0200359 visibility = [ "*" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100360 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800361 "time_utils.cc",
362 "time_utils.h",
Tommi8d2c5a82018-03-19 11:12:48 +0100363 ]
364 deps = [
365 ":checks",
366 ":safe_conversions",
Jonas Olsson366a50c2018-09-06 13:41:30 +0200367 ":stringutils",
Mirko Bonadei35214fc2019-09-23 14:54:28 +0200368 "system:rtc_export",
Tommi8d2c5a82018-03-19 11:12:48 +0100369 ]
Noah Richards342989d2019-03-18 13:50:20 -0700370 libs = []
371 if (is_win) {
372 libs += [ "winmm.lib" ]
373 }
Tommi8d2c5a82018-03-19 11:12:48 +0100374}
375
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200376rtc_library("stringutils") {
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100377 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800378 "string_encode.cc",
379 "string_encode.h",
Jonas Olsson6b1985d2018-07-05 11:59:48 +0200380 "string_to_number.cc",
381 "string_to_number.h",
Steve Anton10542f22019-01-11 09:11:00 -0800382 "string_utils.cc",
383 "string_utils.h",
Karl Wiberg881f1682018-03-08 15:03:23 +0100384 "strings/string_builder.cc",
Tommifef05002018-02-27 13:51:08 +0100385 "strings/string_builder.h",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100386 ]
387 deps = [
Patrik Höglund3e113432017-12-15 14:40:10 +0100388 ":checks",
Jonas Olsson6b1985d2018-07-05 11:59:48 +0200389 ":macromagic",
Karl Wiberg881f1682018-03-08 15:03:23 +0100390 ":safe_minmax",
391 "../api:array_view",
Artem Titov94b57c02019-03-21 13:35:10 +0100392 "//third_party/abseil-cpp/absl/strings",
Jonas Olsson6b1985d2018-07-05 11:59:48 +0200393 "//third_party/abseil-cpp/absl/types:optional",
Patrik Höglund3e113432017-12-15 14:40:10 +0100394 ]
395}
396
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200397rtc_library("audio_format_to_string") {
Jonas Olsson74395342018-04-03 12:22:07 +0200398 sources = [
399 "strings/audio_format_to_string.cc",
400 "strings/audio_format_to_string.h",
401 ]
402 deps = [
403 ":stringutils",
404 "../api/audio_codecs:audio_codecs_api",
405 ]
406}
407
Patrik Höglund3e113432017-12-15 14:40:10 +0100408rtc_source_set("type_traits") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100409 sources = [ "type_traits.h" ]
Patrik Höglund3e113432017-12-15 14:40:10 +0100410}
411
412rtc_source_set("deprecation") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100413 sources = [ "deprecation.h" ]
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100414}
415
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200416rtc_library("rtc_task_queue") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000417 visibility = [ "*" ]
nisse75dd6d42017-09-19 08:28:00 -0700418 sources = [
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +0100419 "task_queue.cc",
nisse75dd6d42017-09-19 08:28:00 -0700420 "task_queue.h",
421 ]
perkj650fdae2017-08-25 05:00:11 -0700422 deps = [
Tommi8d2c5a82018-03-19 11:12:48 +0100423 ":macromagic",
Danil Chapovalov959e9b62019-01-14 14:29:18 +0100424 "../api/task_queue",
Mirko Bonadei3d255302018-10-11 10:50:45 +0200425 "system:rtc_export",
Danil Chapovalov3b548dd2019-03-01 14:58:44 +0100426 "task_utils:to_queued_task",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200427 "//third_party/abseil-cpp/absl/memory",
perkj650fdae2017-08-25 05:00:11 -0700428 ]
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +0100429}
430
Henrik Boström27c29362019-10-21 15:21:55 +0200431rtc_source_set("rtc_operations_chain") {
432 visibility = [ "*" ]
433 sources = [
434 "operations_chain.cc",
435 "operations_chain.h",
436 ]
437 deps = [
438 ":checks",
439 ":macromagic",
440 ":refcount",
441 "../api:scoped_refptr",
442 "synchronization:sequence_checker",
443 ]
444}
445
Tommi8d2c5a82018-03-19 11:12:48 +0100446if (rtc_enable_libevent) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200447 rtc_library("rtc_task_queue_libevent") {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +0100448 visibility = [ "../api/task_queue:default_task_queue_factory" ]
perkj650fdae2017-08-25 05:00:11 -0700449 sources = [
Niels Möller15c9cf72017-10-19 12:38:09 +0200450 "task_queue_libevent.cc",
Danil Chapovaloveb175242019-02-12 10:44:38 +0100451 "task_queue_libevent.h",
perkj650fdae2017-08-25 05:00:11 -0700452 ]
Tommi8d2c5a82018-03-19 11:12:48 +0100453 deps = [
454 ":checks",
455 ":criticalsection",
456 ":logging",
Yves Gerey2e00abc2018-10-05 15:39:24 +0200457 ":macromagic",
Tommi8d2c5a82018-03-19 11:12:48 +0100458 ":platform_thread",
Yves Gerey2e00abc2018-10-05 15:39:24 +0200459 ":platform_thread_types",
Tommi8d2c5a82018-03-19 11:12:48 +0100460 ":safe_conversions",
461 ":timeutils",
Danil Chapovaloveb175242019-02-12 10:44:38 +0100462 "../api/task_queue",
Steve Anton9a83dd72020-01-09 11:03:25 -0800463 "//third_party/abseil-cpp/absl/container:inlined_vector",
Danil Chapovaloveb175242019-02-12 10:44:38 +0100464 "//third_party/abseil-cpp/absl/strings",
Tommi8d2c5a82018-03-19 11:12:48 +0100465 ]
466 if (rtc_build_libevent) {
467 deps += [ "//base/third_party/libevent" ]
468 }
469 }
470}
471
472if (is_mac || is_ios) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200473 rtc_library("rtc_task_queue_gcd") {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +0100474 visibility = [ "../api/task_queue:default_task_queue_factory" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100475 sources = [
476 "task_queue_gcd.cc",
Danil Chapovalov47cf5ea2019-02-19 20:20:16 +0100477 "task_queue_gcd.h",
Tommi8d2c5a82018-03-19 11:12:48 +0100478 ]
479 deps = [
480 ":checks",
481 ":logging",
Danil Chapovalov47cf5ea2019-02-19 20:20:16 +0100482 "../api/task_queue",
Danil Chapovalov47cf5ea2019-02-19 20:20:16 +0100483 "//third_party/abseil-cpp/absl/strings",
Tommi8d2c5a82018-03-19 11:12:48 +0100484 ]
485 }
486}
487
488if (is_win) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200489 rtc_library("rtc_task_queue_win") {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +0100490 visibility = [ "../api/task_queue:default_task_queue_factory" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100491 sources = [
492 "task_queue_win.cc",
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100493 "task_queue_win.h",
Tommi8d2c5a82018-03-19 11:12:48 +0100494 ]
495 deps = [
496 ":checks",
497 ":criticalsection",
498 ":logging",
499 ":macromagic",
500 ":platform_thread",
Tommi8d2c5a82018-03-19 11:12:48 +0100501 ":rtc_event",
Tommi8d2c5a82018-03-19 11:12:48 +0100502 ":safe_conversions",
503 ":timeutils",
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100504 "../api/task_queue",
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100505 "//third_party/abseil-cpp/absl/strings",
Tommi8d2c5a82018-03-19 11:12:48 +0100506 ]
507 }
508}
509
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200510rtc_library("rtc_task_queue_stdlib") {
Robin Raymond22027b92018-11-23 09:07:50 -0500511 sources = [
512 "task_queue_stdlib.cc",
Danil Chapovalovfa52efa2019-02-21 11:13:58 +0100513 "task_queue_stdlib.h",
Robin Raymond22027b92018-11-23 09:07:50 -0500514 ]
515 deps = [
516 ":checks",
517 ":criticalsection",
518 ":logging",
519 ":macromagic",
520 ":platform_thread",
Robin Raymond22027b92018-11-23 09:07:50 -0500521 ":rtc_event",
Robin Raymond22027b92018-11-23 09:07:50 -0500522 ":safe_conversions",
523 ":timeutils",
Danil Chapovalovfa52efa2019-02-21 11:13:58 +0100524 "../api/task_queue",
Danil Chapovalovfa52efa2019-02-21 11:13:58 +0100525 "//third_party/abseil-cpp/absl/strings",
Robin Raymond22027b92018-11-23 09:07:50 -0500526 ]
527}
528
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200529rtc_library("weak_ptr") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200530 sources = [
531 "weak_ptr.cc",
532 "weak_ptr.h",
533 ]
534 deps = [
Tommi8d2c5a82018-03-19 11:12:48 +0100535 ":refcount",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100536 "../api:scoped_refptr",
Sebastian Janssonb55015e2019-04-09 13:44:04 +0200537 "synchronization:sequence_checker",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200538 ]
539}
540
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200541rtc_library("rtc_numerics") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200542 sources = [
Jonas Oreland63dced92019-11-25 13:00:15 +0100543 "numerics/event_based_exponential_moving_average.cc",
544 "numerics/event_based_exponential_moving_average.h",
Sebastian Janssonefa3f762019-12-02 07:19:55 +0100545 "numerics/event_rate_counter.cc",
546 "numerics/event_rate_counter.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200547 "numerics/exp_filter.cc",
548 "numerics/exp_filter.h",
Yves Gerey890f62b2019-04-10 17:18:48 +0200549 "numerics/math_utils.h",
Ilya Nikolaevskiy26341992018-11-05 12:55:18 +0100550 "numerics/moving_average.cc",
551 "numerics/moving_average.h",
Ilya Nikolaevskiyb9685752017-11-01 14:01:00 +0100552 "numerics/moving_median_filter.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200553 "numerics/percentile_filter.h",
Yves Gerey890f62b2019-04-10 17:18:48 +0200554 "numerics/running_statistics.h",
Sebastian Janssonefa3f762019-12-02 07:19:55 +0100555 "numerics/sample_stats.cc",
556 "numerics/sample_stats.h",
Artem Titove4ed6ea2019-01-11 11:02:19 +0100557 "numerics/samples_stats_counter.cc",
558 "numerics/samples_stats_counter.h",
Bjorn Tereliusa194e582017-10-25 13:07:09 +0200559 "numerics/sequence_number_util.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200560 ]
561 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100562 ":checks",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200563 ":rtc_base_approved",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100564 ":safe_compare",
Artem Titov89eaf162019-04-25 12:23:40 +0200565 "../api:array_view",
Sebastian Janssonefa3f762019-12-02 07:19:55 +0100566 "../api/units:data_rate",
567 "../api/units:time_delta",
Artem Titov6fcdbc12019-09-11 11:45:40 +0200568 "../api/units:timestamp",
Steve Anton2acd1632019-03-25 13:48:30 -0700569 "//third_party/abseil-cpp/absl/algorithm:container",
Danil Chapovalov0a1d1892018-06-21 11:48:25 +0200570 "//third_party/abseil-cpp/absl/types:optional",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200571 ]
572}
573
Mirko Bonadei65643662019-07-12 13:29:30 +0200574config("rtc_json_suppressions") {
Mirko Bonadei94077762019-06-27 11:24:25 +0200575 if (!is_win || is_clang) {
Mirko Bonadei65643662019-07-12 13:29:30 +0200576 cflags_cc = [
577 # TODO(bugs.webrtc.org/10770): Update jsoncpp API usage and remove
578 # -Wno-deprecated-declarations.
579 "-Wno-deprecated-declarations",
580
Mirko Bonadei1cd6f322019-07-12 21:47:47 +0200581 # TODO(bugs.webrtc.org/10814): Remove -Wno-undef as soon as it get
Mirko Bonadei65643662019-07-12 13:29:30 +0200582 # removed upstream.
583 "-Wno-undef",
584 ]
Mirko Bonadei94077762019-06-27 11:24:25 +0200585 }
586}
587
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200588rtc_library("rtc_json") {
Mirko Bonadei65643662019-07-12 13:29:30 +0200589 public_configs = [ ":rtc_json_suppressions" ]
Sam Zackrisson492fdf42019-10-25 10:45:58 +0200590 poisonous = [ "rtc_json" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200591 defines = []
592 sources = [
Sam Zackrissonb45bdb52018-10-02 16:25:59 +0200593 "strings/json.cc",
594 "strings/json.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200595 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100596 deps = [ ":stringutils" ]
Mirko Bonadeia0e29fc2018-01-26 16:50:02 +0100597 all_dependent_configs = [ "//third_party/jsoncpp:jsoncpp_config" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200598 if (rtc_build_json) {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100599 public_deps = [ "//third_party/jsoncpp" ] # no-presubmit-check TODO(webrtc:8603)
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200600 } else {
601 include_dirs = [ "$rtc_jsoncpp_root" ]
602
603 # When defined changes the include path for json.h to where it is
604 # expected to be when building json outside of the standalone build.
605 defines += [ "WEBRTC_EXTERNAL_JSON" ]
606 }
607}
608
Karl Wiberg28522dc2019-01-22 17:54:34 +0100609rtc_source_set("net_helpers") {
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100610 # TODO(bugs.webrtc.org/9987): This build target will soon contain
611 # the following files:
612 # sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800613 # "net_helpers.cc",
614 # "net_helpers.h",
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100615 # ]
616}
617
Karl Wiberg28522dc2019-01-22 17:54:34 +0100618rtc_source_set("async_resolver_interface") {
Karl Wiberg02f4e322019-02-11 00:43:43 +0100619 visibility = [ "*" ]
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100620 # TODO(bugs.webrtc.org/9987): This build target will soon contain
621 # the following files:
622 # sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800623 # "async_resolver_interface.cc",
624 # "async_resolver_interface.h",
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100625 # ]
626}
627
Karl Wiberg28522dc2019-01-22 17:54:34 +0100628rtc_source_set("ip_address") {
Karl Wiberg02f4e322019-02-11 00:43:43 +0100629 visibility = [ "*" ]
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100630 # TODO(bugs.webrtc.org/9987): This build target will soon contain
631 # the following files:
632 # sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800633 # "ip_address.cc",
634 # "ip_address.h",
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100635 # ]
636}
637
Karl Wiberg28522dc2019-01-22 17:54:34 +0100638rtc_source_set("socket_address") {
Karl Wiberg02f4e322019-02-11 00:43:43 +0100639 visibility = [ "*" ]
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100640 # TODO(bugs.webrtc.org/9987): This build target will soon contain
641 # the following files:
642 # sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800643 # "socket_address.cc",
644 # "socket_address.h",
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100645 # ]
646}
647
Karl Wiberg28522dc2019-01-22 17:54:34 +0100648rtc_source_set("null_socket_server") {
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100649 # TODO(bugs.webrtc.org/9987): This build target will soon contain
650 # the following files:
651 # sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800652 # "null_socket_server.cc",
653 # "null_socket_server.h",
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100654 # ]
655}
656
Karl Wiberg28522dc2019-01-22 17:54:34 +0100657rtc_source_set("socket_server") {
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100658 # TODO(bugs.webrtc.org/9987): This build target will soon contain
659 # the following files:
660 # sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800661 # "socket_server.h",
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100662 # ]
663}
664
665rtc_source_set("threading") {
Karl Wiberg02f4e322019-02-11 00:43:43 +0100666 visibility = [ "*" ]
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100667 # TODO(bugs.webrtc.org/9987): This build target will soon contain
668 # the following files:
669 # sources = [
670 # "asyncresolver.cc",
671 # "asyncresolver.h",
672 # "defaultsocketserver.cc",
673 # "defaultsocketserver.h",
Steve Anton10542f22019-01-11 09:11:00 -0800674 # "message_handler.cc",
675 # "message_handler.h",
Steve Anton10542f22019-01-11 09:11:00 -0800676 # "network_monitor.cc",
677 # "network_monitor.h",
678 # "physical_socket_server.cc",
679 # "physical_socket_server.h",
680 # "signal_thread.cc",
681 # "signal_thread.h",
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100682 # "thread.cc",
683 # "thread.h",
684 # ]
685}
686
Karl Wiberg28522dc2019-01-22 17:54:34 +0100687rtc_source_set("socket_factory") {
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100688 # TODO(bugs.webrtc.org/9987): This build target will soon contain
689 # the following files:
690 # sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800691 # "socket_factory.h",
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100692 # ]
693}
694
Karl Wiberg28522dc2019-01-22 17:54:34 +0100695rtc_source_set("async_socket") {
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100696 # TODO(bugs.webrtc.org/9987): This build target will soon contain
697 # the following files:
698 # sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800699 # "async_socket.cc",
700 # "async_socket.h",
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100701 # ]
702}
703
704rtc_source_set("socket") {
705 # TODO(bugs.webrtc.org/9987): This build target will soon contain
706 # the following files:
707 # sources = [
708 # "socket.cc",
709 # "socket.h",
710 # ]
711}
712
713rtc_source_set("network_constants") {
714 # TODO(bugs.webrtc.org/9987): This build target will soon contain
715 # the following files:
716 # sources = [
717 # "network_constants.h",
718 # ]
719}
720
721if (is_android) {
722 rtc_source_set("ifaddrs_android") {
723 # TODO(bugs.webrtc.org/9987): This build target will soon contain
724 # the following files:
725 # sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800726 # "ifaddrs_android.cc",
727 # "ifaddrs_android.h",
Karl Wiberg0b6d0e62018-12-06 14:50:45 +0100728 # ]
729 }
730}
731
732if (is_win) {
733 rtc_source_set("win32") {
734 # TODO(bugs.webrtc.org/9987): This build target will soon contain
735 # the following files:
736 # sources = [
737 # "win32.cc",
738 # "win32.h",
739 # ]
740 }
741}
742
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200743rtc_library("rtc_base") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000744 visibility = [ "*" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200745 cflags = []
746 cflags_cc = []
747 libs = []
748 defines = []
749 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100750 ":checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100751 ":stringutils",
Joachim Bauch58daf402017-12-21 22:00:34 +0100752 "../api:array_view",
Danil Chapovalov89313452019-11-29 12:56:43 +0100753 "../api:function_view",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100754 "../api:scoped_refptr",
Danil Chapovalov912b3b82019-11-22 15:52:40 +0100755 "../api/task_queue",
Sebastian Janssone07864e2018-10-15 09:28:15 +0200756 "network:sent_packet",
Niels Möller23213d92019-01-22 11:01:24 +0100757 "system:file_wrapper",
Mirko Bonadei35214fc2019-09-23 14:54:28 +0200758 "system:rtc_export",
Artem Titova76af0c2018-07-23 17:38:12 +0200759 "third_party/base64",
Artem Titove41c4332018-07-25 15:04:28 +0200760 "third_party/sigslot",
Steve Anton2acd1632019-03-25 13:48:30 -0700761 "//third_party/abseil-cpp/absl/algorithm:container",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200762 "//third_party/abseil-cpp/absl/memory",
Niels Möller3c7d5992018-10-19 15:29:54 +0200763 "//third_party/abseil-cpp/absl/strings",
Danil Chapovalov0a1d1892018-06-21 11:48:25 +0200764 "//third_party/abseil-cpp/absl/types:optional",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200765 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100766 public_deps = [ ":rtc_base_approved" ] # no-presubmit-check TODO(webrtc:8603)
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200767 public_configs = []
768
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200769 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800770 "async_invoker.cc",
771 "async_invoker.h",
772 "async_invoker_inl.h",
773 "async_packet_socket.cc",
774 "async_packet_socket.h",
775 "async_resolver_interface.cc",
776 "async_resolver_interface.h",
777 "async_socket.cc",
778 "async_socket.h",
779 "async_tcp_socket.cc",
780 "async_tcp_socket.h",
781 "async_udp_socket.cc",
782 "async_udp_socket.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200783 "crc32.cc",
784 "crc32.h",
Steve Anton10542f22019-01-11 09:11:00 -0800785 "crypt_string.cc",
786 "crypt_string.h",
Sebastian Janssonf9c5cf62018-02-28 16:04:26 +0100787 "data_rate_limiter.cc",
788 "data_rate_limiter.h",
Patrik Höglund76df0df2017-12-19 11:50:21 +0100789 "dscp.h",
Steve Anton10542f22019-01-11 09:11:00 -0800790 "file_rotating_stream.cc",
791 "file_rotating_stream.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200792 "helpers.cc",
793 "helpers.h",
Steve Anton10542f22019-01-11 09:11:00 -0800794 "http_common.cc",
795 "http_common.h",
796 "ip_address.cc",
797 "ip_address.h",
Patrik Höglund76df0df2017-12-19 11:50:21 +0100798 "keep_ref_until_done.h",
Qingsi Wang09619332018-09-12 22:51:55 -0700799 "mdns_responder_interface.h",
Steve Anton10542f22019-01-11 09:11:00 -0800800 "message_digest.cc",
801 "message_digest.h",
802 "message_handler.cc",
803 "message_handler.h",
Steve Anton10542f22019-01-11 09:11:00 -0800804 "net_helper.cc",
805 "net_helper.h",
806 "net_helpers.cc",
807 "net_helpers.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200808 "network.cc",
809 "network.h",
Patrik Höglunde2d6a062017-10-05 14:53:33 +0200810 "network_constants.h",
Steve Anton10542f22019-01-11 09:11:00 -0800811 "network_monitor.cc",
812 "network_monitor.h",
813 "network_route.h",
814 "null_socket_server.cc",
815 "null_socket_server.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200816 "openssl.h",
Steve Anton10542f22019-01-11 09:11:00 -0800817 "openssl_adapter.cc",
818 "openssl_adapter.h",
819 "openssl_certificate.cc",
820 "openssl_certificate.h",
821 "openssl_digest.cc",
822 "openssl_digest.h",
823 "openssl_identity.cc",
824 "openssl_identity.h",
Steve Anton10542f22019-01-11 09:11:00 -0800825 "openssl_session_cache.cc",
826 "openssl_session_cache.h",
827 "openssl_stream_adapter.cc",
828 "openssl_stream_adapter.h",
829 "openssl_utility.cc",
830 "openssl_utility.h",
831 "physical_socket_server.cc",
832 "physical_socket_server.h",
833 "proxy_info.cc",
834 "proxy_info.h",
835 "rtc_certificate.cc",
836 "rtc_certificate.h",
837 "rtc_certificate_generator.cc",
838 "rtc_certificate_generator.h",
839 "signal_thread.cc",
840 "signal_thread.h",
841 "sigslot_repeater.h",
Qingsi Wang6e641e62018-04-11 20:14:17 -0700842 "socket.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200843 "socket.h",
Steve Anton10542f22019-01-11 09:11:00 -0800844 "socket_adapters.cc",
845 "socket_adapters.h",
846 "socket_address.cc",
847 "socket_address.h",
848 "socket_address_pair.cc",
849 "socket_address_pair.h",
850 "socket_factory.h",
851 "socket_server.h",
852 "ssl_adapter.cc",
853 "ssl_adapter.h",
854 "ssl_certificate.cc",
855 "ssl_certificate.h",
856 "ssl_fingerprint.cc",
857 "ssl_fingerprint.h",
858 "ssl_identity.cc",
859 "ssl_identity.h",
860 "ssl_stream_adapter.cc",
861 "ssl_stream_adapter.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200862 "stream.cc",
863 "stream.h",
864 "thread.cc",
865 "thread.h",
Sebastian Jansson6ea2c6a2020-01-13 14:07:22 +0100866 "thread_message.h",
Amit Hilbuchdbb49df2019-01-23 14:54:24 -0800867 "unique_id_generator.cc",
868 "unique_id_generator.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200869 ]
870
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200871 if (build_with_chromium) {
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200872 include_dirs = [ "../../boringssl/src/include" ]
Niels Moller9d1840c2019-05-21 07:26:37 +0000873 public_configs += [ ":rtc_base_chromium_config" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200874 } else {
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200875 sources += [
876 "callback.h",
Steve Anton10542f22019-01-11 09:11:00 -0800877 "log_sinks.cc",
878 "log_sinks.h",
879 "numerics/math_utils.h",
880 "rolling_accumulator.h",
881 "ssl_roots.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200882 ]
883
Yves Gerey3dfb6802019-05-13 17:01:32 +0200884 deps += [ ":rtc_numerics" ]
885
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200886 if (is_win) {
Steve Antonf3802842019-01-24 19:07:40 -0800887 sources += [ "win32_socket_init.h" ]
Robin Raymondce1b1402018-11-22 20:10:11 -0500888 if (current_os != "winuwp") {
889 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800890 "win32_socket_server.cc",
891 "win32_socket_server.h",
Robin Raymondce1b1402018-11-22 20:10:11 -0500892 ]
893 }
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200894 }
895 } # !build_with_chromium
896
897 if (rtc_build_ssl) {
898 deps += [ "//third_party/boringssl" ]
Dan Minor9cdd8762018-01-16 10:40:39 -0500899 } else {
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200900 configs += [ ":external_ssl_library" ]
901 }
902
903 if (is_android) {
904 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800905 "ifaddrs_android.cc",
906 "ifaddrs_android.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200907 ]
908
909 libs += [
910 "log",
911 "GLESv2",
912 ]
913 }
914
915 if (is_ios || is_mac) {
Steve Anton10542f22019-01-11 09:11:00 -0800916 sources += [ "mac_ifaddrs_converter.cc" ]
Kári Tristan Helgason62b13452018-10-12 12:57:49 +0200917 deps += [ "system:cocoa_threading" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200918 }
919
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200920 if (is_linux) {
921 libs += [
922 "dl",
923 "rt",
924 ]
925 }
926
Oleh Prypinb3f78de2019-07-18 22:25:48 +0200927 if (is_ios) {
928 libs += [
929 "CFNetwork.framework",
930 "Foundation.framework",
931 "Security.framework",
932 "SystemConfiguration.framework",
933 "UIKit.framework",
934 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200935 }
936
937 if (is_win) {
938 sources += [
939 "win32.cc",
940 "win32.h",
Steve Anton10542f22019-01-11 09:11:00 -0800941 "win32_window.cc",
942 "win32_window.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200943 ]
944
945 libs += [
946 "crypt32.lib",
947 "iphlpapi.lib",
948 "secur32.lib",
949 ]
950
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200951 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
952 }
953
Fabrice de Gans-Riberi09a6cd52018-03-30 10:38:06 -0700954 if (is_posix || is_fuchsia) {
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200955 sources += [
956 "ifaddrs_converter.cc",
957 "ifaddrs_converter.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200958 ]
959 }
960
961 if (is_nacl) {
Mirko Bonadeia7d8f192019-03-29 13:34:46 +0100962 public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ] # no-presubmit-check TODO(webrtc:8603)
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200963 defines += [ "timezone=_timezone" ]
964 sources -= [ "ifaddrs_converter.cc" ]
965 }
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200966}
967
968rtc_source_set("gtest_prod") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100969 sources = [ "gtest_prod_util.h" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200970}
971
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200972rtc_library("gunit_helpers") {
Mirko Bonadeie3abb812018-11-23 13:15:08 +0100973 testonly = true
974 sources = [
975 "gunit.cc",
976 "gunit.h",
977 ]
978 deps = [
979 ":logging",
980 ":rtc_base",
981 ":rtc_base_tests_utils",
982 ":stringutils",
983 "../test:test_support",
Steve Anton68586e82018-12-13 17:41:25 -0800984 "//third_party/abseil-cpp/absl/strings",
Mirko Bonadeie3abb812018-11-23 13:15:08 +0100985 ]
986}
987
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200988rtc_library("testclient") {
Mirko Bonadeie3abb812018-11-23 13:15:08 +0100989 testonly = true
990 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800991 "test_client.cc",
992 "test_client.h",
Mirko Bonadeie3abb812018-11-23 13:15:08 +0100993 ]
994 deps = [
995 ":criticalsection",
996 ":gunit_helpers",
997 ":macromagic",
998 ":rtc_base",
999 ":rtc_base_tests_utils",
1000 ":timeutils",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001001 ]
1002}
1003
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001004rtc_library("rtc_base_tests_utils") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001005 testonly = true
1006 sources = [
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001007 "cpu_time.cc",
1008 "cpu_time.h",
Steve Anton10542f22019-01-11 09:11:00 -08001009 "fake_clock.cc",
1010 "fake_clock.h",
Qingsi Wang09619332018-09-12 22:51:55 -07001011 "fake_mdns_responder.h",
Steve Anton10542f22019-01-11 09:11:00 -08001012 "fake_network.h",
1013 "fake_ssl_identity.cc",
1014 "fake_ssl_identity.h",
1015 "firewall_socket_server.cc",
1016 "firewall_socket_server.h",
Niels Möllere7547d52018-11-01 09:33:08 +01001017 "memory_stream.cc",
1018 "memory_stream.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001019 "memory_usage.cc",
1020 "memory_usage.h",
Steve Anton10542f22019-01-11 09:11:00 -08001021 "nat_server.cc",
1022 "nat_server.h",
1023 "nat_socket_factory.cc",
1024 "nat_socket_factory.h",
1025 "nat_types.cc",
1026 "nat_types.h",
1027 "proxy_server.cc",
1028 "proxy_server.h",
Niels Möller44153152018-12-17 14:04:05 +01001029 "server_socket_adapters.cc",
1030 "server_socket_adapters.h",
Steve Anton10542f22019-01-11 09:11:00 -08001031 "sigslot_tester.h",
Steve Anton10542f22019-01-11 09:11:00 -08001032 "socket_stream.cc",
1033 "socket_stream.h",
1034 "test_base64.h",
1035 "test_certificate_verifier.h",
1036 "test_echo_server.cc",
1037 "test_echo_server.h",
1038 "test_utils.cc",
1039 "test_utils.h",
1040 "virtual_socket_server.cc",
1041 "virtual_socket_server.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001042 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001043 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001044 ":checks",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001045 ":rtc_base",
Sebastian Jansson5f83cf02018-05-08 14:52:22 +02001046 "../api/units:time_delta",
Sebastian Janssond624c392019-04-17 10:36:03 +02001047 "../api/units:timestamp",
Niels Möller13339482019-03-28 13:30:15 +01001048 "memory:fifo_buffer",
Artem Titove41c4332018-07-25 15:04:28 +02001049 "third_party/sigslot",
Steve Anton2acd1632019-03-25 13:48:30 -07001050 "//third_party/abseil-cpp/absl/algorithm:container",
Karl Wiberg918f50c2018-07-05 11:40:33 +02001051 "//third_party/abseil-cpp/absl/memory",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001052 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001053}
1054
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001055rtc_library("task_queue_for_test") {
Tommida8781f2018-02-19 12:41:43 +01001056 testonly = true
1057
1058 sources = [
1059 "task_queue_for_test.cc",
1060 "task_queue_for_test.h",
1061 ]
1062 deps = [
1063 ":checks",
Danil Chapovalovd26a9162019-03-19 18:08:37 +01001064 ":macromagic",
Danil Chapovaloveb90e6f2019-10-15 10:04:57 +02001065 ":rtc_base_approved",
Danil Chapovalovd26a9162019-03-19 18:08:37 +01001066 ":rtc_event",
Tommida8781f2018-02-19 12:41:43 +01001067 ":rtc_task_queue",
Danil Chapovaloveb90e6f2019-10-15 10:04:57 +02001068 "../api/task_queue",
Danil Chapovalovd26a9162019-03-19 18:08:37 +01001069 "../api/task_queue:default_task_queue_factory",
Danil Chapovalov1aa75812019-03-05 11:11:35 +01001070 "task_utils:to_queued_task",
Danil Chapovalovd26a9162019-03-19 18:08:37 +01001071 "//third_party/abseil-cpp/absl/strings",
Tommida8781f2018-02-19 12:41:43 +01001072 ]
1073}
1074
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001075if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001076 rtc_library("sigslot_unittest") {
Artem Titove41c4332018-07-25 15:04:28 +02001077 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +01001078 sources = [ "sigslot_unittest.cc" ]
Artem Titove41c4332018-07-25 15:04:28 +02001079 deps = [
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001080 ":gunit_helpers",
Artem Titove41c4332018-07-25 15:04:28 +02001081 ":rtc_base",
1082 ":rtc_base_tests_utils",
Yves Gerey3e707812018-11-28 16:47:49 +01001083 "../test:test_support",
Artem Titove41c4332018-07-25 15:04:28 +02001084 "third_party/sigslot",
1085 ]
1086 }
1087
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001088 rtc_library("rtc_base_nonparallel_tests") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001089 testonly = true
1090
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001091 sources = [
1092 "cpu_time_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001093 "file_rotating_stream_unittest.cc",
1094 "null_socket_server_unittest.cc",
1095 "physical_socket_server_unittest.cc",
1096 "socket_address_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001097 "socket_unittest.cc",
1098 "socket_unittest.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001099 ]
1100 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001101 ":checks",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001102 ":gunit_helpers",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001103 ":rtc_base",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001104 ":rtc_base_tests_utils",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001105 ":testclient",
Artem Titov94b57c02019-03-21 13:35:10 +01001106 "../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +01001107 "../test:fileutils",
Niels Möller04a3cc12019-05-21 13:01:58 +02001108 "../test:test_main",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001109 "../test:test_support",
Artem Titov94b57c02019-03-21 13:35:10 +01001110 "third_party/sigslot",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001111 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +02001112 "//third_party/abseil-cpp/absl/memory",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001113 ]
1114 if (is_win) {
Steve Anton10542f22019-01-11 09:11:00 -08001115 sources += [ "win32_socket_server_unittest.cc" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001116 }
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001117 }
1118
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001119 rtc_library("rtc_base_approved_unittests") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001120 testonly = true
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001121 sources = [
Steve Anton10542f22019-01-11 09:11:00 -08001122 "atomic_ops_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001123 "base64_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001124 "bind_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001125 "bit_buffer_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001126 "buffer_queue_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001127 "buffer_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001128 "byte_buffer_unittest.cc",
1129 "byte_order_unittest.cc",
Artem Titov9dc209a2019-11-28 17:09:30 +01001130 "checks_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001131 "copy_on_write_buffer_unittest.cc",
1132 "critical_section_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001133 "event_tracer_unittest.cc",
1134 "event_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001135 "logging_unittest.cc",
Danil Chapovalov33b83fd2019-09-18 15:48:23 +02001136 "numerics/divide_round_unittest.cc",
Karl Wiberg65c39222017-11-22 12:25:14 +01001137 "numerics/histogram_percentile_counter_unittest.cc",
1138 "numerics/mod_ops_unittest.cc",
1139 "numerics/moving_max_counter_unittest.cc",
Karl Wiberge40468b2017-11-22 10:42:26 +01001140 "numerics/safe_compare_unittest.cc",
1141 "numerics/safe_minmax_unittest.cc",
Ilya Nikolaevskiy0beed5d2018-05-22 10:54:30 +02001142 "numerics/sample_counter_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001143 "one_time_event_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001144 "platform_thread_unittest.cc",
1145 "random_unittest.cc",
1146 "rate_limiter_unittest.cc",
1147 "rate_statistics_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001148 "rate_tracker_unittest.cc",
1149 "ref_counted_object_unittest.cc",
Alessio Bazzicad31843e2018-04-06 16:18:21 +02001150 "sanitizer_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001151 "string_encode_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001152 "string_to_number_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001153 "string_utils_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001154 "stringize_macros_unittest.cc",
Tommifef05002018-02-27 13:51:08 +01001155 "strings/string_builder_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001156 "swap_queue_unittest.cc",
1157 "thread_annotations_unittest.cc",
1158 "thread_checker_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001159 "time_utils_unittest.cc",
1160 "timestamp_aligner_unittest.cc",
1161 "virtual_socket_unittest.cc",
Joachim Bauch5b32f232018-03-07 20:02:26 +01001162 "zero_memory_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001163 ]
henrika3ca48a62018-05-21 13:34:51 +02001164 if (is_win) {
1165 sources += [ "win/windows_version_unittest.cc" ]
1166 }
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001167 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001168 ":checks",
Danil Chapovalov33b83fd2019-09-18 15:48:23 +02001169 ":divide_round",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001170 ":gunit_helpers",
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001171 ":rate_limiter",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001172 ":rtc_base",
1173 ":rtc_base_approved",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001174 ":rtc_base_tests_utils",
1175 ":rtc_task_queue",
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001176 ":safe_compare",
Karl Wiberg12edf4c2018-03-07 14:18:56 +01001177 ":safe_minmax",
Alessio Bazzicad31843e2018-04-06 16:18:21 +02001178 ":sanitizer",
Patrik Höglund3e113432017-12-15 14:40:10 +01001179 ":stringutils",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001180 ":testclient",
kwiberg529662a2017-09-04 05:43:17 -07001181 "../api:array_view",
Mirko Bonadeid9708072019-01-25 20:26:48 +01001182 "../api:scoped_refptr",
Yves Gerey3e707812018-11-28 16:47:49 +01001183 "../api/units:time_delta",
Artem Titov94b57c02019-03-21 13:35:10 +01001184 "../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +01001185 "../test:fileutils",
Niels Möller04a3cc12019-05-21 13:01:58 +02001186 "../test:test_main",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001187 "../test:test_support",
Karl Wiberg29e7bee2018-03-22 14:11:52 +01001188 "memory:unittests",
Danil Chapovalovb877e712019-11-29 15:19:27 +01001189 "task_utils:to_queued_task",
Artem Titova76af0c2018-07-23 17:38:12 +02001190 "third_party/base64",
Artem Titov94b57c02019-03-21 13:35:10 +01001191 "third_party/sigslot",
Danil Chapovalov5740f3e2019-10-10 11:12:15 +02001192 "//third_party/abseil-cpp/absl/base:core_headers",
Karl Wiberg918f50c2018-07-05 11:40:33 +02001193 "//third_party/abseil-cpp/absl/memory",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001194 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001195 }
1196
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001197 rtc_library("rtc_task_queue_unittests") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001198 testonly = true
1199
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +01001200 sources = [ "task_queue_unittest.cc" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001201 deps = [
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001202 ":gunit_helpers",
mbonadei95c8f652017-08-27 23:40:10 -07001203 ":rtc_base_approved",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001204 ":rtc_base_tests_utils",
1205 ":rtc_task_queue",
Danil Chapovalov07122bc2019-03-26 14:37:01 +01001206 ":task_queue_for_test",
Niels Möller04a3cc12019-05-21 13:01:58 +02001207 "../test:test_main",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001208 "../test:test_support",
Yves Gerey3e707812018-11-28 16:47:49 +01001209 "//third_party/abseil-cpp/absl/memory",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001210 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001211 }
1212
Henrik Boström27c29362019-10-21 15:21:55 +02001213 rtc_library("rtc_operations_chain_unittests") {
1214 testonly = true
1215
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +01001216 sources = [ "operations_chain_unittest.cc" ]
Henrik Boström27c29362019-10-21 15:21:55 +02001217 deps = [
1218 ":rtc_base",
1219 ":rtc_base_approved",
1220 ":rtc_event",
1221 ":rtc_operations_chain",
1222 "../test:test_support",
1223 ]
1224 }
1225
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001226 rtc_library("weak_ptr_unittests") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001227 testonly = true
1228
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +01001229 sources = [ "weak_ptr_unittest.cc" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001230 deps = [
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001231 ":gunit_helpers",
Mirko Bonadeica270912018-10-10 15:51:03 +02001232 ":rtc_base_approved",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001233 ":rtc_base_tests_utils",
Tommi8d2c5a82018-03-19 11:12:48 +01001234 ":rtc_event",
Danil Chapovalov07122bc2019-03-26 14:37:01 +01001235 ":task_queue_for_test",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001236 ":weak_ptr",
Niels Möller04a3cc12019-05-21 13:01:58 +02001237 "../test:test_main",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001238 "../test:test_support",
1239 ]
1240 }
1241
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001242 rtc_library("rtc_numerics_unittests") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001243 testonly = true
1244
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001245 sources = [
Jonas Oreland63dced92019-11-25 13:00:15 +01001246 "numerics/event_based_exponential_moving_average_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001247 "numerics/exp_filter_unittest.cc",
Ilya Nikolaevskiy26341992018-11-05 12:55:18 +01001248 "numerics/moving_average_unittest.cc",
Ilya Nikolaevskiyb9685752017-11-01 14:01:00 +01001249 "numerics/moving_median_filter_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001250 "numerics/percentile_filter_unittest.cc",
Yves Gerey890f62b2019-04-10 17:18:48 +02001251 "numerics/running_statistics_unittest.cc",
Artem Titove4ed6ea2019-01-11 11:02:19 +01001252 "numerics/samples_stats_counter_unittest.cc",
Bjorn Tereliusa194e582017-10-25 13:07:09 +02001253 "numerics/sequence_number_util_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001254 ]
1255 deps = [
1256 ":rtc_base_approved",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001257 ":rtc_numerics",
Niels Möller04a3cc12019-05-21 13:01:58 +02001258 "../test:test_main",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001259 "../test:test_support",
Steve Anton2acd1632019-03-25 13:48:30 -07001260 "//third_party/abseil-cpp/absl/algorithm:container",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001261 ]
1262 }
1263
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001264 rtc_library("rtc_json_unittests") {
Sam Zackrissonb45bdb52018-10-02 16:25:59 +02001265 testonly = true
1266
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +01001267 sources = [ "strings/json_unittest.cc" ]
Sam Zackrissonb45bdb52018-10-02 16:25:59 +02001268 deps = [
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001269 ":gunit_helpers",
Sam Zackrissonb45bdb52018-10-02 16:25:59 +02001270 ":rtc_base_tests_utils",
1271 ":rtc_json",
Niels Möller04a3cc12019-05-21 13:01:58 +02001272 "../test:test_main",
Sam Zackrissonb45bdb52018-10-02 16:25:59 +02001273 "../test:test_support",
1274 ]
1275 }
1276
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001277 rtc_library("rtc_base_unittests") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001278 testonly = true
Benjamin Wrightd6f86e82018-05-08 13:12:25 -07001279 defines = []
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001280
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001281 sources = [
1282 "callback_unittest.cc",
1283 "crc32_unittest.cc",
Sebastian Janssonf9c5cf62018-02-28 16:04:26 +01001284 "data_rate_limiter_unittest.cc",
Sebastian Jansson7d6a2592019-03-22 15:38:16 +01001285 "fake_clock_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001286 "helpers_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001287 "ip_address_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001288 "memory_usage_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001289 "message_digest_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001290 "nat_unittest.cc",
1291 "network_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001292 "proxy_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001293 "rolling_accumulator_unittest.cc",
1294 "rtc_certificate_generator_unittest.cc",
1295 "rtc_certificate_unittest.cc",
1296 "signal_thread_unittest.cc",
1297 "sigslot_tester_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001298 "test_client_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001299 "thread_unittest.cc",
Amit Hilbuchdbb49df2019-01-23 14:54:24 -08001300 "unique_id_generator_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001301 ]
1302 if (is_win) {
1303 sources += [
1304 "win32_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001305 "win32_window_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001306 ]
1307 }
Fabrice de Gans-Riberi09a6cd52018-03-30 10:38:06 -07001308 if (is_posix || is_fuchsia) {
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001309 sources += [
Steve Anton10542f22019-01-11 09:11:00 -08001310 "openssl_adapter_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -08001311 "openssl_session_cache_unittest.cc",
1312 "openssl_utility_unittest.cc",
1313 "ssl_adapter_unittest.cc",
1314 "ssl_identity_unittest.cc",
1315 "ssl_stream_adapter_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001316 ]
1317 }
1318 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001319 ":checks",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001320 ":gunit_helpers",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001321 ":rtc_base_tests_utils",
Patrik Höglund3e113432017-12-15 14:40:10 +01001322 ":stringutils",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001323 ":testclient",
Joachim Bauch58daf402017-12-21 22:00:34 +01001324 "../api:array_view",
Danil Chapovalov912b3b82019-11-22 15:52:40 +01001325 "../api/task_queue",
1326 "../api/task_queue:task_queue_test",
Patrik Höglund7696bef2018-03-15 15:05:39 +01001327 "../test:fileutils",
Niels Möller04a3cc12019-05-21 13:01:58 +02001328 "../test:test_main",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001329 "../test:test_support",
Niels Möller13339482019-03-28 13:30:15 +01001330 "memory:fifo_buffer",
Sebastian Jansson7a603392019-03-20 16:50:35 +01001331 "synchronization:synchronization_unittests",
Danil Chapovalovb877e712019-11-29 15:19:27 +01001332 "task_utils:to_queued_task",
Artem Titove41c4332018-07-25 15:04:28 +02001333 "third_party/sigslot",
Steve Anton2acd1632019-03-25 13:48:30 -07001334 "//third_party/abseil-cpp/absl/algorithm:container",
Karl Wiberg918f50c2018-07-05 11:40:33 +02001335 "//third_party/abseil-cpp/absl/memory",
Niels Möller04a3cc12019-05-21 13:01:58 +02001336 "//third_party/abseil-cpp/absl/strings",
Danil Chapovalov0a1d1892018-06-21 11:48:25 +02001337 "//third_party/abseil-cpp/absl/types:optional",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001338 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +01001339 public_deps = [ ":rtc_base" ] # no-presubmit-check TODO(webrtc:8603)
Diogo Real1dca9d52017-08-29 12:18:32 -07001340 if (build_with_chromium) {
1341 include_dirs = [ "../../boringssl/src/include" ]
1342 }
1343 if (rtc_build_ssl) {
1344 deps += [ "//third_party/boringssl" ]
1345 } else {
1346 configs += [ ":external_ssl_library" ]
1347 }
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001348 }
1349}
1350
Henrik Kjellander73e21802017-06-20 08:38:58 +02001351if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001352 rtc_android_library("base_java") {
Sami Kalliomäki51f599b2019-07-03 14:13:08 +02001353 visibility = [ "*" ]
Natalie Chouinard65bbcab2019-12-23 14:02:25 -08001354 sources = [
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001355 "java/src/org/webrtc/ContextUtils.java",
Paulina Hensman1ec04f12018-06-21 14:31:38 +02001356 "java/src/org/webrtc/Loggable.java",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001357 "java/src/org/webrtc/Logging.java",
1358 "java/src/org/webrtc/Size.java",
1359 "java/src/org/webrtc/ThreadUtils.java",
1360 ]
Artem Titarenko69540f42018-12-10 12:30:46 +01001361 deps = [
Peter Wen7bc331f2019-03-06 09:18:57 -05001362 "//third_party/android_deps:com_android_support_support_annotations_java",
Artem Titarenko69540f42018-12-10 12:30:46 +01001363 ]
Henrik Kjellander73e21802017-06-20 08:38:58 +02001364 }
1365}