# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS.  All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

import("//build/config/crypto.gni")
import("//build/config/ui.gni")
import("//third_party/google_benchmark/buildconfig.gni")
import("../webrtc.gni")

if (is_android) {
  import("//build/config/android/config.gni")
  import("//build/config/android/rules.gni")
}

config("threading_chromium_config") {
  defines = [ "NO_MAIN_THREAD_WRAPPING" ]
}

if (!rtc_build_ssl) {
  config("external_ssl_library") {
    assert(rtc_ssl_root != "",
           "You must specify rtc_ssl_root when rtc_build_ssl==0.")
    include_dirs = [ rtc_ssl_root ]
  }
}

rtc_source_set("protobuf_utils") {
  sources = [ "protobuf_utils.h" ]
  if (rtc_enable_protobuf) {
    public_configs = [ "//third_party/protobuf:protobuf_config" ]
    deps = [ "//third_party/protobuf:protobuf_lite" ]
  }
}

rtc_source_set("compile_assert_c") {
  sources = [ "compile_assert_c.h" ]
}

rtc_source_set("ignore_wundef") {
  sources = [ "ignore_wundef.h" ]
}

rtc_source_set("untyped_function") {
  sources = [ "untyped_function.h" ]
  deps = [ "system:assume" ]
}

rtc_source_set("callback_list") {
  sources = [
    "callback_list.cc",
    "callback_list.h",
  ]
  deps = [
    ":checks",
    ":untyped_function",
    "../api:function_view",
    "system:assume",
    "system:inline",
  ]
}

# The subset of rtc_base approved for use outside of libjingle.
# TODO(bugs.webrtc.org/9838): Create small and focused build targets and remove
# the old concept of rtc_base and rtc_base_approved.
rtc_library("rtc_base_approved") {
  visibility = [ "*" ]
  deps = [
    ":checks",
    ":rtc_task_queue",
    ":safe_compare",
    ":type_traits",
    "../api:array_view",
    "../api:scoped_refptr",
    "../api:sequence_checker",
    "synchronization:mutex",
    "system:arch",
    "system:no_unique_address",
    "system:rtc_export",
    "third_party/base64",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/base:core_headers",
    "//third_party/abseil-cpp/absl/types:optional",
  ]
  public_deps = []  # no-presubmit-check TODO(webrtc:8603)

  sources = [
    "bit_buffer.cc",
    "bit_buffer.h",
    "buffer.h",
    "buffer_queue.cc",
    "buffer_queue.h",
    "byte_buffer.cc",
    "byte_buffer.h",
    "byte_order.h",
    "copy_on_write_buffer.cc",
    "copy_on_write_buffer.h",
    "event_tracer.cc",
    "event_tracer.h",
    "location.cc",
    "location.h",
    "numerics/histogram_percentile_counter.cc",
    "numerics/histogram_percentile_counter.h",
    "numerics/mod_ops.h",
    "numerics/moving_max_counter.h",
    "numerics/sample_counter.cc",
    "numerics/sample_counter.h",
    "one_time_event.h",
    "race_checker.cc",
    "race_checker.h",
    "random.cc",
    "random.h",
    "rate_statistics.cc",
    "rate_statistics.h",
    "rate_tracker.cc",
    "rate_tracker.h",
    "swap_queue.h",
    "timestamp_aligner.cc",
    "timestamp_aligner.h",
    "trace_event.h",
    "zero_memory.cc",
    "zero_memory.h",
  ]

  if (is_win) {
    sources += [
      "win/get_activation_factory.cc",
      "win/get_activation_factory.h",
      "win/hstring.cc",
      "win/hstring.h",
      "win/scoped_com_initializer.cc",
      "win/scoped_com_initializer.h",
      "win/windows_version.cc",
      "win/windows_version.h",
    ]
    data_deps = [ "//build/win:runtime_libs" ]
  }

  # These files add a dependency on the Win10 SDK v10.0.10240.
  if (rtc_enable_win_wgc) {
    sources += [
      "win/create_direct3d_device.cc",
      "win/create_direct3d_device.h",
    ]
  }

  if (is_nacl) {
    public_deps +=  # no-presubmit-check TODO(webrtc:8603)
        [ "//native_client_sdk/src/libraries/nacl_io" ]
  }

  if (is_android) {
    libs = [ "log" ]
  }

  public_deps += [  # no-presubmit-check TODO(webrtc:8603)
    ":atomicops",
    ":criticalsection",
    ":logging",
    ":macromagic",
    ":platform_thread",
    ":platform_thread_types",
    ":refcount",
    ":rtc_event",
    ":safe_conversions",
    ":stringutils",
    ":timeutils",
    "../api:sequence_checker",
  ]
}

rtc_source_set("macromagic") {
  sources = [
    "arraysize.h",
    "constructor_magic.h",
    "format_macros.h",
    "thread_annotations.h",
  ]
  deps = [ "system:arch" ]
}

rtc_library("platform_thread_types") {
  sources = [
    "platform_thread_types.cc",
    "platform_thread_types.h",
  ]
  deps = [ ":macromagic" ]
}

rtc_source_set("refcount") {
  visibility = [ "*" ]
  sources = [
    "ref_count.h",
    "ref_counted_object.h",
    "ref_counter.h",
  ]
  deps = [
    ":macromagic",
    "../api:scoped_refptr",
  ]
}

rtc_library("criticalsection") {
  sources = [
    "deprecated/recursive_critical_section.cc",
    "deprecated/recursive_critical_section.h",
  ]
  deps = [
    ":atomicops",
    ":checks",
    ":macromagic",
    ":platform_thread_types",
    "synchronization:yield",
    "system:unused",
  ]
}

rtc_library("platform_thread") {
  visibility = [
    ":rtc_base_approved",
    ":rtc_task_queue_libevent",
    ":rtc_task_queue_stdlib",
    ":rtc_task_queue_win",
    "../api:sequence_checker",
    "synchronization:mutex",
  ]
  sources = [
    "platform_thread.cc",
    "platform_thread.h",
  ]
  deps = [
    ":atomicops",
    ":checks",
    ":macromagic",
    ":platform_thread_types",
    ":rtc_event",
    ":timeutils",
    "../api:sequence_checker",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/memory",
    "//third_party/abseil-cpp/absl/strings",
  ]
}

rtc_library("rtc_event") {
  if (build_with_chromium) {
    sources = [
      "../../webrtc_overrides/rtc_base/event.cc",
      "../../webrtc_overrides/rtc_base/event.h",
    ]
    deps = [
      ":checks",
      "system:rtc_export",  # Only Chromium's rtc::Event use RTC_EXPORT.
      "//base",  # Dependency on chromium's waitable_event.
    ]
  } else {
    sources = [
      "event.cc",
      "event.h",
    ]
    deps = [
      ":checks",
      "synchronization:yield_policy",
      "system:warn_current_thread_is_deadlocked",
    ]
    absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
  }
}

rtc_library("logging") {
  visibility = [ "*" ]
  libs = []
  deps = [
    ":checks",
    ":criticalsection",
    ":macromagic",
    ":platform_thread_types",
    ":stringutils",
    ":timeutils",
    "synchronization:mutex",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/base:core_headers",
    "//third_party/abseil-cpp/absl/meta:type_traits",
    "//third_party/abseil-cpp/absl/strings",
  ]

  if (build_with_chromium) {
    # Dependency on chromium's logging (in //base).
    deps += [ "//base" ]
    sources = [
      "../../webrtc_overrides/rtc_base/logging.cc",
      "../../webrtc_overrides/rtc_base/logging.h",
    ]
  } else {
    configs += [
      "..:no_exit_time_destructors",
      "..:no_global_constructors",
    ]
    sources = [
      "logging.cc",
      "logging.h",
    ]
    deps += [ "system:inline" ]

    if (is_mac) {
      frameworks = [ "Foundation.framework" ]
    }

    if (is_android) {
      libs += [ "log" ]
    }
  }
}

rtc_source_set("atomicops") {
  sources = [ "atomic_ops.h" ]
}

rtc_library("checks") {
  # TODO(bugs.webrtc.org/9607): This should not be public.
  visibility = [ "*" ]
  libs = []
  sources = [
    "checks.cc",
    "checks.h",
  ]
  deps = [
    ":safe_compare",
    "system:inline",
    "system:rtc_export",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/meta:type_traits",
    "//third_party/abseil-cpp/absl/strings",
  ]
  if (is_android) {
    libs += [ "log" ]
  }
}

rtc_library("rate_limiter") {
  sources = [
    "rate_limiter.cc",
    "rate_limiter.h",
  ]
  deps = [
    ":rtc_base_approved",
    "../system_wrappers",
    "synchronization:mutex",
  ]
  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}

rtc_source_set("sanitizer") {
  sources = [ "sanitizer.h" ]
  absl_deps = [ "//third_party/abseil-cpp/absl/meta:type_traits" ]
}

rtc_source_set("bounded_inline_vector") {
  public = [ "bounded_inline_vector.h" ]
  sources = [ "bounded_inline_vector_impl.h" ]
  deps = [ ":checks" ]
}

rtc_source_set("divide_round") {
  sources = [ "numerics/divide_round.h" ]
  deps = [
    ":checks",
    ":safe_compare",
  ]
}

rtc_source_set("safe_compare") {
  sources = [ "numerics/safe_compare.h" ]
  deps = [ ":type_traits" ]
}

rtc_source_set("safe_minmax") {
  sources = [ "numerics/safe_minmax.h" ]
  deps = [
    ":checks",
    ":safe_compare",
    ":type_traits",
  ]
}

rtc_source_set("safe_conversions") {
  sources = [
    "numerics/safe_conversions.h",
    "numerics/safe_conversions_impl.h",
  ]
  deps = [ ":checks" ]
}

rtc_library("timeutils") {
  visibility = [ "*" ]
  sources = [
    "system_time.cc",
    "system_time.h",
    "time_utils.cc",
    "time_utils.h",
  ]
  deps = [
    ":checks",
    ":safe_conversions",
    ":stringutils",
    "system:rtc_export",
  ]
  if (rtc_exclude_system_time) {
    defines = [ "WEBRTC_EXCLUDE_SYSTEM_TIME" ]
  }

  libs = []
  if (is_win) {
    libs += [ "winmm.lib" ]
  }
}

rtc_library("stringutils") {
  sources = [
    "string_encode.cc",
    "string_encode.h",
    "string_to_number.cc",
    "string_to_number.h",
    "string_utils.cc",
    "string_utils.h",
    "strings/string_builder.cc",
    "strings/string_builder.h",
    "strings/string_format.cc",
    "strings/string_format.h",
  ]
  deps = [
    ":checks",
    ":macromagic",
    ":safe_minmax",
    "../api:array_view",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/strings",
    "//third_party/abseil-cpp/absl/types:optional",
  ]
}

rtc_library("audio_format_to_string") {
  sources = [
    "strings/audio_format_to_string.cc",
    "strings/audio_format_to_string.h",
  ]
  deps = [
    ":stringutils",
    "../api/audio_codecs:audio_codecs_api",
  ]
}

rtc_source_set("type_traits") {
  sources = [ "type_traits.h" ]
}

rtc_library("rtc_task_queue") {
  visibility = [ "*" ]
  sources = [
    "task_queue.cc",
    "task_queue.h",
  ]
  deps = [
    ":macromagic",
    "../api/task_queue",
    "system:rtc_export",
    "task_utils:to_queued_task",
  ]
  absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
}

rtc_source_set("rtc_operations_chain") {
  visibility = [ "*" ]
  sources = [
    "operations_chain.cc",
    "operations_chain.h",
  ]
  deps = [
    ":checks",
    ":macromagic",
    ":refcount",
    "../api:scoped_refptr",
    "../api:sequence_checker",
    "system:no_unique_address",
  ]
  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}

if (rtc_enable_libevent) {
  rtc_library("rtc_task_queue_libevent") {
    visibility = [ "../api/task_queue:default_task_queue_factory" ]
    sources = [
      "task_queue_libevent.cc",
      "task_queue_libevent.h",
    ]
    deps = [
      ":checks",
      ":criticalsection",
      ":logging",
      ":macromagic",
      ":platform_thread",
      ":platform_thread_types",
      ":safe_conversions",
      ":timeutils",
      "../api/task_queue",
      "synchronization:mutex",
    ]
    absl_deps = [
      "//third_party/abseil-cpp/absl/container:inlined_vector",
      "//third_party/abseil-cpp/absl/strings",
    ]
    if (rtc_build_libevent) {
      deps += [ "//base/third_party/libevent" ]
    }
  }
}

if (is_mac || is_ios) {
  rtc_library("rtc_task_queue_gcd") {
    visibility = [ "../api/task_queue:default_task_queue_factory" ]
    sources = [
      "task_queue_gcd.cc",
      "task_queue_gcd.h",
    ]
    deps = [
      ":checks",
      ":logging",
      "../api/task_queue",
      "synchronization:mutex",
      "system:gcd_helpers",
    ]
    absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
  }
}

if (is_win) {
  rtc_library("rtc_task_queue_win") {
    visibility = [ "../api/task_queue:default_task_queue_factory" ]
    sources = [
      "task_queue_win.cc",
      "task_queue_win.h",
    ]
    deps = [
      ":checks",
      ":criticalsection",
      ":logging",
      ":macromagic",
      ":platform_thread",
      ":rtc_event",
      ":safe_conversions",
      ":timeutils",
      "../api/task_queue",
      "synchronization:mutex",
    ]
    absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
  }
}

rtc_library("rtc_task_queue_stdlib") {
  sources = [
    "task_queue_stdlib.cc",
    "task_queue_stdlib.h",
  ]
  deps = [
    ":checks",
    ":criticalsection",
    ":logging",
    ":macromagic",
    ":platform_thread",
    ":rtc_event",
    ":safe_conversions",
    ":timeutils",
    "../api/task_queue",
    "synchronization:mutex",
  ]
  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
}

rtc_library("weak_ptr") {
  sources = [
    "weak_ptr.cc",
    "weak_ptr.h",
  ]
  deps = [
    ":refcount",
    "../api:scoped_refptr",
    "../api:sequence_checker",
    "system:no_unique_address",
  ]
}

rtc_library("rtc_numerics") {
  sources = [
    "numerics/event_based_exponential_moving_average.cc",
    "numerics/event_based_exponential_moving_average.h",
    "numerics/exp_filter.cc",
    "numerics/exp_filter.h",
    "numerics/math_utils.h",
    "numerics/moving_average.cc",
    "numerics/moving_average.h",
    "numerics/moving_median_filter.h",
    "numerics/percentile_filter.h",
    "numerics/running_statistics.h",
    "numerics/sequence_number_util.h",
  ]
  deps = [
    ":checks",
    ":rtc_base_approved",
  ]
  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}

rtc_library("rtc_stats_counters") {
  sources = [
    "numerics/event_rate_counter.cc",
    "numerics/event_rate_counter.h",
    "numerics/sample_stats.cc",
    "numerics/sample_stats.h",
  ]
  deps = [
    "../api/numerics",
    "../api/units:data_rate",
    "../api/units:time_delta",
    "../api/units:timestamp",
  ]
  absl_deps = []
}

config("rtc_json_suppressions") {
  if (!is_win || is_clang) {
    cflags_cc = [
      # TODO(bugs.webrtc.org/10770): Update jsoncpp API usage and remove
      # -Wno-deprecated-declarations.
      "-Wno-deprecated-declarations",

      # TODO(bugs.webrtc.org/10814): Remove -Wno-undef as soon as it get
      # removed upstream.
      "-Wno-undef",
    ]
  }
}

rtc_library("rtc_json") {
  public_configs = [ ":rtc_json_suppressions" ]
  poisonous = [ "rtc_json" ]
  defines = []
  sources = [
    "strings/json.cc",
    "strings/json.h",
  ]
  deps = [ ":stringutils" ]
  all_dependent_configs = [ "//third_party/jsoncpp:jsoncpp_config" ]
  if (rtc_build_json) {
    public_deps =  # no-presubmit-check TODO(webrtc:8603)
        [ "//third_party/jsoncpp" ]
  } else {
    include_dirs = [ "$rtc_jsoncpp_root" ]

    # When defined changes the include path for json.h to where it is
    # expected to be when building json outside of the standalone build.
    defines += [ "WEBRTC_EXTERNAL_JSON" ]
  }
}

rtc_library("net_helpers") {
  sources = [
    "net_helpers.cc",
    "net_helpers.h",
  ]
  deps = []
  if (is_android) {
    deps += [ ":ifaddrs_android" ]
  }
  if (is_win) {
    deps += [ ":win32" ]
  }
}

rtc_library("async_resolver_interface") {
  visibility = [ "*" ]
  sources = [
    "async_resolver_interface.cc",
    "async_resolver_interface.h",
  ]
  deps = [
    ":socket_address",
    "system:rtc_export",
    "third_party/sigslot",
  ]
}

rtc_library("ip_address") {
  visibility = [ "*" ]
  sources = [
    "ip_address.cc",
    "ip_address.h",
  ]
  deps = [
    ":net_helpers",
    ":rtc_base_approved",
    ":stringutils",
    "system:rtc_export",
  ]
  if (is_win) {
    deps += [ ":win32" ]
  }
}

rtc_library("socket_address") {
  visibility = [ "*" ]
  sources = [
    "socket_address.cc",
    "socket_address.h",
  ]
  deps = [
    ":checks",
    ":ip_address",
    ":logging",
    ":net_helpers",
    ":rtc_base_approved",
    ":safe_conversions",
    ":stringutils",
    "system:rtc_export",
  ]
  if (is_win) {
    deps += [ ":win32" ]
  }
}

rtc_library("null_socket_server") {
  sources = [
    "null_socket_server.cc",
    "null_socket_server.h",
  ]
  deps = [
    ":async_socket",
    ":checks",
    ":rtc_event",
    ":socket",
    ":socket_server",
    "system:rtc_export",
  ]
}

rtc_source_set("socket_server") {
  sources = [ "socket_server.h" ]
  deps = [ ":socket_factory" ]
}

rtc_library("threading") {
  visibility = [ "*" ]

  if (build_with_chromium) {
    public_configs = [ ":threading_chromium_config" ]
  }

  sources = [
    "async_resolver.cc",
    "async_resolver.h",
    "internal/default_socket_server.cc",
    "internal/default_socket_server.h",
    "message_handler.cc",
    "message_handler.h",
    "network_monitor.cc",
    "network_monitor.h",
    "network_monitor_factory.cc",
    "network_monitor_factory.h",
    "physical_socket_server.cc",
    "physical_socket_server.h",
    "thread.cc",
    "thread.h",
    "thread_message.h",
  ]
  absl_deps = [ "//third_party/abseil-cpp/absl/algorithm:container" ]
  deps = [
    ":async_resolver_interface",
    ":atomicops",
    ":checks",
    ":criticalsection",
    ":ip_address",
    ":logging",
    ":macromagic",
    ":network_constants",
    ":null_socket_server",
    ":platform_thread_types",
    ":rtc_base_approved",
    ":rtc_event",
    ":rtc_task_queue",
    ":socket_address",
    ":socket_server",
    ":timeutils",
    "../api:function_view",
    "../api:refcountedbase",
    "../api:scoped_refptr",
    "../api:sequence_checker",
    "../api/task_queue",
    "synchronization:mutex",
    "system:no_unique_address",
    "system:rtc_export",
    "task_utils:pending_task_safety_flag",
    "task_utils:to_queued_task",
    "third_party/sigslot",
  ]
  if (is_android) {
    deps += [ ":ifaddrs_android" ]
  }
  if (is_win) {
    deps += [ ":win32" ]
  }
  if (is_mac || is_ios) {
    deps += [ "system:cocoa_threading" ]
  }
}

rtc_source_set("socket_factory") {
  sources = [ "socket_factory.h" ]
  deps = [
    ":async_socket",
    ":socket",
  ]
}

rtc_library("async_socket") {
  sources = [
    "async_socket.cc",
    "async_socket.h",
  ]
  deps = [
    ":checks",
    ":socket",
    ":socket_address",
    "third_party/sigslot",
  ]
}

rtc_library("socket") {
  sources = [
    "socket.cc",
    "socket.h",
  ]
  deps = [
    ":macromagic",
    ":socket_address",
  ]
  if (is_win) {
    deps += [ ":win32" ]
  }
}

rtc_source_set("network_constants") {
  sources = [
    "network_constants.cc",
    "network_constants.h",
  ]
  deps = [ ":checks" ]
}

if (is_android) {
  rtc_library("ifaddrs_android") {
    sources = [
      "ifaddrs_android.cc",
      "ifaddrs_android.h",
    ]
    libs = [
      "log",
      "GLESv2",
    ]
  }
}

if (is_win) {
  rtc_library("win32") {
    sources = [
      "win32.cc",
      "win32.h",
      "win32_window.cc",
      "win32_window.h",
    ]

    deps = [
      ":checks",
      ":macromagic",
      ":rtc_base_approved",
    ]

    libs = [
      "crypt32.lib",
      "iphlpapi.lib",
      "secur32.lib",
    ]

    defines = [ "_CRT_NONSTDC_NO_DEPRECATE" ]
  }
}

rtc_library("rtc_base") {
  visibility = [ "*" ]
  cflags = []
  cflags_cc = []
  libs = []
  defines = []
  deps = [
    ":async_resolver_interface",
    ":async_socket",
    ":checks",
    ":ip_address",
    ":network_constants",
    ":null_socket_server",
    ":rtc_task_queue",
    ":socket",
    ":socket_address",
    ":socket_factory",
    ":socket_server",
    ":stringutils",
    ":threading",
    "../api:array_view",
    "../api:function_view",
    "../api:refcountedbase",
    "../api:scoped_refptr",
    "../api:sequence_checker",
    "../api/numerics",
    "../api/task_queue",
    "../system_wrappers:field_trial",
    "network:sent_packet",
    "synchronization:mutex",
    "system:file_wrapper",
    "system:inline",
    "system:no_unique_address",
    "system:rtc_export",
    "task_utils:pending_task_safety_flag",
    "task_utils:repeating_task",
    "task_utils:to_queued_task",
    "third_party/base64",
    "third_party/sigslot",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/container:flat_hash_map",
    "//third_party/abseil-cpp/absl/memory",
    "//third_party/abseil-cpp/absl/strings",
    "//third_party/abseil-cpp/absl/types:optional",
  ]
  public_deps = [ ":rtc_base_approved" ]  # no-presubmit-check TODO(webrtc:8603)
  public_configs = []

  sources = [
    "async_invoker.cc",
    "async_invoker.h",
    "async_invoker_inl.h",
    "async_packet_socket.cc",
    "async_packet_socket.h",
    "async_tcp_socket.cc",
    "async_tcp_socket.h",
    "async_udp_socket.cc",
    "async_udp_socket.h",
    "crc32.cc",
    "crc32.h",
    "crypt_string.cc",
    "crypt_string.h",
    "data_rate_limiter.cc",
    "data_rate_limiter.h",
    "dscp.h",
    "file_rotating_stream.cc",
    "file_rotating_stream.h",
    "helpers.cc",
    "helpers.h",
    "http_common.cc",
    "http_common.h",
    "mdns_responder_interface.h",
    "message_digest.cc",
    "message_digest.h",
    "net_helper.cc",
    "net_helper.h",
    "network.cc",
    "network.h",
    "network_route.cc",
    "network_route.h",
    "openssl.h",
    "openssl_adapter.cc",
    "openssl_adapter.h",
    "openssl_digest.cc",
    "openssl_digest.h",
    "openssl_key_pair.cc",
    "openssl_key_pair.h",
    "openssl_session_cache.cc",
    "openssl_session_cache.h",
    "openssl_stream_adapter.cc",
    "openssl_stream_adapter.h",
    "openssl_utility.cc",
    "openssl_utility.h",
    "proxy_info.cc",
    "proxy_info.h",
    "rtc_certificate.cc",
    "rtc_certificate.h",
    "rtc_certificate_generator.cc",
    "rtc_certificate_generator.h",
    "sigslot_repeater.h",
    "socket_adapters.cc",
    "socket_adapters.h",
    "socket_address_pair.cc",
    "socket_address_pair.h",
    "ssl_adapter.cc",
    "ssl_adapter.h",
    "ssl_certificate.cc",
    "ssl_certificate.h",
    "ssl_fingerprint.cc",
    "ssl_fingerprint.h",
    "ssl_identity.cc",
    "ssl_identity.h",
    "ssl_stream_adapter.cc",
    "ssl_stream_adapter.h",
    "stream.cc",
    "stream.h",
    "unique_id_generator.cc",
    "unique_id_generator.h",
  ]

  # If we are building the SSL library ourselves, we know it's BoringSSL.
  if (rtc_build_ssl) {
    sources += [
      "boringssl_certificate.cc",
      "boringssl_certificate.h",
      "boringssl_identity.cc",
      "boringssl_identity.h",
    ]
  } else {
    sources += [
      "openssl_certificate.cc",
      "openssl_certificate.h",
      "openssl_identity.cc",
      "openssl_identity.h",
    ]
  }

  if (build_with_chromium) {
    include_dirs = [ "../../boringssl/src/include" ]
  } else {
    sources += [
      "log_sinks.cc",
      "log_sinks.h",
      "rolling_accumulator.h",
      "ssl_roots.h",
    ]

    deps += [ ":rtc_numerics" ]

    if (is_win) {
      sources += [ "win32_socket_init.h" ]
      if (current_os != "winuwp") {
        sources += [
          "win32_socket_server.cc",
          "win32_socket_server.h",
        ]
      }
    }
  }  # !build_with_chromium

  if (rtc_build_ssl) {
    deps += [ "//third_party/boringssl" ]
  } else {
    configs += [ ":external_ssl_library" ]
  }

  if (is_android) {
    deps += [ ":ifaddrs_android" ]
  }

  if (is_ios || is_mac) {
    sources += [ "mac_ifaddrs_converter.cc" ]
  }

  if (is_linux || is_chromeos) {
    libs += [
      "dl",
      "rt",
    ]
  }

  if (is_ios) {
    frameworks = [
      "CFNetwork.framework",
      "Foundation.framework",
      "Security.framework",
      "SystemConfiguration.framework",
      "UIKit.framework",
    ]
  }

  if (is_win) {
    deps += [ ":win32" ]
  }

  if (is_posix || is_fuchsia) {
    sources += [
      "ifaddrs_converter.cc",
      "ifaddrs_converter.h",
    ]
  }

  if (is_nacl) {
    public_deps +=  # no-presubmit-check TODO(webrtc:8603)
        [ "//native_client_sdk/src/libraries/nacl_io" ]

    defines += [ "timezone=_timezone" ]
    sources -= [ "ifaddrs_converter.cc" ]
  }
}

rtc_source_set("gtest_prod") {
  sources = [ "gtest_prod_util.h" ]
}

rtc_library("gunit_helpers") {
  testonly = true
  sources = [
    "gunit.cc",
    "gunit.h",
  ]
  deps = [
    ":logging",
    ":rtc_base",
    ":rtc_base_tests_utils",
    ":stringutils",
    ":threading",
    "../test:test_support",
  ]
  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
}

rtc_library("testclient") {
  testonly = true
  sources = [
    "test_client.cc",
    "test_client.h",
  ]
  deps = [
    ":criticalsection",
    ":gunit_helpers",
    ":rtc_base",
    ":rtc_base_tests_utils",
    ":threading",
    ":timeutils",
    "synchronization:mutex",
  ]
}

rtc_library("callback_list_unittests") {
  testonly = true

  sources = [ "callback_list_unittest.cc" ]
  deps = [
    ":callback_list",
    ":gunit_helpers",
    ":rtc_base",
    "../api:function_view",
    "../test:test_support",
  ]
}

rtc_library("rtc_base_tests_utils") {
  testonly = true
  sources = [
    "cpu_time.cc",
    "cpu_time.h",
    "fake_clock.cc",
    "fake_clock.h",
    "fake_mdns_responder.h",
    "fake_network.h",
    "fake_ssl_identity.cc",
    "fake_ssl_identity.h",
    "firewall_socket_server.cc",
    "firewall_socket_server.h",
    "memory_stream.cc",
    "memory_stream.h",
    "memory_usage.cc",
    "memory_usage.h",
    "nat_server.cc",
    "nat_server.h",
    "nat_socket_factory.cc",
    "nat_socket_factory.h",
    "nat_types.cc",
    "nat_types.h",
    "proxy_server.cc",
    "proxy_server.h",
    "server_socket_adapters.cc",
    "server_socket_adapters.h",
    "sigslot_tester.h",
    "socket_stream.cc",
    "socket_stream.h",
    "test_base64.h",
    "test_certificate_verifier.h",
    "test_echo_server.cc",
    "test_echo_server.h",
    "test_utils.cc",
    "test_utils.h",
    "virtual_socket_server.cc",
    "virtual_socket_server.h",
  ]
  deps = [
    ":async_socket",
    ":checks",
    ":ip_address",
    ":rtc_base",
    ":socket",
    ":socket_address",
    ":socket_factory",
    ":socket_server",
    ":threading",
    "../api/units:time_delta",
    "../api/units:timestamp",
    "memory:fifo_buffer",
    "synchronization:mutex",
    "task_utils:to_queued_task",
    "third_party/sigslot",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/memory",
  ]
}

rtc_library("task_queue_for_test") {
  testonly = true

  sources = [
    "task_queue_for_test.cc",
    "task_queue_for_test.h",
  ]
  deps = [
    ":checks",
    ":rtc_base_approved",
    ":rtc_event",
    ":rtc_task_queue",
    "../api/task_queue",
    "../api/task_queue:default_task_queue_factory",
    "task_utils:to_queued_task",
  ]
  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
}

if (rtc_include_tests) {
  rtc_library("sigslot_unittest") {
    testonly = true
    sources = [ "sigslot_unittest.cc" ]
    deps = [
      ":gunit_helpers",
      ":rtc_base",
      ":rtc_base_tests_utils",
      "../test:test_support",
      "synchronization:mutex",
      "third_party/sigslot",
    ]
  }

  rtc_library("untyped_function_unittest") {
    testonly = true
    sources = [ "untyped_function_unittest.cc" ]
    deps = [
      ":untyped_function",
      "../test:test_support",
    ]
  }

  rtc_library("rtc_operations_chain_unittests") {
    testonly = true

    sources = [ "operations_chain_unittest.cc" ]
    deps = [
      ":gunit_helpers",
      ":rtc_base",
      ":rtc_base_approved",
      ":rtc_event",
      ":rtc_operations_chain",
      ":threading",
      "../test:test_support",
    ]
  }

  if (!build_with_chromium) {
    rtc_library("rtc_base_nonparallel_tests") {
      testonly = true

      sources = [
        "cpu_time_unittest.cc",
        "file_rotating_stream_unittest.cc",
        "null_socket_server_unittest.cc",
        "physical_socket_server_unittest.cc",
        "socket_address_unittest.cc",
        "socket_unittest.cc",
        "socket_unittest.h",
      ]
      deps = [
        ":async_socket",
        ":checks",
        ":gunit_helpers",
        ":ip_address",
        ":net_helpers",
        ":null_socket_server",
        ":rtc_base",
        ":rtc_base_tests_utils",
        ":socket",
        ":socket_address",
        ":socket_server",
        ":testclient",
        ":threading",
        "../system_wrappers",
        "../test:fileutils",
        "../test:test_main",
        "../test:test_support",
        "third_party/sigslot",
        "//testing/gtest",
      ]
      absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
      if (is_win) {
        sources += [ "win32_socket_server_unittest.cc" ]
      }
    }

    rtc_library("rtc_base_approved_unittests") {
      testonly = true
      sources = [
        "atomic_ops_unittest.cc",
        "base64_unittest.cc",
        "bit_buffer_unittest.cc",
        "bounded_inline_vector_unittest.cc",
        "buffer_queue_unittest.cc",
        "buffer_unittest.cc",
        "byte_buffer_unittest.cc",
        "byte_order_unittest.cc",
        "checks_unittest.cc",
        "copy_on_write_buffer_unittest.cc",
        "deprecated/recursive_critical_section_unittest.cc",
        "event_tracer_unittest.cc",
        "event_unittest.cc",
        "logging_unittest.cc",
        "numerics/divide_round_unittest.cc",
        "numerics/histogram_percentile_counter_unittest.cc",
        "numerics/mod_ops_unittest.cc",
        "numerics/moving_max_counter_unittest.cc",
        "numerics/safe_compare_unittest.cc",
        "numerics/safe_minmax_unittest.cc",
        "numerics/sample_counter_unittest.cc",
        "one_time_event_unittest.cc",
        "platform_thread_unittest.cc",
        "random_unittest.cc",
        "rate_limiter_unittest.cc",
        "rate_statistics_unittest.cc",
        "rate_tracker_unittest.cc",
        "ref_counted_object_unittest.cc",
        "sanitizer_unittest.cc",
        "string_encode_unittest.cc",
        "string_to_number_unittest.cc",
        "string_utils_unittest.cc",
        "strings/string_builder_unittest.cc",
        "strings/string_format_unittest.cc",
        "swap_queue_unittest.cc",
        "thread_annotations_unittest.cc",
        "time_utils_unittest.cc",
        "timestamp_aligner_unittest.cc",
        "virtual_socket_unittest.cc",
        "zero_memory_unittest.cc",
      ]
      if (is_win) {
        sources += [ "win/windows_version_unittest.cc" ]
      }
      deps = [
        ":async_socket",
        ":bounded_inline_vector",
        ":checks",
        ":divide_round",
        ":gunit_helpers",
        ":ip_address",
        ":null_socket_server",
        ":rate_limiter",
        ":rtc_base",
        ":rtc_base_approved",
        ":rtc_base_tests_utils",
        ":rtc_numerics",
        ":rtc_task_queue",
        ":safe_compare",
        ":safe_minmax",
        ":sanitizer",
        ":socket",
        ":socket_address",
        ":socket_server",
        ":stringutils",
        ":testclient",
        ":threading",
        "../api:array_view",
        "../api:scoped_refptr",
        "../api/numerics",
        "../api/units:time_delta",
        "../system_wrappers",
        "../test:fileutils",
        "../test:test_main",
        "../test:test_support",
        "memory:unittests",
        "synchronization:mutex",
        "task_utils:to_queued_task",
        "third_party/base64",
        "third_party/sigslot",
      ]
      absl_deps = [
        "//third_party/abseil-cpp/absl/base:core_headers",
        "//third_party/abseil-cpp/absl/memory",
      ]
    }

    rtc_library("rtc_task_queue_unittests") {
      testonly = true

      sources = [ "task_queue_unittest.cc" ]
      deps = [
        ":gunit_helpers",
        ":rtc_base_approved",
        ":rtc_base_tests_utils",
        ":rtc_task_queue",
        ":task_queue_for_test",
        "../test:test_main",
        "../test:test_support",
      ]
      absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
    }

    rtc_library("weak_ptr_unittests") {
      testonly = true

      sources = [ "weak_ptr_unittest.cc" ]
      deps = [
        ":gunit_helpers",
        ":rtc_base_approved",
        ":rtc_base_tests_utils",
        ":rtc_event",
        ":task_queue_for_test",
        ":weak_ptr",
        "../test:test_main",
        "../test:test_support",
      ]
    }

    rtc_library("rtc_numerics_unittests") {
      testonly = true

      sources = [
        "numerics/event_based_exponential_moving_average_unittest.cc",
        "numerics/exp_filter_unittest.cc",
        "numerics/moving_average_unittest.cc",
        "numerics/moving_median_filter_unittest.cc",
        "numerics/percentile_filter_unittest.cc",
        "numerics/running_statistics_unittest.cc",
        "numerics/sequence_number_util_unittest.cc",
      ]
      deps = [
        ":rtc_base_approved",
        ":rtc_numerics",
        "../test:test_main",
        "../test:test_support",
      ]
      absl_deps = [ "//third_party/abseil-cpp/absl/algorithm:container" ]
    }

    rtc_library("rtc_json_unittests") {
      testonly = true

      sources = [ "strings/json_unittest.cc" ]
      deps = [
        ":gunit_helpers",
        ":rtc_base_tests_utils",
        ":rtc_json",
        "../test:test_main",
        "../test:test_support",
      ]
    }

    rtc_library("rtc_base_unittests") {
      testonly = true
      defines = []

      sources = [
        "crc32_unittest.cc",
        "data_rate_limiter_unittest.cc",
        "fake_clock_unittest.cc",
        "helpers_unittest.cc",
        "ip_address_unittest.cc",
        "memory_usage_unittest.cc",
        "message_digest_unittest.cc",
        "nat_unittest.cc",
        "network_route_unittest.cc",
        "network_unittest.cc",
        "proxy_unittest.cc",
        "rolling_accumulator_unittest.cc",
        "rtc_certificate_generator_unittest.cc",
        "rtc_certificate_unittest.cc",
        "sigslot_tester_unittest.cc",
        "test_client_unittest.cc",
        "thread_unittest.cc",
        "unique_id_generator_unittest.cc",
      ]
      deps = [
        ":async_socket",
        ":checks",
        ":gunit_helpers",
        ":ip_address",
        ":net_helpers",
        ":null_socket_server",
        ":rtc_base_tests_utils",
        ":socket_address",
        ":socket_factory",
        ":socket_server",
        ":stringutils",
        ":testclient",
        ":threading",
        "../api:array_view",
        "../api/task_queue",
        "../api/task_queue:task_queue_test",
        "../test:field_trial",
        "../test:fileutils",
        "../test:rtc_expect_death",
        "../test:test_main",
        "../test:test_support",
        "memory:fifo_buffer",
        "synchronization:mutex",
        "task_utils:pending_task_safety_flag",
        "task_utils:to_queued_task",
        "third_party/sigslot",
      ]
      if (enable_google_benchmarks) {
        deps += [ "synchronization:synchronization_unittests" ]
      }
      if (is_win) {
        sources += [
          "win32_unittest.cc",
          "win32_window_unittest.cc",
        ]
        deps += [ ":win32" ]
      }
      if (is_posix || is_fuchsia) {
        sources += [
          "openssl_adapter_unittest.cc",
          "openssl_session_cache_unittest.cc",
          "openssl_utility_unittest.cc",
          "ssl_adapter_unittest.cc",
          "ssl_identity_unittest.cc",
          "ssl_stream_adapter_unittest.cc",
        ]
      }
      absl_deps = [
        "//third_party/abseil-cpp/absl/algorithm:container",
        "//third_party/abseil-cpp/absl/memory",
        "//third_party/abseil-cpp/absl/strings",
        "//third_party/abseil-cpp/absl/types:optional",
      ]
      public_deps = [ ":rtc_base" ]  # no-presubmit-check TODO(webrtc:8603)
      if (build_with_chromium) {
        include_dirs = [ "../../boringssl/src/include" ]
      }
      if (rtc_build_ssl) {
        deps += [ "//third_party/boringssl" ]
      } else {
        configs += [ ":external_ssl_library" ]
      }
    }
  }
}

if (is_android) {
  rtc_android_library("base_java") {
    visibility = [ "*" ]
    sources = [
      "java/src/org/webrtc/ContextUtils.java",
      "java/src/org/webrtc/Loggable.java",
      "java/src/org/webrtc/Logging.java",
      "java/src/org/webrtc/Size.java",
      "java/src/org/webrtc/ThreadUtils.java",
    ]
    deps = [
      "//third_party/android_deps:com_android_support_support_annotations_java",
    ]
  }
  java_cpp_enum("network_monitor_enums") {
    sources = [ "network_monitor.h" ]
    visibility = [ "*" ]
  }
}
