blob: 92088b0cb1af4cb4569bc4859c125fe7b37211cb [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}
Henrik Kjellanderc0362762017-06-29 08:03:04 +020017if (is_win) {
18 import("//build/config/clang/clang.gni")
19}
Henrik Kjellander73e21802017-06-20 08:38:58 +020020
Henrik Kjellanderc0362762017-06-29 08:03:04 +020021group("base") {
22 public_deps = [
23 ":rtc_base",
24 ":rtc_base_approved",
25 ":rtc_task_queue",
Henrik Kjellanderc0362762017-06-29 08:03:04 +020026 ":weak_ptr",
27 ]
Henrik Kjellander73e21802017-06-20 08:38:58 +020028 if (is_android) {
29 public_deps += [ ":base_java" ]
30 }
31}
32
Henrik Kjellanderc0362762017-06-29 08:03:04 +020033config("rtc_base_chromium_config") {
34 defines = [ "NO_MAIN_THREAD_WRAPPING" ]
35}
36
37config("rtc_base_all_dependent_config") {
38 if (is_ios) {
39 libs = [
40 "CFNetwork.framework",
Jiawei Ouc0216b82018-02-03 12:24:24 -080041 "Foundation.framework",
Henrik Kjellanderc0362762017-06-29 08:03:04 +020042 "Security.framework",
43 "SystemConfiguration.framework",
44 "UIKit.framework",
45 ]
46 }
47 if (is_mac) {
48 libs = [
49 "Cocoa.framework",
50 "Foundation.framework",
51 "IOKit.framework",
52 "Security.framework",
53 "SystemConfiguration.framework",
54 ]
55 }
56}
57
Dan Minor9cdd8762018-01-16 10:40:39 -050058if (!rtc_build_ssl) {
Henrik Kjellanderc0362762017-06-29 08:03:04 +020059 config("external_ssl_library") {
60 assert(rtc_ssl_root != "",
61 "You must specify rtc_ssl_root when rtc_build_ssl==0.")
62 include_dirs = [ rtc_ssl_root ]
63 }
64}
65
66source_set("protobuf_utils") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000067 visibility = [ "*" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +020068 sources = [
69 "protobuf_utils.h",
70 ]
71 if (rtc_enable_protobuf) {
72 public_deps = [
73 "//third_party/protobuf:protobuf_lite",
74 ]
75 }
76}
77
78source_set("compile_assert_c") {
79 sources = [
80 "compile_assert_c.h",
81 ]
82}
83
mbonadeibc378472017-09-11 03:43:34 -070084rtc_source_set("rtc_base_approved") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000085 visibility = [ "*" ]
mbonadeibc378472017-09-11 03:43:34 -070086 public_deps = [
Tommi8d2c5a82018-03-19 11:12:48 +010087 ":atomicops",
88 ":criticalsection",
89 ":logging",
90 ":macromagic",
91 ":platform_thread",
92 ":platform_thread_types",
93 ":ptr_util",
94 ":refcount",
mbonadeibc378472017-09-11 03:43:34 -070095 ":rtc_base_approved_generic",
Tommi8d2c5a82018-03-19 11:12:48 +010096 ":rtc_event",
97 ":safe_conversions",
98 ":stringutils",
99 ":thread_checker",
100 ":timeutils",
mbonadeibc378472017-09-11 03:43:34 -0700101 ]
102 if (is_mac && !build_with_chromium) {
103 public_deps += [ ":rtc_base_approved_objc" ]
104 }
105}
106
Tommi8d2c5a82018-03-19 11:12:48 +0100107rtc_source_set("macromagic") {
108 sources = [
109 "arraysize.h",
110 "basictypes.h",
111 "constructormagic.h",
112 "format_macros.h",
113 "stringize_macros.h",
114 "thread_annotations.h",
115 ]
116}
117
118rtc_source_set("platform_thread_types") {
119 sources = [
120 "platform_thread_types.cc",
121 "platform_thread_types.h",
122 ]
123}
124
125rtc_source_set("ptr_util") {
126 sources = [
127 "ptr_util.h",
128 "scoped_ref_ptr.h",
129 ]
130}
131
132rtc_source_set("refcount") {
133 sources = [
134 "refcount.h",
135 "refcountedobject.h",
136 "refcounter.h",
137 ]
138 deps = [
139 ":atomicops",
140 ":macromagic",
141 ]
142}
143
144rtc_source_set("criticalsection") {
145 sources = [
146 "criticalsection.cc",
147 "criticalsection.h",
148 ]
149 deps = [
150 ":atomicops",
151 ":checks",
152 ":macromagic",
153 ":platform_thread_types",
154 "..:typedefs",
155 ]
156}
157
158rtc_source_set("platform_thread") {
159 visibility = [
160 ":rtc_base_approved",
161 ":rtc_base_approved_generic",
162 ":rtc_task_queue_libevent",
163 ":rtc_task_queue_win",
164 ":sequenced_task_checker",
165 ]
166 sources = [
167 "platform_thread.cc",
168 "platform_thread.h",
169 ]
170 deps = [
171 ":atomicops",
172 ":checks",
173 ":macromagic",
174 ":platform_thread_types",
175 ":rtc_event",
176 ":thread_checker",
177 ":timeutils",
178 "..:typedefs",
179 ]
180}
181
182rtc_source_set("rtc_event") {
John Budorick6c9a7862018-03-26 06:23:34 -0700183 deps = [
184 ":checks",
185 ":macromagic",
186 ]
187
Tommi8d2c5a82018-03-19 11:12:48 +0100188 if (build_with_chromium) {
John Budorick6c9a7862018-03-26 06:23:34 -0700189 # Dependency on chromium's waitable_event (in //base).
190 deps += [ "//base:base" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100191 sources = [
192 "../../webrtc_overrides/rtc_base/event.cc",
193 "../../webrtc_overrides/rtc_base/event.h",
194 ]
195 } else {
196 sources = [
197 "event.cc",
198 "event.h",
199 ]
200 }
Tommi8d2c5a82018-03-19 11:12:48 +0100201}
202
203rtc_source_set("logging") {
204 deps = [
205 ":criticalsection",
206 ":macromagic",
207 ":platform_thread_types",
208 ":stringutils",
209 ":timeutils",
210 ]
211
212 if (build_with_chromium) {
213 # Dependency on chromium's logging (in //base).
214 deps += [ "//base:base" ]
215 sources = [
216 "../../webrtc_overrides/rtc_base/logging.cc",
217 "../../webrtc_overrides/rtc_base/logging.h",
218 ]
219 } else {
220 sources = [
221 "logging.cc",
222 "logging.h",
223 ]
224
225 # logging.h needs the deprecation header while downstream projects are
226 # removing code that depends on logging implementation details.
227 deps += [ ":deprecation" ]
228 }
229}
230
231rtc_source_set("thread_checker") {
232 sources = [
233 "thread_checker.h",
234 "thread_checker_impl.cc",
235 "thread_checker_impl.h",
236 ]
237 deps = [
238 ":checks",
239 ":criticalsection",
240 ":macromagic",
241 ":platform_thread_types",
242 "..:typedefs",
243 ]
244}
245
246rtc_source_set("atomicops") {
247 sources = [
248 "atomicops.h",
249 ]
250}
251
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100252rtc_source_set("checks") {
253 sources = [
254 "checks.cc",
255 "checks.h",
256 ]
257 deps = [
258 ":safe_compare",
Patrik Höglund3e113432017-12-15 14:40:10 +0100259 "..:typedefs",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100260 ]
261}
262
Patrik Höglund3e113432017-12-15 14:40:10 +0100263rtc_source_set("rate_limiter") {
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100264 sources = [
Patrik Höglund3e113432017-12-15 14:40:10 +0100265 "rate_limiter.cc",
266 "rate_limiter.h",
267 ]
268 deps = [
269 ":rtc_base_approved",
270 "../system_wrappers",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100271 ]
272}
273
274rtc_source_set("sanitizer") {
275 sources = [
276 "sanitizer.h",
277 ]
278}
279
280rtc_source_set("safe_compare") {
281 sources = [
282 "numerics/safe_compare.h",
283 ]
284 deps = [
285 ":type_traits",
286 ]
287}
288
Karl Wiberg12edf4c2018-03-07 14:18:56 +0100289rtc_source_set("safe_minmax") {
290 sources = [
291 "numerics/safe_minmax.h",
292 ]
293 deps = [
294 ":checks",
295 ":safe_compare",
296 ":type_traits",
297 ]
298}
299
Tommi8d2c5a82018-03-19 11:12:48 +0100300rtc_source_set("safe_conversions") {
301 sources = [
302 "numerics/safe_conversions.h",
303 "numerics/safe_conversions_impl.h",
304 ]
305 deps = [
306 ":checks",
307 ]
308}
309
310rtc_source_set("timeutils") {
311 sources = [
312 "timeutils.cc",
313 "timeutils.h",
314 ]
315 deps = [
316 ":checks",
317 ":safe_conversions",
318 ]
319}
320
Patrik Höglund3e113432017-12-15 14:40:10 +0100321rtc_source_set("stringutils") {
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100322 sources = [
Tommi8d2c5a82018-03-19 11:12:48 +0100323 "stringencode.cc",
324 "stringencode.h",
Karl Wiberg881f1682018-03-08 15:03:23 +0100325 "strings/string_builder.cc",
Tommifef05002018-02-27 13:51:08 +0100326 "strings/string_builder.h",
Patrik Höglund3e113432017-12-15 14:40:10 +0100327 "stringutils.cc",
328 "stringutils.h",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100329 ]
330 deps = [
Patrik Höglund3e113432017-12-15 14:40:10 +0100331 ":checks",
Karl Wiberg881f1682018-03-08 15:03:23 +0100332 ":safe_minmax",
333 "../api:array_view",
Patrik Höglund3e113432017-12-15 14:40:10 +0100334 ]
335}
336
Jonas Olsson74395342018-04-03 12:22:07 +0200337rtc_source_set("audio_format_to_string") {
338 sources = [
339 "strings/audio_format_to_string.cc",
340 "strings/audio_format_to_string.h",
341 ]
342 deps = [
343 ":stringutils",
344 "../api/audio_codecs:audio_codecs_api",
345 ]
346}
347
Patrik Höglund3e113432017-12-15 14:40:10 +0100348rtc_source_set("type_traits") {
349 sources = [
350 "type_traits.h",
351 ]
352}
353
354rtc_source_set("deprecation") {
355 sources = [
356 "deprecation.h",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100357 ]
358}
359
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200360# The subset of rtc_base approved for use outside of libjingle.
mbonadeibc378472017-09-11 03:43:34 -0700361rtc_source_set("rtc_base_approved_generic") {
362 visibility = [
363 ":rtc_base_approved",
Tommi897e1362017-12-01 18:56:43 +0100364 ":weak_ptr_unittests",
mbonadeibc378472017-09-11 03:43:34 -0700365 ]
366
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100367 cflags = []
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200368 defines = []
369 libs = []
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100370 deps = [
Tommi8d2c5a82018-03-19 11:12:48 +0100371 ":atomicops",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100372 ":checks",
Tommi8d2c5a82018-03-19 11:12:48 +0100373 ":criticalsection",
374 ":logging",
375 ":macromagic",
376 ":platform_thread",
377 ":platform_thread_types",
378 ":ptr_util",
379 ":refcount",
380 ":rtc_event",
381 ":rtc_task_queue",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100382 ":safe_compare",
Tommi8d2c5a82018-03-19 11:12:48 +0100383 ":safe_conversions",
Patrik Höglund3e113432017-12-15 14:40:10 +0100384 ":stringutils",
Tommi8d2c5a82018-03-19 11:12:48 +0100385 ":thread_checker",
386 ":timeutils",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100387 ":type_traits",
Patrik Höglund3e113432017-12-15 14:40:10 +0100388 "../:typedefs",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100389 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200390
391 sources = [
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200392 "base64.cc",
393 "base64.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200394 "bind.h",
395 "bitbuffer.cc",
396 "bitbuffer.h",
Alex Narest78609d52017-10-20 10:37:47 +0200397 "bitrateallocationstrategy.cc",
398 "bitrateallocationstrategy.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200399 "buffer.h",
400 "bufferqueue.cc",
401 "bufferqueue.h",
402 "bytebuffer.cc",
403 "bytebuffer.h",
404 "byteorder.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200405 "copyonwritebuffer.cc",
406 "copyonwritebuffer.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200407 "event_tracer.cc",
408 "event_tracer.h",
409 "file.cc",
410 "file.h",
411 "flags.cc",
412 "flags.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200413 "function_view.h",
414 "ignore_wundef.h",
415 "location.cc",
416 "location.h",
Karl Wiberg65c39222017-11-22 12:25:14 +0100417 "numerics/histogram_percentile_counter.cc",
418 "numerics/histogram_percentile_counter.h",
419 "numerics/mod_ops.h",
420 "numerics/moving_max_counter.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200421 "onetimeevent.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200422 "pathutils.cc",
423 "pathutils.h",
424 "platform_file.cc",
425 "platform_file.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200426 "race_checker.cc",
427 "race_checker.h",
428 "random.cc",
429 "random.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200430 "rate_statistics.cc",
431 "rate_statistics.h",
432 "ratetracker.cc",
433 "ratetracker.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200434 "string_to_number.cc",
435 "string_to_number.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200436 "swap_queue.h",
437 "template_util.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200438 "timestampaligner.cc",
439 "timestampaligner.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200440 "trace_event.h",
Joachim Bauch5b32f232018-03-07 20:02:26 +0100441 "zero_memory.cc",
442 "zero_memory.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200443 ]
444
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100445 deps += [
446 "..:webrtc_common",
447 "../api:array_view",
448 "../api:optional",
449 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200450
451 if (is_android) {
452 libs += [ "log" ]
453 }
454
455 if (is_posix) {
456 sources += [ "file_posix.cc" ]
457 }
458
459 if (is_win) {
460 sources += [ "file_win.cc" ]
461 }
462
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200463 if (is_component_build && is_win) {
464 # Copy the VS runtime DLLs into the isolate so that they don't have to be
465 # preinstalled on the target machine. The debug runtimes have a "d" at
466 # the end.
467 # This is a copy of https://codereview.chromium.org/1783973002.
468 # TODO(ehmaldonado): We'd like Chromium to make this changes easier to use,
469 # so we don't have to copy their changes and risk breakages.
470 # See http://crbug.com/653569
471 if (is_debug) {
472 vcrt_suffix = "d"
473 } else {
474 vcrt_suffix = ""
475 }
476
477 # These runtime files are copied to the output directory by the
478 # vs_toolchain script that runs as part of toolchain configuration.
479 data = [
480 "$root_out_dir/msvcp140${vcrt_suffix}.dll",
481 "$root_out_dir/vccorlib140${vcrt_suffix}.dll",
482 "$root_out_dir/vcruntime140${vcrt_suffix}.dll",
483
484 # Universal Windows 10 CRT files
485 "$root_out_dir/api-ms-win-core-console-l1-1-0.dll",
486 "$root_out_dir/api-ms-win-core-datetime-l1-1-0.dll",
487 "$root_out_dir/api-ms-win-core-debug-l1-1-0.dll",
488 "$root_out_dir/api-ms-win-core-errorhandling-l1-1-0.dll",
489 "$root_out_dir/api-ms-win-core-file-l1-1-0.dll",
490 "$root_out_dir/api-ms-win-core-file-l1-2-0.dll",
491 "$root_out_dir/api-ms-win-core-file-l2-1-0.dll",
492 "$root_out_dir/api-ms-win-core-handle-l1-1-0.dll",
493 "$root_out_dir/api-ms-win-core-heap-l1-1-0.dll",
494 "$root_out_dir/api-ms-win-core-interlocked-l1-1-0.dll",
495 "$root_out_dir/api-ms-win-core-libraryloader-l1-1-0.dll",
496 "$root_out_dir/api-ms-win-core-localization-l1-2-0.dll",
497 "$root_out_dir/api-ms-win-core-memory-l1-1-0.dll",
498 "$root_out_dir/api-ms-win-core-namedpipe-l1-1-0.dll",
499 "$root_out_dir/api-ms-win-core-processenvironment-l1-1-0.dll",
500 "$root_out_dir/api-ms-win-core-processthreads-l1-1-0.dll",
501 "$root_out_dir/api-ms-win-core-processthreads-l1-1-1.dll",
502 "$root_out_dir/api-ms-win-core-profile-l1-1-0.dll",
503 "$root_out_dir/api-ms-win-core-rtlsupport-l1-1-0.dll",
504 "$root_out_dir/api-ms-win-core-string-l1-1-0.dll",
505 "$root_out_dir/api-ms-win-core-synch-l1-1-0.dll",
506 "$root_out_dir/api-ms-win-core-synch-l1-2-0.dll",
507 "$root_out_dir/api-ms-win-core-sysinfo-l1-1-0.dll",
508 "$root_out_dir/api-ms-win-core-timezone-l1-1-0.dll",
509 "$root_out_dir/api-ms-win-core-util-l1-1-0.dll",
510 "$root_out_dir/api-ms-win-crt-conio-l1-1-0.dll",
511 "$root_out_dir/api-ms-win-crt-convert-l1-1-0.dll",
512 "$root_out_dir/api-ms-win-crt-environment-l1-1-0.dll",
513 "$root_out_dir/api-ms-win-crt-filesystem-l1-1-0.dll",
514 "$root_out_dir/api-ms-win-crt-heap-l1-1-0.dll",
515 "$root_out_dir/api-ms-win-crt-locale-l1-1-0.dll",
516 "$root_out_dir/api-ms-win-crt-math-l1-1-0.dll",
517 "$root_out_dir/api-ms-win-crt-multibyte-l1-1-0.dll",
518 "$root_out_dir/api-ms-win-crt-private-l1-1-0.dll",
519 "$root_out_dir/api-ms-win-crt-process-l1-1-0.dll",
520 "$root_out_dir/api-ms-win-crt-runtime-l1-1-0.dll",
521 "$root_out_dir/api-ms-win-crt-stdio-l1-1-0.dll",
522 "$root_out_dir/api-ms-win-crt-string-l1-1-0.dll",
523 "$root_out_dir/api-ms-win-crt-time-l1-1-0.dll",
524 "$root_out_dir/api-ms-win-crt-utility-l1-1-0.dll",
525 "$root_out_dir/ucrtbase${vcrt_suffix}.dll",
526 ]
527 if (is_asan) {
528 if (current_cpu == "x64") {
529 data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-x86_64.dll" ]
530 } else {
531 data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-i386.dll" ]
532 }
533 }
534 }
535 if (is_nacl) {
536 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
537 }
538}
539
mbonadeibc378472017-09-11 03:43:34 -0700540if (is_mac && !build_with_chromium) {
541 config("rtc_base_approved_objc_all_dependent_config") {
542 visibility = [ ":rtc_base_approved_objc" ]
543 libs = [ "Foundation.framework" ] # needed for logging_mac.mm
544 }
545
546 rtc_source_set("rtc_base_approved_objc") {
547 visibility = [ ":rtc_base_approved" ]
548 all_dependent_configs = [ ":rtc_base_approved_objc_all_dependent_config" ]
549 sources = [
550 "logging_mac.mm",
551 ]
552 deps = [
Tommi8d2c5a82018-03-19 11:12:48 +0100553 ":logging",
mbonadeibc378472017-09-11 03:43:34 -0700554 ]
555 }
556}
557
perkj650fdae2017-08-25 05:00:11 -0700558rtc_source_set("rtc_task_queue") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000559 visibility = [ "*" ]
Tommi8d2c5a82018-03-19 11:12:48 +0100560 deps = []
mbonadei95c8f652017-08-27 23:40:10 -0700561 public_deps = [
perkj650fdae2017-08-25 05:00:11 -0700562 ":rtc_task_queue_api",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200563 ]
564
perkj650fdae2017-08-25 05:00:11 -0700565 if (rtc_link_task_queue_impl) {
mbonadei95c8f652017-08-27 23:40:10 -0700566 deps += [ ":rtc_task_queue_impl" ]
perkj650fdae2017-08-25 05:00:11 -0700567 }
568}
569
570# WebRTC targets must not directly depend on rtc_task_queue_api or
571# rtc_task_queue_impl. Instead, depend on rtc_task_queue.
572# The build flag |rtc_link_task_queue_impl| decides if WebRTC targets will link
573# to the default implemenation in rtc_task_queue_impl or if an externally
574# provided implementation should be used. An external implementation should
575# depend on rtc_task_queue_api.
576rtc_source_set("rtc_task_queue_api") {
Tommi8d2c5a82018-03-19 11:12:48 +0100577 # The visibility list is commented out so that we won't break external
578 # implementations, but left here to manually test as well as for sake of what
579 # targets we expect to depend on rtc_task_queue_api.
580 # visibility = [
581 # ":rtc_task_queue",
582 # ":rtc_task_queue_impl",
583 # ":sequenced_task_checker",
584 # ]
nisse75dd6d42017-09-19 08:28:00 -0700585 sources = [
586 "task_queue.h",
587 ]
perkj650fdae2017-08-25 05:00:11 -0700588 deps = [
Tommi8d2c5a82018-03-19 11:12:48 +0100589 ":macromagic",
590 ":ptr_util",
perkj650fdae2017-08-25 05:00:11 -0700591 ]
592}
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200593
Tommi8d2c5a82018-03-19 11:12:48 +0100594if (rtc_enable_libevent) {
595 rtc_source_set("rtc_task_queue_libevent") {
596 visibility = [ ":rtc_task_queue_impl" ]
perkj650fdae2017-08-25 05:00:11 -0700597 sources = [
Niels Möller15c9cf72017-10-19 12:38:09 +0200598 "task_queue_libevent.cc",
599 "task_queue_posix.cc",
600 "task_queue_posix.h",
perkj650fdae2017-08-25 05:00:11 -0700601 ]
Tommi8d2c5a82018-03-19 11:12:48 +0100602 deps = [
603 ":checks",
604 ":criticalsection",
605 ":logging",
606 ":platform_thread",
607 ":ptr_util",
608 ":refcount",
609 ":rtc_task_queue_api",
610 ":safe_conversions",
611 ":timeutils",
612 ]
613 if (rtc_build_libevent) {
614 deps += [ "//base/third_party/libevent" ]
615 }
616 }
617}
618
619if (is_mac || is_ios) {
620 rtc_source_set("rtc_task_queue_gcd") {
621 visibility = [ ":rtc_task_queue_impl" ]
622 sources = [
623 "task_queue_gcd.cc",
624 "task_queue_posix.cc",
625 "task_queue_posix.h",
626 ]
627 deps = [
628 ":checks",
629 ":logging",
630 ":ptr_util",
631 ":refcount",
632 ":rtc_task_queue_api",
633 ]
634 }
635}
636
637if (is_win) {
638 rtc_source_set("rtc_task_queue_win") {
639 visibility = [ ":rtc_task_queue_impl" ]
640 sources = [
641 "task_queue_win.cc",
642 ]
643 deps = [
644 ":checks",
645 ":criticalsection",
646 ":logging",
647 ":macromagic",
648 ":platform_thread",
649 ":ptr_util",
650 ":refcount",
651 ":rtc_event",
652 ":rtc_task_queue_api",
653 ":safe_conversions",
654 ":timeutils",
655 ]
656 }
657}
658
659rtc_source_set("rtc_task_queue_impl") {
660 visibility = [ "*" ]
661 if (rtc_enable_libevent) {
662 deps = [
663 ":rtc_task_queue_libevent",
664 ]
perkj650fdae2017-08-25 05:00:11 -0700665 } else {
Niels Möller15c9cf72017-10-19 12:38:09 +0200666 if (is_mac || is_ios) {
Tommi8d2c5a82018-03-19 11:12:48 +0100667 deps = [
668 ":rtc_task_queue_gcd",
Niels Möller17a04742017-09-27 10:53:21 +0200669 ]
Niels Möller15c9cf72017-10-19 12:38:09 +0200670 }
671 if (is_win) {
Tommi8d2c5a82018-03-19 11:12:48 +0100672 deps = [
673 ":rtc_task_queue_win",
Niels Möller15c9cf72017-10-19 12:38:09 +0200674 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200675 }
676 }
677}
678
Tommi8d2c5a82018-03-19 11:12:48 +0100679rtc_source_set("sequenced_task_checker") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200680 sources = [
681 "sequenced_task_checker.h",
682 "sequenced_task_checker_impl.cc",
683 "sequenced_task_checker_impl.h",
684 ]
685 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100686 ":checks",
Tommi8d2c5a82018-03-19 11:12:48 +0100687 ":criticalsection",
688 ":macromagic",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200689 ":rtc_task_queue",
Tommi8d2c5a82018-03-19 11:12:48 +0100690 ":thread_checker",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200691 ]
692}
693
694rtc_static_library("weak_ptr") {
695 sources = [
696 "weak_ptr.cc",
697 "weak_ptr.h",
698 ]
699 deps = [
Tommi8d2c5a82018-03-19 11:12:48 +0100700 ":ptr_util",
701 ":refcount",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200702 ":sequenced_task_checker",
703 ]
704}
705
706rtc_static_library("rtc_numerics") {
707 sources = [
708 "numerics/exp_filter.cc",
709 "numerics/exp_filter.h",
Ilya Nikolaevskiyb9685752017-11-01 14:01:00 +0100710 "numerics/moving_median_filter.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200711 "numerics/percentile_filter.h",
Bjorn Tereliusa194e582017-10-25 13:07:09 +0200712 "numerics/sequence_number_util.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200713 ]
714 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100715 ":checks",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200716 ":rtc_base_approved",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100717 ":safe_compare",
Bjorn Tereliusa194e582017-10-25 13:07:09 +0200718 "../api:optional",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200719 ]
720}
721
722config("rtc_base_warnings_config") {
723 if (is_win && is_clang) {
724 cflags = [
725 # Disable warnings failing when compiling with Clang on Windows.
726 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
727 "-Wno-sign-compare",
728 "-Wno-missing-braces",
729 ]
730 }
731}
732
733rtc_source_set("rtc_json") {
734 defines = []
735 sources = [
736 "json.cc",
737 "json.h",
738 ]
Mirko Bonadeia0e29fc2018-01-26 16:50:02 +0100739 all_dependent_configs = [ "//third_party/jsoncpp:jsoncpp_config" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200740 if (rtc_build_json) {
741 public_deps = [
742 "//third_party/jsoncpp",
743 ]
744 } else {
745 include_dirs = [ "$rtc_jsoncpp_root" ]
746
747 # When defined changes the include path for json.h to where it is
748 # expected to be when building json outside of the standalone build.
749 defines += [ "WEBRTC_EXTERNAL_JSON" ]
750 }
751}
752
mbonadei9c5e5112017-09-05 05:17:02 -0700753rtc_static_library("rtc_base") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000754 visibility = [ "*" ]
Dan Minor9c686132018-01-15 10:20:00 -0500755 public_deps = []
756 if (!build_with_mozilla) {
757 public_deps += [ ":rtc_base_generic" ]
758 }
mbonadei310e32b2017-09-07 07:36:28 -0700759 if (is_win) {
760 sources = [
761 "noop.cc",
762 ]
763 }
764 if (is_ios || is_mac) {
765 sources = [
766 "noop.mm",
767 ]
768 public_deps += [ ":rtc_base_objc" ]
769 }
770}
771
772if (is_ios || is_mac) {
773 rtc_source_set("rtc_base_objc") {
774 sources = [
775 "thread_darwin.mm",
776 ]
777 deps = [
778 ":rtc_base_generic",
779 ]
780 visibility = [ ":rtc_base" ]
781 }
782}
783
784rtc_static_library("rtc_base_generic") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200785 cflags = []
786 cflags_cc = []
787 libs = []
788 defines = []
789 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100790 ":checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100791 ":stringutils",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200792 "..:webrtc_common",
Joachim Bauch58daf402017-12-21 22:00:34 +0100793 "../api:array_view",
kwiberg84f6a3f2017-09-05 08:43:13 -0700794 "../api:optional",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200795 ]
796 public_deps = [
797 ":rtc_base_approved",
798 ]
799 public_configs = []
800
801 all_dependent_configs = [ ":rtc_base_all_dependent_config" ]
802
803 sources = [
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200804 "asyncinvoker-inl.h",
805 "asyncinvoker.cc",
806 "asyncinvoker.h",
807 "asyncpacketsocket.cc",
808 "asyncpacketsocket.h",
809 "asyncresolverinterface.cc",
810 "asyncresolverinterface.h",
811 "asyncsocket.cc",
812 "asyncsocket.h",
813 "asynctcpsocket.cc",
814 "asynctcpsocket.h",
815 "asyncudpsocket.cc",
816 "asyncudpsocket.h",
817 "crc32.cc",
818 "crc32.h",
819 "cryptstring.cc",
820 "cryptstring.h",
Sebastian Janssonf9c5cf62018-02-28 16:04:26 +0100821 "data_rate_limiter.cc",
822 "data_rate_limiter.h",
Patrik Höglund76df0df2017-12-19 11:50:21 +0100823 "dscp.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200824 "filerotatingstream.cc",
825 "filerotatingstream.h",
826 "fileutils.cc",
827 "fileutils.h",
828 "gunit_prod.h",
829 "helpers.cc",
830 "helpers.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200831 "httpcommon-inl.h",
832 "httpcommon.cc",
833 "httpcommon.h",
834 "ipaddress.cc",
835 "ipaddress.h",
Patrik Höglund76df0df2017-12-19 11:50:21 +0100836 "keep_ref_until_done.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200837 "messagedigest.cc",
838 "messagedigest.h",
839 "messagehandler.cc",
840 "messagehandler.h",
841 "messagequeue.cc",
842 "messagequeue.h",
Zhi Huang942bc2e2017-11-13 13:26:07 -0800843 "nethelper.cc",
844 "nethelper.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200845 "nethelpers.cc",
846 "nethelpers.h",
847 "network.cc",
848 "network.h",
Patrik Höglunde2d6a062017-10-05 14:53:33 +0200849 "network_constants.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200850 "networkmonitor.cc",
851 "networkmonitor.h",
Patrik Höglund76df0df2017-12-19 11:50:21 +0100852 "networkroute.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200853 "nullsocketserver.cc",
854 "nullsocketserver.h",
855 "openssl.h",
856 "openssladapter.cc",
857 "openssladapter.h",
858 "openssldigest.cc",
859 "openssldigest.h",
860 "opensslidentity.cc",
861 "opensslidentity.h",
862 "opensslstreamadapter.cc",
863 "opensslstreamadapter.h",
864 "physicalsocketserver.cc",
865 "physicalsocketserver.h",
866 "proxyinfo.cc",
867 "proxyinfo.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200868 "rtccertificate.cc",
869 "rtccertificate.h",
870 "rtccertificategenerator.cc",
871 "rtccertificategenerator.h",
deadbeef8290ddf2017-07-11 16:56:05 -0700872 "signalthread.cc",
873 "signalthread.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200874 "sigslot.cc",
875 "sigslot.h",
Taylor Brandstettere68b6c92017-10-05 09:13:55 -0700876 "sigslotrepeater.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200877 "socket.h",
878 "socketadapters.cc",
879 "socketadapters.h",
880 "socketaddress.cc",
881 "socketaddress.h",
882 "socketaddresspair.cc",
883 "socketaddresspair.h",
884 "socketfactory.h",
885 "socketserver.h",
886 "socketstream.cc",
887 "socketstream.h",
888 "ssladapter.cc",
889 "ssladapter.h",
890 "sslfingerprint.cc",
891 "sslfingerprint.h",
892 "sslidentity.cc",
893 "sslidentity.h",
894 "sslstreamadapter.cc",
895 "sslstreamadapter.h",
896 "stream.cc",
897 "stream.h",
898 "thread.cc",
899 "thread.h",
900 ]
901
mbonadei310e32b2017-09-07 07:36:28 -0700902 visibility = [
903 ":rtc_base",
904 ":rtc_base_objc",
905 ]
906
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200907 # TODO(henrike): issue 3307, make rtc_base build with the Chromium default
908 # compiler settings.
909 suppressed_configs += [ "//build/config/compiler:chromium_code" ]
910 configs += [ "//build/config/compiler:no_chromium_code" ]
911 if (!is_win) {
912 cflags += [ "-Wno-uninitialized" ]
913 }
914
915 if (build_with_chromium) {
916 if (is_win) {
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200917 sources += [ "../../webrtc_overrides/rtc_base/win32socketinit.cc" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200918 }
919 include_dirs = [ "../../boringssl/src/include" ]
920 public_configs += [ ":rtc_base_chromium_config" ]
921 } else {
922 configs += [ ":rtc_base_warnings_config" ]
923 sources += [
924 "callback.h",
925 "logsinks.cc",
926 "logsinks.h",
Karl Wiberg65c39222017-11-22 12:25:14 +0100927 "numerics/mathutils.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200928 "optionsfile.cc",
929 "optionsfile.h",
930 "rollingaccumulator.h",
931 "sslroots.h",
932 "transformadapter.cc",
933 "transformadapter.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200934 ]
935
936 if (is_win) {
937 sources += [
938 "win32socketinit.cc",
939 "win32socketinit.h",
940 "win32socketserver.cc",
941 "win32socketserver.h",
942 ]
943 }
944 } # !build_with_chromium
945
946 if (rtc_build_ssl) {
947 deps += [ "//third_party/boringssl" ]
Dan Minor9cdd8762018-01-16 10:40:39 -0500948 } else {
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200949 configs += [ ":external_ssl_library" ]
950 }
951
952 if (is_android) {
953 sources += [
954 "ifaddrs-android.cc",
955 "ifaddrs-android.h",
956 ]
957
958 libs += [
959 "log",
960 "GLESv2",
961 ]
962 }
963
964 if (is_ios || is_mac) {
mbonadei310e32b2017-09-07 07:36:28 -0700965 sources += [ "macifaddrs_converter.cc" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200966 }
967
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100968 if (rtc_use_x11) {
Henrik Kjellanderc0362762017-06-29 08:03:04 +0200969 libs += [
970 "dl",
971 "rt",
972 "Xext",
973 "X11",
974 "Xcomposite",
975 "Xrender",
976 ]
977 }
978
979 if (is_linux) {
980 libs += [
981 "dl",
982 "rt",
983 ]
984 }
985
986 if (is_mac) {
987 sources += [
988 "macutils.cc",
989 "macutils.h",
990 ]
991 libs += [
992 # For ProcessInformationCopyDictionary in unixfilesystem.cc.
993 "ApplicationServices.framework",
994 ]
995 }
996
997 if (is_win) {
998 sources += [
999 "win32.cc",
1000 "win32.h",
1001 "win32filesystem.cc",
1002 "win32filesystem.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001003 "win32window.cc",
1004 "win32window.h",
1005 ]
1006
1007 libs += [
1008 "crypt32.lib",
1009 "iphlpapi.lib",
1010 "secur32.lib",
1011 ]
1012
1013 cflags += [
1014 # Suppress warnings about WIN32_LEAN_AND_MEAN.
1015 "/wd4005",
1016 "/wd4703",
1017 ]
1018
1019 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
1020 }
1021
1022 if (is_posix) {
1023 sources += [
1024 "ifaddrs_converter.cc",
1025 "ifaddrs_converter.h",
1026 "unixfilesystem.cc",
1027 "unixfilesystem.h",
1028 ]
1029 }
1030
1031 if (is_nacl) {
1032 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
1033 defines += [ "timezone=_timezone" ]
1034 sources -= [ "ifaddrs_converter.cc" ]
1035 }
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001036}
1037
1038rtc_source_set("gtest_prod") {
Per Kjellandera7f2d842018-01-10 15:54:53 +00001039 visibility = [ "*" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001040 sources = [
1041 "gtest_prod_util.h",
1042 ]
1043}
1044
1045config("rtc_base_tests_utils_exported_config") {
1046 defines = [ "GTEST_RELATIVE_PATH" ]
1047}
1048
1049config("rtc_base_tests_utils_warnings_config") {
1050 if (is_win && is_clang) {
1051 cflags = [
1052 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6270
1053 "-Wno-reorder",
1054 "-Wno-sign-compare",
1055 ]
1056 }
1057}
1058
1059rtc_source_set("rtc_base_tests_utils") {
1060 testonly = true
1061 sources = [
1062 # Also use this as a convenient dumping ground for misc files that are
1063 # included by multiple targets below.
1064 "cpu_time.cc",
1065 "cpu_time.h",
1066 "fakeclock.cc",
1067 "fakeclock.h",
1068 "fakenetwork.h",
Steve Anton9de3aac2017-10-24 10:08:26 -07001069 "fakesslidentity.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001070 "fakesslidentity.h",
1071 "firewallsocketserver.cc",
1072 "firewallsocketserver.h",
Steve Antonad7bffc2018-01-22 10:21:56 -08001073 "gunit.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001074 "gunit.h",
Niels Möller3c8a5f22017-12-15 16:04:21 +01001075 "httpbase.cc",
1076 "httpbase.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001077 "httpserver.cc",
1078 "httpserver.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001079 "memory_usage.cc",
1080 "memory_usage.h",
1081 "natserver.cc",
1082 "natserver.h",
1083 "natsocketfactory.cc",
1084 "natsocketfactory.h",
1085 "nattypes.cc",
1086 "nattypes.h",
1087 "proxyserver.cc",
1088 "proxyserver.h",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001089 "sigslottester.h",
1090 "sigslottester.h.pump",
1091 "testbase64.h",
1092 "testclient.cc",
1093 "testclient.h",
Steve Anton9de3aac2017-10-24 10:08:26 -07001094 "testechoserver.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001095 "testechoserver.h",
Steve Anton9de3aac2017-10-24 10:08:26 -07001096 "testutils.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001097 "testutils.h",
1098 "timedelta.h",
1099 "virtualsocketserver.cc",
1100 "virtualsocketserver.h",
1101 ]
1102 configs += [ ":rtc_base_tests_utils_warnings_config" ]
1103 public_configs = [ ":rtc_base_tests_utils_exported_config" ]
1104 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001105 ":checks",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001106 ":rtc_base",
Patrik Höglund3e113432017-12-15 14:40:10 +01001107 ":stringutils",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001108 "../test:field_trial",
1109 "../test:test_support",
Karl Wiberg80ba3332018-02-05 10:33:35 +01001110 "system:fallthrough",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001111 ]
1112 public_deps = [
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001113 "//testing/gtest",
1114 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001115}
1116
Tommida8781f2018-02-19 12:41:43 +01001117rtc_source_set("rtc_task_queue_for_test") {
1118 visibility = [ "*" ]
1119 testonly = true
1120
1121 sources = [
1122 "task_queue_for_test.cc",
1123 "task_queue_for_test.h",
1124 ]
1125 deps = [
1126 ":checks",
1127 ":rtc_base_approved",
1128 ":rtc_task_queue",
1129 ]
1130}
1131
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001132if (rtc_include_tests) {
1133 rtc_source_set("rtc_base_tests_main") {
1134 testonly = true
1135 sources = [
1136 "unittest_main.cc",
1137 ]
1138 public_configs = [ ":rtc_base_tests_utils_exported_config" ]
1139 deps = [
1140 ":rtc_base",
1141 ":rtc_base_approved",
1142 ":rtc_base_tests_utils",
Bjorn Tereliusedab3012018-01-31 17:23:40 +01001143 "../system_wrappers:field_trial_default",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001144 "../test:field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +01001145 "../test:fileutils",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001146 "../test:test_support",
1147 ]
1148
1149 public_deps = [
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001150 "//testing/gtest",
1151 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001152 }
1153
1154 rtc_source_set("rtc_base_nonparallel_tests") {
1155 testonly = true
1156
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001157 sources = [
1158 "cpu_time_unittest.cc",
1159 "filerotatingstream_unittest.cc",
1160 "nullsocketserver_unittest.cc",
1161 "physicalsocketserver_unittest.cc",
1162 "socket_unittest.cc",
1163 "socket_unittest.h",
1164 "socketaddress_unittest.cc",
1165 ]
1166 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001167 ":checks",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001168 ":rtc_base",
1169 ":rtc_base_tests_main",
1170 ":rtc_base_tests_utils",
1171 "../system_wrappers:system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +01001172 "../test:fileutils",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001173 "../test:test_support",
1174 "//testing/gtest",
1175 ]
1176 if (is_win) {
1177 sources += [ "win32socketserver_unittest.cc" ]
1178 }
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001179 }
1180
1181 rtc_source_set("rtc_base_approved_unittests") {
1182 testonly = true
1183
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001184 sources = [
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001185 "atomicops_unittest.cc",
1186 "base64_unittest.cc",
1187 "basictypes_unittest.cc",
1188 "bind_unittest.cc",
1189 "bitbuffer_unittest.cc",
Alex Narestd0e196b2017-11-22 17:22:35 +01001190 "bitrateallocationstrategy_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001191 "buffer_unittest.cc",
1192 "bufferqueue_unittest.cc",
1193 "bytebuffer_unittest.cc",
1194 "byteorder_unittest.cc",
1195 "copyonwritebuffer_unittest.cc",
1196 "criticalsection_unittest.cc",
1197 "event_tracer_unittest.cc",
1198 "event_unittest.cc",
1199 "file_unittest.cc",
1200 "function_view_unittest.cc",
1201 "logging_unittest.cc",
Karl Wiberg65c39222017-11-22 12:25:14 +01001202 "numerics/histogram_percentile_counter_unittest.cc",
1203 "numerics/mod_ops_unittest.cc",
1204 "numerics/moving_max_counter_unittest.cc",
Karl Wiberge40468b2017-11-22 10:42:26 +01001205 "numerics/safe_compare_unittest.cc",
1206 "numerics/safe_minmax_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001207 "onetimeevent_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001208 "pathutils_unittest.cc",
Artem Titove62f6002018-03-19 15:40:00 +01001209 "platform_file_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001210 "platform_thread_unittest.cc",
1211 "random_unittest.cc",
1212 "rate_limiter_unittest.cc",
1213 "rate_statistics_unittest.cc",
1214 "ratetracker_unittest.cc",
1215 "refcountedobject_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001216 "string_to_number_unittest.cc",
1217 "stringencode_unittest.cc",
1218 "stringize_macros_unittest.cc",
Tommifef05002018-02-27 13:51:08 +01001219 "strings/string_builder_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001220 "stringutils_unittest.cc",
1221 "swap_queue_unittest.cc",
1222 "thread_annotations_unittest.cc",
1223 "thread_checker_unittest.cc",
1224 "timestampaligner_unittest.cc",
1225 "timeutils_unittest.cc",
1226 "virtualsocket_unittest.cc",
Joachim Bauch5b32f232018-03-07 20:02:26 +01001227 "zero_memory_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001228 ]
1229 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001230 ":checks",
1231 ":rate_limiter",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001232 ":rtc_base",
1233 ":rtc_base_approved",
1234 ":rtc_base_tests_main",
1235 ":rtc_base_tests_utils",
1236 ":rtc_task_queue",
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001237 ":safe_compare",
Karl Wiberg12edf4c2018-03-07 14:18:56 +01001238 ":safe_minmax",
Patrik Höglund3e113432017-12-15 14:40:10 +01001239 ":stringutils",
kwiberg529662a2017-09-04 05:43:17 -07001240 "../api:array_view",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001241 "../system_wrappers:system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +01001242 "../test:fileutils",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001243 "../test:test_support",
Karl Wiberg29e7bee2018-03-22 14:11:52 +01001244 "memory:unittests",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001245 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001246 }
1247
1248 rtc_source_set("rtc_task_queue_unittests") {
Per Kjellandera7f2d842018-01-10 15:54:53 +00001249 visibility = [ "*" ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001250 testonly = true
1251
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001252 sources = [
1253 "task_queue_unittest.cc",
1254 ]
1255 deps = [
mbonadei95c8f652017-08-27 23:40:10 -07001256 ":rtc_base_approved",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001257 ":rtc_base_tests_main",
1258 ":rtc_base_tests_utils",
1259 ":rtc_task_queue",
Tommi68561562018-02-13 19:47:50 +01001260 ":rtc_task_queue_for_test",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001261 "../test:test_support",
1262 ]
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001263 }
1264
1265 rtc_source_set("sequenced_task_checker_unittests") {
1266 testonly = true
1267
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001268 sources = [
1269 "sequenced_task_checker_unittest.cc",
1270 ]
1271 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001272 ":checks",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001273 ":rtc_base_approved",
1274 ":rtc_base_tests_main",
1275 ":rtc_task_queue",
1276 ":sequenced_task_checker",
1277 "../test:test_support",
1278 ]
1279 }
1280
1281 rtc_source_set("weak_ptr_unittests") {
1282 testonly = true
1283
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001284 sources = [
1285 "weak_ptr_unittest.cc",
1286 ]
1287 deps = [
Tommi897e1362017-12-01 18:56:43 +01001288 ":rtc_base_approved_generic",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001289 ":rtc_base_tests_main",
1290 ":rtc_base_tests_utils",
Tommi8d2c5a82018-03-19 11:12:48 +01001291 ":rtc_event",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001292 ":rtc_task_queue",
1293 ":weak_ptr",
1294 "../test:test_support",
1295 ]
1296 }
1297
1298 rtc_source_set("rtc_numerics_unittests") {
1299 testonly = true
1300
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001301 sources = [
1302 "numerics/exp_filter_unittest.cc",
Ilya Nikolaevskiyb9685752017-11-01 14:01:00 +01001303 "numerics/moving_median_filter_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001304 "numerics/percentile_filter_unittest.cc",
Bjorn Tereliusa194e582017-10-25 13:07:09 +02001305 "numerics/sequence_number_util_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001306 ]
1307 deps = [
1308 ":rtc_base_approved",
1309 ":rtc_base_tests_main",
1310 ":rtc_numerics",
1311 "../test:test_support",
1312 ]
1313 }
1314
1315 config("rtc_base_unittests_config") {
1316 if (is_clang) {
1317 cflags = [ "-Wno-unused-const-variable" ]
1318 }
1319 }
1320 rtc_source_set("rtc_base_unittests") {
1321 testonly = true
1322
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001323 sources = [
1324 "callback_unittest.cc",
1325 "crc32_unittest.cc",
Sebastian Janssonf9c5cf62018-02-28 16:04:26 +01001326 "data_rate_limiter_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001327 "helpers_unittest.cc",
1328 "httpbase_unittest.cc",
1329 "httpcommon_unittest.cc",
1330 "httpserver_unittest.cc",
1331 "ipaddress_unittest.cc",
1332 "memory_usage_unittest.cc",
1333 "messagedigest_unittest.cc",
1334 "messagequeue_unittest.cc",
1335 "nat_unittest.cc",
1336 "network_unittest.cc",
1337 "optionsfile_unittest.cc",
1338 "proxy_unittest.cc",
1339 "ptr_util_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001340 "rollingaccumulator_unittest.cc",
1341 "rtccertificate_unittest.cc",
1342 "rtccertificategenerator_unittest.cc",
deadbeef8290ddf2017-07-11 16:56:05 -07001343 "signalthread_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001344 "sigslot_unittest.cc",
1345 "sigslottester_unittest.cc",
1346 "stream_unittest.cc",
1347 "testclient_unittest.cc",
1348 "thread_unittest.cc",
1349 ]
1350 if (is_win) {
1351 sources += [
1352 "win32_unittest.cc",
1353 "win32window_unittest.cc",
1354 ]
1355 }
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001356 if (is_posix) {
1357 sources += [
Diogo Real1dca9d52017-08-29 12:18:32 -07001358 "openssladapter_unittest.cc",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001359 "ssladapter_unittest.cc",
1360 "sslidentity_unittest.cc",
1361 "sslstreamadapter_unittest.cc",
1362 ]
1363 }
1364 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001365 ":checks",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001366 ":rtc_base_tests_main",
1367 ":rtc_base_tests_utils",
Patrik Höglund3e113432017-12-15 14:40:10 +01001368 ":stringutils",
Joachim Bauch58daf402017-12-21 22:00:34 +01001369 "../api:array_view",
kwiberg84f6a3f2017-09-05 08:43:13 -07001370 "../api:optional",
Patrik Höglund7696bef2018-03-15 15:05:39 +01001371 "../test:fileutils",
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001372 "../test:test_support",
1373 ]
1374 public_deps = [
1375 ":rtc_base",
1376 ]
1377 configs += [ ":rtc_base_unittests_config" ]
Diogo Real1dca9d52017-08-29 12:18:32 -07001378 if (build_with_chromium) {
1379 include_dirs = [ "../../boringssl/src/include" ]
1380 }
1381 if (rtc_build_ssl) {
1382 deps += [ "//third_party/boringssl" ]
1383 } else {
1384 configs += [ ":external_ssl_library" ]
1385 }
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001386 }
1387}
1388
Henrik Kjellander73e21802017-06-20 08:38:58 +02001389if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001390 rtc_android_library("base_java") {
Henrik Kjellanderc0362762017-06-29 08:03:04 +02001391 java_files = [
1392 "java/src/org/webrtc/ContextUtils.java",
1393 "java/src/org/webrtc/Logging.java",
1394 "java/src/org/webrtc/Size.java",
1395 "java/src/org/webrtc/ThreadUtils.java",
1396 ]
Henrik Kjellander73e21802017-06-20 08:38:58 +02001397 }
1398}