xref: /aosp_15_r20/external/webrtc/rtc_base/BUILD.gn (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
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
9import("//third_party/google_benchmark/buildconfig.gni")
10import("../webrtc.gni")
11
12if (is_android) {
13  import("//build/config/android/config.gni")
14  import("//build/config/android/rules.gni")
15}
16
17if (!rtc_build_ssl) {
18  config("external_ssl_library") {
19    assert(rtc_ssl_root != "",
20           "You must specify rtc_ssl_root when rtc_build_ssl==0.")
21    include_dirs = [ rtc_ssl_root ]
22  }
23}
24
25rtc_source_set("protobuf_utils") {
26  sources = [ "protobuf_utils.h" ]
27  if (rtc_enable_protobuf) {
28    public_configs = [ "//third_party/protobuf:protobuf_config" ]
29    deps = [ "//third_party/protobuf:protobuf_lite" ]
30  }
31}
32
33rtc_source_set("bitstream_reader") {
34  sources = [
35    "bitstream_reader.cc",
36    "bitstream_reader.h",
37  ]
38  deps = [
39    ":checks",
40    ":safe_conversions",
41    "../api:array_view",
42  ]
43  absl_deps = [
44    "//third_party/abseil-cpp/absl/base:core_headers",
45    "//third_party/abseil-cpp/absl/numeric:bits",
46    "//third_party/abseil-cpp/absl/strings",
47  ]
48}
49
50rtc_source_set("compile_assert_c") {
51  sources = [ "compile_assert_c.h" ]
52}
53
54rtc_source_set("ignore_wundef") {
55  sources = [ "ignore_wundef.h" ]
56}
57
58rtc_source_set("untyped_function") {
59  sources = [ "untyped_function.h" ]
60  deps = [ "system:assume" ]
61}
62
63rtc_source_set("callback_list") {
64  sources = [
65    "callback_list.cc",
66    "callback_list.h",
67  ]
68  deps = [
69    ":checks",
70    ":untyped_function",
71    "../api:function_view",
72    "system:assume",
73    "system:inline",
74    "system:rtc_export",
75  ]
76}
77
78rtc_source_set("buffer") {
79  visibility = [ "*" ]
80  sources = [ "buffer.h" ]
81  deps = [
82    ":checks",
83    ":type_traits",
84    ":zero_memory",
85    "../api:array_view",
86  ]
87  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
88}
89
90rtc_source_set("byte_order") {
91  visibility = [ "*" ]
92  sources = [ "byte_order.h" ]
93  deps = [ "system:arch" ]
94}
95
96rtc_source_set("mod_ops") {
97  visibility = [ "*" ]
98  sources = [ "numerics/mod_ops.h" ]
99  deps = [ ":checks" ]
100}
101
102rtc_source_set("moving_max_counter") {
103  visibility = [ "*" ]
104  sources = [ "numerics/moving_max_counter.h" ]
105  deps = [ ":checks" ]
106  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
107}
108
109rtc_source_set("one_time_event") {
110  visibility = [ "*" ]
111  sources = [ "one_time_event.h" ]
112  deps = [ "synchronization:mutex" ]
113}
114
115rtc_source_set("strong_alias") {
116  visibility = [ "*" ]
117  sources = [ "strong_alias.h" ]
118}
119
120rtc_source_set("swap_queue") {
121  visibility = [ "*" ]
122  sources = [ "swap_queue.h" ]
123  deps = [ ":checks" ]
124  absl_deps = [ "//third_party/abseil-cpp/absl/base:core_headers" ]
125}
126
127rtc_source_set("macromagic") {
128  sources = [
129    "arraysize.h",
130    "thread_annotations.h",
131  ]
132  deps = [ "system:arch" ]
133}
134
135rtc_library("bit_buffer") {
136  visibility = [ "*" ]
137  sources = [
138    "bit_buffer.cc",
139    "bit_buffer.h",
140  ]
141  deps = [ ":checks" ]
142  absl_deps = [ "//third_party/abseil-cpp/absl/numeric:bits" ]
143}
144
145rtc_library("byte_buffer") {
146  visibility = [ "*" ]
147  sources = [
148    "byte_buffer.cc",
149    "byte_buffer.h",
150  ]
151  deps = [
152    ":buffer",
153    ":byte_order",
154  ]
155  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
156}
157
158rtc_library("buffer_queue") {
159  visibility = [ "*" ]
160  sources = [
161    "buffer_queue.cc",
162    "buffer_queue.h",
163  ]
164  deps = [
165    ":buffer",
166    ":macromagic",
167    "../api:sequence_checker",
168    "system:no_unique_address",
169  ]
170}
171
172rtc_library("copy_on_write_buffer") {
173  visibility = [ "*" ]
174  sources = [
175    "copy_on_write_buffer.cc",
176    "copy_on_write_buffer.h",
177  ]
178  deps = [
179    ":buffer",
180    ":checks",
181    ":refcount",
182    ":type_traits",
183    "../api:scoped_refptr",
184    "system:rtc_export",
185  ]
186  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
187}
188
189rtc_library("event_tracer") {
190  visibility = [ "*" ]
191  sources = [
192    "event_tracer.cc",
193    "event_tracer.h",
194    "trace_event.h",
195  ]
196  deps = [
197    ":checks",
198    ":logging",
199    ":macromagic",
200    ":platform_thread",
201    ":platform_thread_types",
202    ":rtc_event",
203    ":timeutils",
204    "../api:sequence_checker",
205    "synchronization:mutex",
206    "system:rtc_export",
207  ]
208  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
209}
210
211rtc_library("histogram_percentile_counter") {
212  visibility = [ "*" ]
213  sources = [
214    "numerics/histogram_percentile_counter.cc",
215    "numerics/histogram_percentile_counter.h",
216  ]
217  deps = [ ":checks" ]
218  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
219}
220
221rtc_library("race_checker") {
222  visibility = [ "*" ]
223  sources = [
224    "race_checker.cc",
225    "race_checker.h",
226  ]
227  deps = [
228    ":checks",
229    ":macromagic",
230    ":platform_thread_types",
231  ]
232}
233
234rtc_library("random") {
235  visibility = [ "*" ]
236  sources = [
237    "random.cc",
238    "random.h",
239  ]
240  deps = [
241    ":checks",
242    ":safe_conversions",
243  ]
244}
245
246rtc_library("rate_statistics") {
247  visibility = [ "*" ]
248  sources = [
249    "rate_statistics.cc",
250    "rate_statistics.h",
251  ]
252  deps = [
253    ":checks",
254    ":logging",
255    ":safe_conversions",
256    "system:rtc_export",
257  ]
258  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
259}
260
261rtc_library("rate_tracker") {
262  visibility = [ "*" ]
263  sources = [
264    "rate_tracker.cc",
265    "rate_tracker.h",
266  ]
267  deps = [
268    ":checks",
269    ":timeutils",
270  ]
271}
272
273rtc_library("sample_counter") {
274  visibility = [ "*" ]
275  sources = [
276    "numerics/sample_counter.cc",
277    "numerics/sample_counter.h",
278  ]
279  deps = [
280    ":checks",
281    ":safe_conversions",
282  ]
283  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
284}
285
286rtc_library("timestamp_aligner") {
287  visibility = [ "*" ]
288  sources = [
289    "timestamp_aligner.cc",
290    "timestamp_aligner.h",
291  ]
292  deps = [
293    ":checks",
294    ":logging",
295    ":timeutils",
296    "system:rtc_export",
297  ]
298}
299
300rtc_library("zero_memory") {
301  visibility = [ "*" ]
302  sources = [
303    "zero_memory.cc",
304    "zero_memory.h",
305  ]
306  deps = [
307    ":checks",
308    "../api:array_view",
309  ]
310}
311
312rtc_library("platform_thread_types") {
313  sources = [
314    "platform_thread_types.cc",
315    "platform_thread_types.h",
316  ]
317  deps = [
318    ":checks",
319    ":macromagic",
320  ]
321}
322
323rtc_source_set("refcount") {
324  visibility = [ "*" ]
325  sources = [
326    "ref_count.h",
327    "ref_counted_object.h",
328    "ref_counter.h",
329  ]
330  deps = [
331    ":macromagic",
332    "../api:scoped_refptr",
333  ]
334}
335
336rtc_library("criticalsection") {
337  sources = [
338    "deprecated/recursive_critical_section.cc",
339    "deprecated/recursive_critical_section.h",
340  ]
341  deps = [
342    ":checks",
343    ":macromagic",
344    ":platform_thread_types",
345    "synchronization:yield",
346    "system:unused",
347  ]
348}
349
350rtc_library("platform_thread") {
351  sources = [
352    "platform_thread.cc",
353    "platform_thread.h",
354  ]
355  deps = [
356    ":checks",
357    ":macromagic",
358    ":platform_thread_types",
359    ":rtc_event",
360    ":timeutils",
361    "../api:sequence_checker",
362  ]
363  absl_deps = [
364    "//third_party/abseil-cpp/absl/memory",
365    "//third_party/abseil-cpp/absl/strings",
366    "//third_party/abseil-cpp/absl/types:optional",
367  ]
368}
369
370rtc_library("rtc_event") {
371  if (build_with_chromium) {
372    sources = [
373      "../../webrtc_overrides/rtc_base/event.cc",
374      "../../webrtc_overrides/rtc_base/event.h",
375    ]
376    deps = [
377      ":checks",
378      "../api/units:time_delta",
379      "system:rtc_export",  # Only Chromium's rtc::Event use RTC_EXPORT.
380      "//base",  # Dependency on chromium's waitable_event.
381    ]
382  } else {
383    sources = [
384      "event.cc",
385      "event.h",
386    ]
387    deps = [
388      ":checks",
389      ":timeutils",
390      "../api/units:time_delta",
391      "synchronization:yield_policy",
392      "system:warn_current_thread_is_deadlocked",
393    ]
394    absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
395  }
396}
397
398config("chromium_logging_config") {
399  defines = [ "LOGGING_INSIDE_WEBRTC" ]
400}
401
402rtc_library("logging") {
403  visibility = [ "*" ]
404  libs = []
405  deps = [
406    ":checks",
407    ":macromagic",
408    ":platform_thread_types",
409    ":stringutils",
410    ":timeutils",
411    "../api/units:timestamp",
412    "synchronization:mutex",
413  ]
414  absl_deps = [
415    "//third_party/abseil-cpp/absl/base:core_headers",
416    "//third_party/abseil-cpp/absl/meta:type_traits",
417    "//third_party/abseil-cpp/absl/strings",
418    "//third_party/abseil-cpp/absl/types:optional",
419  ]
420
421  if (build_with_chromium) {
422    # Dependency on chromium's logging (in //base).
423    deps += [ "//base" ]
424    sources = [
425      "../../webrtc_overrides/rtc_base/logging.cc",
426      "../../webrtc_overrides/rtc_base/logging.h",
427    ]
428
429    # This macro needs to be both present in all WebRTC targets (see its
430    # definition in //BUILD.gn but also propagated to all the targets
431    # depending on the Chromium component defined in
432    # //third_party/webrtc_overrides:webrtc_component. This public_config
433    # allows GN to propagate the macro accordingly.
434    public_configs = [ ":chromium_logging_config" ]
435  } else {
436    sources = [
437      "logging.cc",
438      "logging.h",
439    ]
440    deps += [ "system:inline" ]
441
442    if (is_mac) {
443      frameworks = [ "Foundation.framework" ]
444    }
445
446    if (is_android) {
447      libs += [ "log" ]
448    }
449  }
450}
451
452rtc_library("checks") {
453  # TODO(bugs.webrtc.org/9607): This should not be public.
454  visibility = [ "*" ]
455  libs = []
456  sources = [
457    "checks.cc",
458    "checks.h",
459  ]
460  deps = [
461    ":safe_compare",
462    "../api:scoped_refptr",
463    "system:inline",
464    "system:rtc_export",
465  ]
466  if (build_with_chromium) {
467    sources += [ "../../webrtc_overrides/rtc_base/checks_overrides.cc" ]
468    deps += [ "//base" ]
469  }
470  absl_deps = [
471    "//third_party/abseil-cpp/absl/meta:type_traits",
472    "//third_party/abseil-cpp/absl/strings",
473  ]
474  if (is_android) {
475    libs += [ "log" ]
476  }
477}
478
479rtc_library("rate_limiter") {
480  sources = [
481    "rate_limiter.cc",
482    "rate_limiter.h",
483  ]
484  deps = [
485    ":macromagic",
486    ":rate_statistics",
487    "../system_wrappers",
488    "synchronization:mutex",
489  ]
490  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
491}
492
493rtc_source_set("sanitizer") {
494  sources = [ "sanitizer.h" ]
495  absl_deps = [ "//third_party/abseil-cpp/absl/meta:type_traits" ]
496}
497
498rtc_source_set("bounded_inline_vector") {
499  public = [ "bounded_inline_vector.h" ]
500  sources = [ "bounded_inline_vector_impl.h" ]
501  deps = [ ":checks" ]
502}
503
504rtc_source_set("divide_round") {
505  sources = [ "numerics/divide_round.h" ]
506  deps = [
507    ":checks",
508    ":safe_compare",
509  ]
510}
511
512rtc_source_set("safe_compare") {
513  sources = [ "numerics/safe_compare.h" ]
514  deps = [ ":type_traits" ]
515}
516
517rtc_source_set("safe_minmax") {
518  sources = [ "numerics/safe_minmax.h" ]
519  deps = [
520    ":checks",
521    ":safe_compare",
522    ":type_traits",
523  ]
524}
525
526rtc_source_set("safe_conversions") {
527  sources = [
528    "numerics/safe_conversions.h",
529    "numerics/safe_conversions_impl.h",
530  ]
531  deps = [ ":checks" ]
532}
533
534rtc_library("timeutils") {
535  visibility = [ "*" ]
536  sources = [
537    "system_time.cc",
538    "system_time.h",
539    "time_utils.cc",
540    "time_utils.h",
541  ]
542  deps = [
543    ":checks",
544    ":safe_conversions",
545    ":stringutils",
546    "system:rtc_export",
547  ]
548  if (rtc_exclude_system_time) {
549    defines = [ "WEBRTC_EXCLUDE_SYSTEM_TIME" ]
550  }
551
552  libs = []
553  if (is_win) {
554    libs += [ "winmm.lib" ]
555  }
556}
557
558rtc_library("stringutils") {
559  sources = [
560    "string_encode.cc",
561    "string_encode.h",
562    "string_to_number.cc",
563    "string_to_number.h",
564    "string_utils.cc",
565    "string_utils.h",
566    "strings/string_builder.cc",
567    "strings/string_builder.h",
568    "strings/string_format.cc",
569    "strings/string_format.h",
570  ]
571  deps = [
572    ":checks",
573    ":macromagic",
574    ":safe_minmax",
575    "../api:array_view",
576  ]
577  absl_deps = [
578    "//third_party/abseil-cpp/absl/strings",
579    "//third_party/abseil-cpp/absl/types:optional",
580  ]
581}
582
583rtc_library("audio_format_to_string") {
584  sources = [
585    "strings/audio_format_to_string.cc",
586    "strings/audio_format_to_string.h",
587  ]
588  deps = [
589    ":stringutils",
590    "../api/audio_codecs:audio_codecs_api",
591  ]
592}
593
594rtc_source_set("type_traits") {
595  sources = [ "type_traits.h" ]
596}
597
598rtc_library("rtc_task_queue") {
599  visibility = [ "*" ]
600  sources = [
601    "task_queue.cc",
602    "task_queue.h",
603  ]
604  deps = [
605    ":macromagic",
606    "../api/task_queue",
607    "system:rtc_export",
608  ]
609  absl_deps = [
610    "//third_party/abseil-cpp/absl/functional:any_invocable",
611    "//third_party/abseil-cpp/absl/memory",
612  ]
613}
614
615rtc_source_set("rtc_operations_chain") {
616  visibility = [ "*" ]
617  sources = [
618    "operations_chain.cc",
619    "operations_chain.h",
620  ]
621  deps = [
622    ":checks",
623    ":macromagic",
624    ":refcount",
625    "../api:make_ref_counted",
626    "../api:refcountedbase",
627    "../api:scoped_refptr",
628    "../api:sequence_checker",
629    "system:no_unique_address",
630  ]
631  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
632}
633
634if (rtc_enable_libevent) {
635  rtc_library("rtc_task_queue_libevent") {
636    visibility = [ "../api/task_queue:default_task_queue_factory" ]
637    sources = [
638      "task_queue_libevent.cc",
639      "task_queue_libevent.h",
640    ]
641    deps = [
642      ":checks",
643      ":logging",
644      ":macromagic",
645      ":platform_thread",
646      ":platform_thread_types",
647      ":safe_conversions",
648      ":timeutils",
649      "../api/task_queue",
650      "../api/units:time_delta",
651      "synchronization:mutex",
652    ]
653    absl_deps = [
654      "//third_party/abseil-cpp/absl/container:inlined_vector",
655      "//third_party/abseil-cpp/absl/functional:any_invocable",
656      "//third_party/abseil-cpp/absl/strings",
657    ]
658    if (rtc_build_libevent) {
659      deps += [ "//third_party/libevent" ]
660    }
661  }
662}
663
664if (is_mac || is_ios) {
665  rtc_library("rtc_task_queue_gcd") {
666    visibility = [ "../api/task_queue:default_task_queue_factory" ]
667    sources = [
668      "task_queue_gcd.cc",
669      "task_queue_gcd.h",
670    ]
671    deps = [
672      ":checks",
673      ":logging",
674      "../api/task_queue",
675      "../api/units:time_delta",
676      "synchronization:mutex",
677      "system:gcd_helpers",
678    ]
679    absl_deps = [
680      "//third_party/abseil-cpp/absl/functional:any_invocable",
681      "//third_party/abseil-cpp/absl/strings",
682    ]
683  }
684}
685
686if (is_win) {
687  rtc_library("rtc_task_queue_win") {
688    visibility = [ "../api/task_queue:default_task_queue_factory" ]
689    sources = [
690      "task_queue_win.cc",
691      "task_queue_win.h",
692    ]
693    deps = [
694      ":checks",
695      ":logging",
696      ":macromagic",
697      ":platform_thread",
698      ":rtc_event",
699      ":safe_conversions",
700      ":timeutils",
701      "../api/task_queue",
702      "../api/units:time_delta",
703      "../api/units:timestamp",
704      "synchronization:mutex",
705    ]
706    absl_deps = [
707      "//third_party/abseil-cpp/absl/functional:any_invocable",
708      "//third_party/abseil-cpp/absl/strings",
709      "//third_party/abseil-cpp/absl/types:optional",
710    ]
711  }
712}
713
714rtc_library("rtc_task_queue_stdlib") {
715  sources = [
716    "task_queue_stdlib.cc",
717    "task_queue_stdlib.h",
718  ]
719  deps = [
720    ":checks",
721    ":divide_round",
722    ":logging",
723    ":macromagic",
724    ":platform_thread",
725    ":rtc_event",
726    ":safe_conversions",
727    ":timeutils",
728    "../api/task_queue",
729    "../api/units:time_delta",
730    "synchronization:mutex",
731  ]
732  absl_deps = [
733    "//third_party/abseil-cpp/absl/functional:any_invocable",
734    "//third_party/abseil-cpp/absl/strings",
735  ]
736}
737
738rtc_library("weak_ptr") {
739  sources = [
740    "weak_ptr.cc",
741    "weak_ptr.h",
742  ]
743  deps = [
744    ":refcount",
745    "../api:scoped_refptr",
746    "../api:sequence_checker",
747    "system:no_unique_address",
748  ]
749}
750
751rtc_library("rtc_numerics") {
752  sources = [
753    "numerics/event_based_exponential_moving_average.cc",
754    "numerics/event_based_exponential_moving_average.h",
755    "numerics/exp_filter.cc",
756    "numerics/exp_filter.h",
757    "numerics/math_utils.h",
758    "numerics/moving_average.cc",
759    "numerics/moving_average.h",
760    "numerics/moving_percentile_filter.h",
761    "numerics/percentile_filter.h",
762    "numerics/running_statistics.h",
763    "numerics/sequence_number_util.h",
764  ]
765  deps = [
766    ":checks",
767    ":mod_ops",
768  ]
769  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
770}
771
772rtc_library("rtc_stats_counters") {
773  sources = [
774    "numerics/event_rate_counter.cc",
775    "numerics/event_rate_counter.h",
776    "numerics/sample_stats.cc",
777    "numerics/sample_stats.h",
778  ]
779  deps = [
780    "../api/numerics",
781    "../api/units:data_rate",
782    "../api/units:time_delta",
783    "../api/units:timestamp",
784  ]
785  absl_deps = []
786}
787
788config("rtc_json_suppressions") {
789  if (!is_win || is_clang) {
790    cflags_cc = [
791      # TODO(bugs.webrtc.org/10814): Remove -Wno-undef as soon as it get
792      # removed upstream.
793      "-Wno-undef",
794    ]
795  }
796}
797
798rtc_library("rtc_json") {
799  public_configs = [ ":rtc_json_suppressions" ]
800  poisonous = [ "rtc_json" ]
801  defines = []
802  sources = [
803    "strings/json.cc",
804    "strings/json.h",
805  ]
806  deps = [ ":stringutils" ]
807  all_dependent_configs = [ "//third_party/jsoncpp:jsoncpp_config" ]
808  if (rtc_build_json) {
809    deps += [ "//third_party/jsoncpp" ]
810  } else {
811    include_dirs = [ "$rtc_jsoncpp_root" ]
812
813    # When defined changes the include path for json.h to where it is
814    # expected to be when building json outside of the standalone build.
815    defines += [ "WEBRTC_EXTERNAL_JSON" ]
816  }
817  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
818}
819
820rtc_library("net_helpers") {
821  sources = [
822    "net_helpers.cc",
823    "net_helpers.h",
824  ]
825  deps = []
826  if (is_android) {
827    deps += [ ":ifaddrs_android" ]
828  }
829  if (is_win) {
830    deps += [
831      ":win32",
832      "win:windows_version",
833    ]
834  }
835  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
836}
837
838rtc_library("async_resolver_interface") {
839  visibility = [ "*" ]
840  sources = [
841    "async_resolver_interface.cc",
842    "async_resolver_interface.h",
843  ]
844  deps = [
845    ":checks",
846    ":socket_address",
847    "system:rtc_export",
848    "third_party/sigslot",
849  ]
850}
851
852rtc_library("ip_address") {
853  visibility = [ "*" ]
854  sources = [
855    "ip_address.cc",
856    "ip_address.h",
857  ]
858  deps = [
859    ":byte_order",
860    ":net_helpers",
861    ":stringutils",
862    "system:rtc_export",
863  ]
864  if (is_win) {
865    deps += [ ":win32" ]
866  }
867  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
868}
869
870rtc_library("socket_address") {
871  visibility = [ "*" ]
872  sources = [
873    "socket_address.cc",
874    "socket_address.h",
875  ]
876  deps = [
877    ":byte_order",
878    ":checks",
879    ":ip_address",
880    ":logging",
881    ":net_helpers",
882    ":safe_conversions",
883    ":stringutils",
884    "system:rtc_export",
885  ]
886  if (is_win) {
887    deps += [ ":win32" ]
888  }
889  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
890}
891
892rtc_library("null_socket_server") {
893  sources = [
894    "null_socket_server.cc",
895    "null_socket_server.h",
896  ]
897  deps = [
898    ":checks",
899    ":rtc_event",
900    ":socket",
901    ":socket_server",
902    "../api/units:time_delta",
903    "system:rtc_export",
904  ]
905}
906
907rtc_source_set("socket_server") {
908  sources = [ "socket_server.h" ]
909  deps = [
910    ":rtc_event",
911    ":socket_factory",
912    "../api/units:time_delta",
913  ]
914}
915
916rtc_library("threading") {
917  visibility = [ "*" ]
918
919  sources = [
920    "async_resolver.cc",
921    "async_resolver.h",
922    "internal/default_socket_server.cc",
923    "internal/default_socket_server.h",
924    "network_monitor.cc",
925    "network_monitor.h",
926    "network_monitor_factory.cc",
927    "network_monitor_factory.h",
928    "physical_socket_server.cc",
929    "physical_socket_server.h",
930    "thread.cc",
931    "thread.h",
932  ]
933  absl_deps = [
934    "//third_party/abseil-cpp/absl/algorithm:container",
935    "//third_party/abseil-cpp/absl/base:core_headers",
936    "//third_party/abseil-cpp/absl/cleanup",
937    "//third_party/abseil-cpp/absl/functional:any_invocable",
938    "//third_party/abseil-cpp/absl/memory",
939    "//third_party/abseil-cpp/absl/strings",
940  ]
941  deps = [
942    ":async_resolver_interface",
943    ":byte_order",
944    ":checks",
945    ":criticalsection",
946    ":event_tracer",
947    ":ip_address",
948    ":logging",
949    ":macromagic",
950    ":network_constants",
951    ":null_socket_server",
952    ":platform_thread",
953    ":platform_thread_types",
954    ":refcount",
955    ":rtc_event",
956    ":rtc_task_queue",
957    ":socket_address",
958    ":socket_server",
959    ":timeutils",
960    "../api:function_view",
961    "../api:refcountedbase",
962    "../api:scoped_refptr",
963    "../api:sequence_checker",
964    "../api/task_queue",
965    "../api/task_queue:pending_task_safety_flag",
966    "../api/units:time_delta",
967    "../system_wrappers:field_trial",
968    "synchronization:mutex",
969    "system:no_unique_address",
970    "system:rtc_export",
971    "third_party/sigslot",
972  ]
973  if (is_android) {
974    deps += [ ":ifaddrs_android" ]
975  }
976  if (is_win) {
977    deps += [ ":win32" ]
978  }
979  if (is_mac || is_ios) {
980    deps += [ "system:cocoa_threading" ]
981  }
982}
983
984rtc_source_set("socket_factory") {
985  sources = [ "socket_factory.h" ]
986  deps = [ ":socket" ]
987}
988
989rtc_library("async_socket") {
990  sources = [
991    "async_socket.cc",
992    "async_socket.h",
993  ]
994  deps = [
995    ":checks",
996    ":socket",
997    ":socket_address",
998    "third_party/sigslot",
999  ]
1000  absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
1001}
1002
1003rtc_library("socket") {
1004  sources = [
1005    "socket.cc",
1006    "socket.h",
1007  ]
1008  deps = [
1009    ":macromagic",
1010    ":socket_address",
1011    "third_party/sigslot",
1012  ]
1013  if (is_win) {
1014    deps += [ ":win32" ]
1015  }
1016}
1017
1018rtc_source_set("network_constants") {
1019  sources = [
1020    "network_constants.cc",
1021    "network_constants.h",
1022  ]
1023  deps = [ ":checks" ]
1024}
1025
1026if (is_android) {
1027  rtc_library("ifaddrs_android") {
1028    sources = [
1029      "ifaddrs_android.cc",
1030      "ifaddrs_android.h",
1031    ]
1032    libs = [
1033      "log",
1034      "GLESv2",
1035    ]
1036    absl_deps = [ "//third_party/abseil-cpp/absl/cleanup" ]
1037  }
1038}
1039
1040if (is_win) {
1041  rtc_library("win32") {
1042    sources = [
1043      "win32.cc",
1044      "win32.h",
1045      "win32_window.cc",
1046      "win32_window.h",
1047    ]
1048
1049    deps = [
1050      ":byte_order",
1051      ":checks",
1052      ":logging",
1053      ":macromagic",
1054      ":stringutils",
1055    ]
1056
1057    libs = [
1058      "crypt32.lib",
1059      "iphlpapi.lib",
1060      "secur32.lib",
1061    ]
1062
1063    defines = [ "_CRT_NONSTDC_NO_DEPRECATE" ]
1064  }
1065}
1066
1067rtc_library("rtc_base") {
1068  visibility = [ "*" ]
1069  cflags = []
1070  cflags_cc = []
1071  libs = []
1072  defines = []
1073  deps = [
1074    ":async_resolver_interface",
1075    ":async_socket",
1076    ":buffer",
1077    ":byte_buffer",
1078    ":byte_order",
1079    ":callback_list",
1080    ":checks",
1081    ":copy_on_write_buffer",
1082    ":ip_address",
1083    ":logging",
1084    ":macromagic",
1085    ":network_constants",
1086    ":null_socket_server",
1087    ":refcount",
1088    ":rtc_event",
1089    ":rtc_task_queue",
1090    ":safe_conversions",
1091    ":socket",
1092    ":socket_address",
1093    ":socket_factory",
1094    ":socket_server",
1095    ":stringutils",
1096    ":threading",
1097    ":timeutils",
1098    ":zero_memory",
1099    "../api:array_view",
1100    "../api:field_trials_view",
1101    "../api:function_view",
1102    "../api:make_ref_counted",
1103    "../api:refcountedbase",
1104    "../api:scoped_refptr",
1105    "../api:sequence_checker",
1106    "../api/numerics",
1107    "../api/task_queue",
1108    "../api/task_queue:pending_task_safety_flag",
1109    "../api/transport:field_trial_based_config",
1110    "../api/units:time_delta",
1111    "../rtc_base/experiments:field_trial_parser",
1112    "../system_wrappers:field_trial",
1113    "memory:always_valid_pointer",
1114    "network:sent_packet",
1115    "synchronization:mutex",
1116    "system:file_wrapper",
1117    "system:inline",
1118    "system:no_unique_address",
1119    "system:rtc_export",
1120    "task_utils:repeating_task",
1121    "third_party/base64",
1122    "third_party/sigslot",
1123  ]
1124  absl_deps = [
1125    "//third_party/abseil-cpp/absl/algorithm:container",
1126    "//third_party/abseil-cpp/absl/base:core_headers",
1127    "//third_party/abseil-cpp/absl/container:flat_hash_map",
1128    "//third_party/abseil-cpp/absl/functional:any_invocable",
1129    "//third_party/abseil-cpp/absl/memory",
1130    "//third_party/abseil-cpp/absl/strings",
1131    "//third_party/abseil-cpp/absl/types:optional",
1132  ]
1133  public_configs = []
1134
1135  sources = [
1136    "async_packet_socket.cc",
1137    "async_packet_socket.h",
1138    "async_tcp_socket.cc",
1139    "async_tcp_socket.h",
1140    "async_udp_socket.cc",
1141    "async_udp_socket.h",
1142    "crc32.cc",
1143    "crc32.h",
1144    "crypt_string.cc",
1145    "crypt_string.h",
1146    "data_rate_limiter.cc",
1147    "data_rate_limiter.h",
1148    "dscp.h",
1149    "file_rotating_stream.cc",
1150    "file_rotating_stream.h",
1151    "helpers.cc",
1152    "helpers.h",
1153    "http_common.cc",
1154    "http_common.h",
1155    "mdns_responder_interface.h",
1156    "message_digest.cc",
1157    "message_digest.h",
1158    "net_helper.cc",
1159    "net_helper.h",
1160    "network.cc",
1161    "network.h",
1162    "network_route.cc",
1163    "network_route.h",
1164    "openssl.h",
1165    "openssl_adapter.cc",
1166    "openssl_adapter.h",
1167    "openssl_digest.cc",
1168    "openssl_digest.h",
1169    "openssl_key_pair.cc",
1170    "openssl_key_pair.h",
1171    "openssl_session_cache.cc",
1172    "openssl_session_cache.h",
1173    "openssl_stream_adapter.cc",
1174    "openssl_stream_adapter.h",
1175    "openssl_utility.cc",
1176    "openssl_utility.h",
1177    "proxy_info.cc",
1178    "proxy_info.h",
1179    "rtc_certificate.cc",
1180    "rtc_certificate.h",
1181    "rtc_certificate_generator.cc",
1182    "rtc_certificate_generator.h",
1183    "socket_adapters.cc",
1184    "socket_adapters.h",
1185    "socket_address_pair.cc",
1186    "socket_address_pair.h",
1187    "ssl_adapter.cc",
1188    "ssl_adapter.h",
1189    "ssl_certificate.cc",
1190    "ssl_certificate.h",
1191    "ssl_fingerprint.cc",
1192    "ssl_fingerprint.h",
1193    "ssl_identity.cc",
1194    "ssl_identity.h",
1195    "ssl_stream_adapter.cc",
1196    "ssl_stream_adapter.h",
1197    "stream.cc",
1198    "stream.h",
1199    "unique_id_generator.cc",
1200    "unique_id_generator.h",
1201  ]
1202
1203  # If we are building the SSL library ourselves, we know it's BoringSSL.
1204  if (rtc_build_ssl) {
1205    sources += [
1206      "boringssl_certificate.cc",
1207      "boringssl_certificate.h",
1208      "boringssl_identity.cc",
1209      "boringssl_identity.h",
1210    ]
1211  } else {
1212    sources += [
1213      "openssl_certificate.cc",
1214      "openssl_certificate.h",
1215      "openssl_identity.cc",
1216      "openssl_identity.h",
1217    ]
1218  }
1219
1220  if (build_with_chromium) {
1221    include_dirs = [ "../../boringssl/src/include" ]
1222  } else {
1223    sources += [
1224      "log_sinks.cc",
1225      "log_sinks.h",
1226      "rolling_accumulator.h",
1227      "ssl_roots.h",
1228    ]
1229
1230    deps += [ ":rtc_numerics" ]
1231
1232    if (is_win) {
1233      sources += [ "win32_socket_init.h" ]
1234    }
1235  }  # !build_with_chromium
1236
1237  if (rtc_build_ssl) {
1238    deps += [ "//third_party/boringssl" ]
1239  } else {
1240    configs += [ ":external_ssl_library" ]
1241  }
1242
1243  if (is_android) {
1244    deps += [ ":ifaddrs_android" ]
1245  }
1246
1247  if (is_ios || is_mac) {
1248    sources += [ "mac_ifaddrs_converter.cc" ]
1249  }
1250
1251  if (is_linux || is_chromeos) {
1252    libs += [
1253      "dl",
1254      "rt",
1255    ]
1256  }
1257
1258  if (is_ios) {
1259    frameworks = [
1260      "CFNetwork.framework",
1261      "Foundation.framework",
1262      "Security.framework",
1263      "SystemConfiguration.framework",
1264      "UIKit.framework",
1265    ]
1266  }
1267
1268  if (is_win) {
1269    deps += [ ":win32" ]
1270  }
1271
1272  if (is_posix || is_fuchsia) {
1273    sources += [
1274      "ifaddrs_converter.cc",
1275      "ifaddrs_converter.h",
1276    ]
1277  }
1278
1279  if (is_nacl) {
1280    public_deps +=  # no-presubmit-check TODO(webrtc:8603)
1281        [ "//native_client_sdk/src/libraries/nacl_io" ]
1282
1283    defines += [ "timezone=_timezone" ]
1284    sources -= [ "ifaddrs_converter.cc" ]
1285  }
1286}
1287
1288rtc_source_set("gtest_prod") {
1289  sources = [ "gtest_prod_util.h" ]
1290}
1291
1292rtc_library("gunit_helpers") {
1293  testonly = true
1294  sources = [
1295    "gunit.cc",
1296    "gunit.h",
1297  ]
1298  deps = [
1299    ":logging",
1300    ":rtc_base",
1301    ":rtc_base_tests_utils",
1302    ":stringutils",
1303    ":threading",
1304    "../test:test_support",
1305  ]
1306  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
1307}
1308
1309rtc_library("testclient") {
1310  testonly = true
1311  sources = [
1312    "test_client.cc",
1313    "test_client.h",
1314  ]
1315  deps = [
1316    ":gunit_helpers",
1317    ":rtc_base",
1318    ":rtc_base_tests_utils",
1319    ":threading",
1320    ":timeutils",
1321    "synchronization:mutex",
1322  ]
1323}
1324
1325rtc_library("callback_list_unittests") {
1326  testonly = true
1327
1328  sources = [ "callback_list_unittest.cc" ]
1329  deps = [
1330    ":callback_list",
1331    ":gunit_helpers",
1332    ":rtc_base",
1333    "../api:function_view",
1334    "../test:test_support",
1335  ]
1336}
1337
1338rtc_library("rtc_base_tests_utils") {
1339  testonly = true
1340  sources = [
1341    "cpu_time.cc",
1342    "cpu_time.h",
1343    "fake_clock.cc",
1344    "fake_clock.h",
1345    "fake_mdns_responder.h",
1346    "fake_network.h",
1347    "fake_ssl_identity.cc",
1348    "fake_ssl_identity.h",
1349    "firewall_socket_server.cc",
1350    "firewall_socket_server.h",
1351    "memory_stream.cc",
1352    "memory_stream.h",
1353    "memory_usage.cc",
1354    "memory_usage.h",
1355    "nat_server.cc",
1356    "nat_server.h",
1357    "nat_socket_factory.cc",
1358    "nat_socket_factory.h",
1359    "nat_types.cc",
1360    "nat_types.h",
1361    "proxy_server.cc",
1362    "proxy_server.h",
1363    "server_socket_adapters.cc",
1364    "server_socket_adapters.h",
1365    "sigslot_tester.h",
1366    "socket_stream.cc",
1367    "socket_stream.h",
1368    "test_base64.h",
1369    "test_certificate_verifier.h",
1370    "test_echo_server.cc",
1371    "test_echo_server.h",
1372    "test_utils.cc",
1373    "test_utils.h",
1374    "virtual_socket_server.cc",
1375    "virtual_socket_server.h",
1376  ]
1377  deps = [
1378    ":async_socket",
1379    ":byte_buffer",
1380    ":checks",
1381    ":ip_address",
1382    ":logging",
1383    ":macromagic",
1384    ":rtc_base",
1385    ":rtc_event",
1386    ":socket",
1387    ":socket_address",
1388    ":socket_factory",
1389    ":socket_server",
1390    ":stringutils",
1391    ":threading",
1392    ":timeutils",
1393    "../api:make_ref_counted",
1394    "../api:refcountedbase",
1395    "../api:scoped_refptr",
1396    "../api/task_queue",
1397    "../api/units:time_delta",
1398    "../api/units:timestamp",
1399    "../test:scoped_key_value_config",
1400    "memory:always_valid_pointer",
1401    "memory:fifo_buffer",
1402    "synchronization:mutex",
1403    "third_party/sigslot",
1404  ]
1405  absl_deps = [
1406    "//third_party/abseil-cpp/absl/algorithm:container",
1407    "//third_party/abseil-cpp/absl/memory",
1408    "//third_party/abseil-cpp/absl/strings",
1409    "//third_party/abseil-cpp/absl/types:optional",
1410  ]
1411}
1412
1413rtc_library("task_queue_for_test") {
1414  testonly = true
1415
1416  sources = [
1417    "task_queue_for_test.cc",
1418    "task_queue_for_test.h",
1419  ]
1420  deps = [
1421    ":checks",
1422    ":macromagic",
1423    ":rtc_event",
1424    ":rtc_task_queue",
1425    "../api:function_view",
1426    "../api/task_queue",
1427    "../api/task_queue:default_task_queue_factory",
1428  ]
1429  absl_deps = [
1430    "//third_party/abseil-cpp/absl/cleanup",
1431    "//third_party/abseil-cpp/absl/strings",
1432  ]
1433}
1434
1435if (rtc_include_tests) {
1436  rtc_library("sigslot_unittest") {
1437    testonly = true
1438    sources = [ "sigslot_unittest.cc" ]
1439    deps = [
1440      ":gunit_helpers",
1441      ":rtc_base",
1442      ":rtc_base_tests_utils",
1443      "../test:test_support",
1444      "synchronization:mutex",
1445      "third_party/sigslot",
1446    ]
1447  }
1448
1449  rtc_library("untyped_function_unittest") {
1450    testonly = true
1451    sources = [ "untyped_function_unittest.cc" ]
1452    deps = [
1453      ":untyped_function",
1454      "../test:test_support",
1455    ]
1456  }
1457
1458  rtc_library("rtc_operations_chain_unittests") {
1459    testonly = true
1460
1461    sources = [ "operations_chain_unittest.cc" ]
1462    deps = [
1463      ":gunit_helpers",
1464      ":rtc_base",
1465      ":rtc_event",
1466      ":rtc_operations_chain",
1467      ":threading",
1468      "../test:test_support",
1469    ]
1470  }
1471
1472  if (!build_with_chromium) {
1473    rtc_library("rtc_base_nonparallel_tests") {
1474      testonly = true
1475
1476      sources = [
1477        "cpu_time_unittest.cc",
1478        "file_rotating_stream_unittest.cc",
1479        "null_socket_server_unittest.cc",
1480        "physical_socket_server_unittest.cc",
1481        "socket_address_unittest.cc",
1482        "socket_unittest.cc",
1483        "socket_unittest.h",
1484      ]
1485      deps = [
1486        ":buffer",
1487        ":checks",
1488        ":gunit_helpers",
1489        ":ip_address",
1490        ":logging",
1491        ":macromagic",
1492        ":net_helpers",
1493        ":null_socket_server",
1494        ":platform_thread",
1495        ":rtc_base",
1496        ":rtc_base_tests_utils",
1497        ":socket",
1498        ":socket_address",
1499        ":socket_server",
1500        ":testclient",
1501        ":threading",
1502        ":timeutils",
1503        "../api/units:time_delta",
1504        "../system_wrappers",
1505        "../test:field_trial",
1506        "../test:fileutils",
1507        "../test:test_main",
1508        "../test:test_support",
1509        "third_party/sigslot",
1510        "//testing/gtest",
1511      ]
1512      absl_deps = [
1513        "//third_party/abseil-cpp/absl/memory",
1514        "//third_party/abseil-cpp/absl/strings",
1515      ]
1516    }
1517
1518    rtc_library("rtc_base_approved_unittests") {
1519      testonly = true
1520      sources = [
1521        "base64_unittest.cc",
1522        "bit_buffer_unittest.cc",
1523        "bitstream_reader_unittest.cc",
1524        "bounded_inline_vector_unittest.cc",
1525        "buffer_queue_unittest.cc",
1526        "buffer_unittest.cc",
1527        "byte_buffer_unittest.cc",
1528        "byte_order_unittest.cc",
1529        "checks_unittest.cc",
1530        "copy_on_write_buffer_unittest.cc",
1531        "deprecated/recursive_critical_section_unittest.cc",
1532        "event_tracer_unittest.cc",
1533        "event_unittest.cc",
1534        "logging_unittest.cc",
1535        "numerics/divide_round_unittest.cc",
1536        "numerics/histogram_percentile_counter_unittest.cc",
1537        "numerics/mod_ops_unittest.cc",
1538        "numerics/moving_max_counter_unittest.cc",
1539        "numerics/safe_compare_unittest.cc",
1540        "numerics/safe_minmax_unittest.cc",
1541        "numerics/sample_counter_unittest.cc",
1542        "one_time_event_unittest.cc",
1543        "platform_thread_unittest.cc",
1544        "random_unittest.cc",
1545        "rate_limiter_unittest.cc",
1546        "rate_statistics_unittest.cc",
1547        "rate_tracker_unittest.cc",
1548        "ref_counted_object_unittest.cc",
1549        "sanitizer_unittest.cc",
1550        "string_encode_unittest.cc",
1551        "string_to_number_unittest.cc",
1552        "string_utils_unittest.cc",
1553        "strings/string_builder_unittest.cc",
1554        "strings/string_format_unittest.cc",
1555        "strong_alias_unittest.cc",
1556        "swap_queue_unittest.cc",
1557        "thread_annotations_unittest.cc",
1558        "time_utils_unittest.cc",
1559        "timestamp_aligner_unittest.cc",
1560        "virtual_socket_unittest.cc",
1561        "zero_memory_unittest.cc",
1562      ]
1563      deps = [
1564        ":bit_buffer",
1565        ":bitstream_reader",
1566        ":bounded_inline_vector",
1567        ":buffer",
1568        ":buffer_queue",
1569        ":byte_buffer",
1570        ":byte_order",
1571        ":checks",
1572        ":copy_on_write_buffer",
1573        ":criticalsection",
1574        ":divide_round",
1575        ":event_tracer",
1576        ":gunit_helpers",
1577        ":histogram_percentile_counter",
1578        ":ip_address",
1579        ":logging",
1580        ":macromagic",
1581        ":mod_ops",
1582        ":moving_max_counter",
1583        ":null_socket_server",
1584        ":one_time_event",
1585        ":platform_thread",
1586        ":random",
1587        ":rate_limiter",
1588        ":rate_statistics",
1589        ":rate_tracker",
1590        ":refcount",
1591        ":rtc_base",
1592        ":rtc_base_tests_utils",
1593        ":rtc_event",
1594        ":rtc_numerics",
1595        ":rtc_task_queue",
1596        ":safe_compare",
1597        ":safe_minmax",
1598        ":sample_counter",
1599        ":sanitizer",
1600        ":socket",
1601        ":socket_address",
1602        ":socket_server",
1603        ":stringutils",
1604        ":strong_alias",
1605        ":swap_queue",
1606        ":testclient",
1607        ":threading",
1608        ":timestamp_aligner",
1609        ":timeutils",
1610        ":zero_memory",
1611        "../api:array_view",
1612        "../api:make_ref_counted",
1613        "../api:scoped_refptr",
1614        "../api/numerics",
1615        "../api/units:time_delta",
1616        "../system_wrappers",
1617        "../test:fileutils",
1618        "../test:test_main",
1619        "../test:test_support",
1620        "containers:flat_map",
1621        "containers:unittests",
1622        "memory:unittests",
1623        "synchronization:mutex",
1624        "task_utils:repeating_task",
1625        "third_party/base64",
1626        "third_party/sigslot",
1627      ]
1628      absl_deps = [
1629        "//third_party/abseil-cpp/absl/base:core_headers",
1630        "//third_party/abseil-cpp/absl/memory",
1631        "//third_party/abseil-cpp/absl/numeric:bits",
1632        "//third_party/abseil-cpp/absl/strings",
1633        "//third_party/abseil-cpp/absl/types:optional",
1634      ]
1635
1636      if (is_win) {
1637        deps += [ "win:windows_version_unittest" ]
1638      }
1639    }
1640
1641    rtc_library("rtc_task_queue_unittests") {
1642      testonly = true
1643
1644      sources = [ "task_queue_unittest.cc" ]
1645      deps = [
1646        ":gunit_helpers",
1647        ":rtc_base_tests_utils",
1648        ":rtc_event",
1649        ":rtc_task_queue",
1650        ":task_queue_for_test",
1651        ":timeutils",
1652        "../api/units:time_delta",
1653        "../test:test_main",
1654        "../test:test_support",
1655      ]
1656      absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
1657    }
1658
1659    rtc_library("weak_ptr_unittests") {
1660      testonly = true
1661
1662      sources = [ "weak_ptr_unittest.cc" ]
1663      deps = [
1664        ":gunit_helpers",
1665        ":rtc_base_tests_utils",
1666        ":rtc_event",
1667        ":task_queue_for_test",
1668        ":weak_ptr",
1669        "../test:test_main",
1670        "../test:test_support",
1671      ]
1672    }
1673
1674    rtc_library("rtc_numerics_unittests") {
1675      testonly = true
1676
1677      sources = [
1678        "numerics/event_based_exponential_moving_average_unittest.cc",
1679        "numerics/exp_filter_unittest.cc",
1680        "numerics/moving_average_unittest.cc",
1681        "numerics/moving_percentile_filter_unittest.cc",
1682        "numerics/percentile_filter_unittest.cc",
1683        "numerics/running_statistics_unittest.cc",
1684        "numerics/sequence_number_util_unittest.cc",
1685      ]
1686      deps = [
1687        ":rtc_numerics",
1688        "../test:test_main",
1689        "../test:test_support",
1690      ]
1691      absl_deps = [ "//third_party/abseil-cpp/absl/algorithm:container" ]
1692    }
1693
1694    rtc_library("rtc_json_unittests") {
1695      testonly = true
1696
1697      sources = [ "strings/json_unittest.cc" ]
1698      deps = [
1699        ":gunit_helpers",
1700        ":rtc_base_tests_utils",
1701        ":rtc_json",
1702        "../test:test_main",
1703        "../test:test_support",
1704      ]
1705    }
1706
1707    rtc_library("rtc_base_unittests") {
1708      testonly = true
1709      defines = []
1710
1711      sources = [
1712        "crc32_unittest.cc",
1713        "data_rate_limiter_unittest.cc",
1714        "fake_clock_unittest.cc",
1715        "helpers_unittest.cc",
1716        "ip_address_unittest.cc",
1717        "memory_usage_unittest.cc",
1718        "message_digest_unittest.cc",
1719        "nat_unittest.cc",
1720        "network_route_unittest.cc",
1721        "network_unittest.cc",
1722        "proxy_unittest.cc",
1723        "rolling_accumulator_unittest.cc",
1724        "rtc_certificate_generator_unittest.cc",
1725        "rtc_certificate_unittest.cc",
1726        "sigslot_tester_unittest.cc",
1727        "test_client_unittest.cc",
1728        "thread_unittest.cc",
1729        "unique_id_generator_unittest.cc",
1730      ]
1731      deps = [
1732        ":buffer",
1733        ":buffer_queue",
1734        ":checks",
1735        ":gunit_helpers",
1736        ":ip_address",
1737        ":logging",
1738        ":macromagic",
1739        ":net_helpers",
1740        ":null_socket_server",
1741        ":refcount",
1742        ":rtc_base",
1743        ":rtc_base_tests_utils",
1744        ":rtc_event",
1745        ":safe_conversions",
1746        ":socket",
1747        ":socket_address",
1748        ":socket_factory",
1749        ":socket_server",
1750        ":stringutils",
1751        ":testclient",
1752        ":threading",
1753        ":timeutils",
1754        "../api:array_view",
1755        "../api:field_trials_view",
1756        "../api:make_ref_counted",
1757        "../api/task_queue",
1758        "../api/task_queue:pending_task_safety_flag",
1759        "../api/task_queue:task_queue_test",
1760        "../api/units:time_delta",
1761        "../test:field_trial",
1762        "../test:fileutils",
1763        "../test:rtc_expect_death",
1764        "../test:scoped_key_value_config",
1765        "../test:test_main",
1766        "../test:test_support",
1767        "memory:fifo_buffer",
1768        "synchronization:mutex",
1769        "third_party/sigslot",
1770      ]
1771      if (enable_google_benchmarks) {
1772        deps += [ "synchronization:synchronization_unittests" ]
1773      }
1774      if (is_win) {
1775        sources += [
1776          "win32_unittest.cc",
1777          "win32_window_unittest.cc",
1778        ]
1779        deps += [ ":win32" ]
1780      }
1781      if (is_posix || is_fuchsia) {
1782        sources += [
1783          "openssl_adapter_unittest.cc",
1784          "openssl_session_cache_unittest.cc",
1785          "openssl_utility_unittest.cc",
1786          "ssl_adapter_unittest.cc",
1787          "ssl_identity_unittest.cc",
1788          "ssl_stream_adapter_unittest.cc",
1789        ]
1790      }
1791      absl_deps = [
1792        "//third_party/abseil-cpp/absl/algorithm:container",
1793        "//third_party/abseil-cpp/absl/functional:any_invocable",
1794        "//third_party/abseil-cpp/absl/memory",
1795        "//third_party/abseil-cpp/absl/strings",
1796        "//third_party/abseil-cpp/absl/types:optional",
1797      ]
1798
1799      if (build_with_chromium) {
1800        include_dirs = [ "../../boringssl/src/include" ]
1801      }
1802      if (rtc_build_ssl) {
1803        deps += [ "//third_party/boringssl" ]
1804      } else {
1805        configs += [ ":external_ssl_library" ]
1806      }
1807    }
1808  }
1809}
1810
1811if (is_android) {
1812  rtc_android_library("base_java") {
1813    visibility = [ "*" ]
1814    sources = [
1815      "java/src/org/webrtc/ContextUtils.java",
1816      "java/src/org/webrtc/Loggable.java",
1817      "java/src/org/webrtc/Logging.java",
1818      "java/src/org/webrtc/Size.java",
1819      "java/src/org/webrtc/ThreadUtils.java",
1820    ]
1821    deps = [ "//third_party/androidx:androidx_annotation_annotation_java" ]
1822  }
1823  java_cpp_enum("network_monitor_enums") {
1824    sources = [ "network_monitor.h" ]
1825    visibility = [ "*" ]
1826  }
1827}
1828