# 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("../build/webrtc.gni")

config("rtc_base_config") {
  include_dirs = [
    "//third_party/jsoncpp/overrides/include",
    "//third_party/jsoncpp/source/include",
  ]

  defines = [
    "FEATURE_ENABLE_SSL",
    "LOGGING=1",
  ]

  # TODO(henrike): issue 3307, make rtc_base build without disabling
  # these flags.
  cflags_cc = [ "-Wno-non-virtual-dtor" ]
}

config("rtc_base_chromium_config") {
  defines = [
    "NO_MAIN_THREAD_WRAPPING",
  ]
}

config("openssl_config") {
  defines = [
    "SSL_USE_OPENSSL",
    "HAVE_OPENSSL_SSL_H",
  ]
}

config("nss_config") {
  defines = [
    "SSL_USE_NSS",
    "HAVE_NSS_SSL_H",
    "SSL_USE_NSS_RNG",
  ]
}

config("ios_config") {
  libs = [
    #"Foundation.framework",  # Already included in //build/config:default_libs.
    "Security.framework",
    "SystemConfiguration.framework",
    #"UIKit.framework",  # Already included in //build/config:default_libs.
  ]
}

config("mac_config") {
  libs = [
    "Cocoa.framework",
    #"Foundation.framework",  # Already included in //build/config:default_libs.
    #"IOKit.framework",  # Already included in //build/config:default_libs.
    #"Security.framework",  # Already included in //build/config:default_libs.
    "SystemConfiguration.framework",
  ]
}

config("mac_x86_config") {
  libs = [
    #"Carbon.framework",  # Already included in //build/config:default_libs.
  ]
}

if (is_linux && !build_with_chromium) {
  # Provides the same functionality as the //crypto:platform target, which
  # WebRTC cannot use as we don't sync src/crypto from Chromium.
  group("linux_system_ssl") {
    if (use_openssl) {
      deps = [ "//third_party/boringssl" ]
    } else {
      deps = [ "//net/third_party/nss/ssl:libssl" ]

      public_configs = [
        "//net/third_party/nss/ssl:ssl_config",
        "//third_party/nss:system_nss_no_ssl_config",
      ]
    }
  }
}

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

# The subset of rtc_base approved for use outside of libjingle.
static_library("rtc_base_approved") {
  configs += [ "..:common_config" ]
  public_configs = [ "..:common_inherited_config" ]

  sources = [
    "checks.cc",
    "checks.h",
    "event.cc",
    "event.h",
    "event_tracer.cc",
    "event_tracer.h",
    "exp_filter.cc",
    "exp_filter.h",
    "md5.cc",
    "md5.h",
    "md5digest.cc",
    "md5digest.h",
    "platform_file.cc",
    "platform_file.h",
    "safe_conversions.h",
    "safe_conversions_impl.h",
    "stringencode.cc",
    "stringencode.h",
    "stringutils.cc",
    "stringutils.h",
    "template_util.h",
    "thread_annotations.h",
    "thread_checker.h",
    "thread_checker_impl.cc",
    "thread_checker_impl.h",
    "timeutils.cc",
    "timeutils.h",
    "trace_event.h",
  ]
}

static_library("rtc_base") {
  cflags = []
  cflags_cc = []
  libs = []
  deps = [
    ":rtc_base_approved",
  ]

  configs += [
    "..:common_config",
    ":rtc_base_config",
  ]

  public_configs = [
    "..:common_inherited_config",
    ":rtc_base_config",
  ]

  defines = [
    "LOGGING=1",
  ]

  sources = [
    "arraysize.h",
    "asyncfile.cc",
    "asyncfile.h",
    "asynchttprequest.cc",
    "asynchttprequest.h",
    "asyncpacketsocket.cc",
    "asyncpacketsocket.h",
    "asyncresolverinterface.cc",
    "asyncresolverinterface.h",
    "asyncsocket.cc",
    "asyncsocket.h",
    "asynctcpsocket.cc",
    "asynctcpsocket.h",
    "asyncudpsocket.cc",
    "asyncudpsocket.h",
    "autodetectproxy.cc",
    "autodetectproxy.h",
    "base64.cc",
    "base64.h",
    "basicdefs.h",
    "buffer.cc",
    "buffer.h",
    "bytebuffer.cc",
    "bytebuffer.h",
    "byteorder.h",
    "common.cc",
    "common.h",
    "cpumonitor.cc",
    "cpumonitor.h",
    "crc32.cc",
    "crc32.h",
    "criticalsection.cc",
    "criticalsection.h",
    "cryptstring.cc",
    "cryptstring.h",
    "diskcache.cc",
    "diskcache.h",
    "fileutils.cc",
    "fileutils.h",
    "firewallsocketserver.cc",
    "firewallsocketserver.h",
    "flags.cc",
    "flags.h",
    "format_macros.h",
    "gunit_prod.h",
    "helpers.cc",
    "helpers.h",
    "httpbase.cc",
    "httpbase.h",
    "httpclient.cc",
    "httpclient.h",
    "httpcommon-inl.h",
    "httpcommon.cc",
    "httpcommon.h",
    "httprequest.cc",
    "httprequest.h",
    "iosfilesystem.mm",
    "ipaddress.cc",
    "ipaddress.h",
    "linked_ptr.h",
    "mathutils.h",
    "messagedigest.cc",
    "messagedigest.h",
    "messagehandler.cc",
    "messagehandler.h",
    "messagequeue.cc",
    "messagequeue.h",
    "nethelpers.cc",
    "nethelpers.h",
    "network.cc",
    "network.h",
    "nullsocketserver.h",
    "pathutils.cc",
    "pathutils.h",
    "physicalsocketserver.cc",
    "physicalsocketserver.h",
    "proxydetect.cc",
    "proxydetect.h",
    "proxyinfo.cc",
    "proxyinfo.h",
    "ratelimiter.cc",
    "ratelimiter.h",
    "ratetracker.cc",
    "ratetracker.h",
    "scoped_autorelease_pool.h",
    "scoped_autorelease_pool.mm",
    "scoped_ptr.h",
    "sha1.cc",
    "sha1.h",
    "sha1digest.cc",
    "sha1digest.h",
    "signalthread.cc",
    "signalthread.h",
    "sigslot.cc",
    "sigslot.h",
    "sigslotrepeater.h",
    "socket.h",
    "socketadapters.cc",
    "socketadapters.h",
    "socketaddress.cc",
    "socketaddress.h",
    "socketaddresspair.cc",
    "socketaddresspair.h",
    "socketfactory.h",
    "socketpool.cc",
    "socketpool.h",
    "socketserver.h",
    "socketstream.cc",
    "socketstream.h",
    "ssladapter.cc",
    "ssladapter.h",
    "sslfingerprint.cc",
    "sslfingerprint.h",
    "sslidentity.cc",
    "sslidentity.h",
    "sslsocketfactory.cc",
    "sslsocketfactory.h",
    "sslstreamadapter.cc",
    "sslstreamadapter.h",
    "sslstreamadapterhelper.cc",
    "sslstreamadapterhelper.h",
    "stream.cc",
    "stream.h",
    "systeminfo.cc",
    "systeminfo.h",
    "task.cc",
    "task.h",
    "taskparent.cc",
    "taskparent.h",
    "taskrunner.cc",
    "taskrunner.h",
    "thread.cc",
    "thread.h",
    "timing.cc",
    "timing.h",
    "urlencode.cc",
    "urlencode.h",
    "worker.cc",
    "worker.h",
  ]

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

  if (build_with_chromium) {
    sources += [
      "../overrides/webrtc/base/basictypes.h",
      "../overrides/webrtc/base/constructormagic.h",
      "../overrides/webrtc/base/logging.cc",
      "../overrides/webrtc/base/logging.h",
    ]

    deps += [ "..:webrtc_common" ]

    if (is_win) {
      sources += [ "../overrides/webrtc/base/win32socketinit.cc" ]
    }

    include_dirs = [
      "../overrides",
      "../../boringssl/src/include",
    ]

    public_configs += [ ":rtc_base_chromium_config" ]
  } else {
    sources += [
      "asyncinvoker.cc",
      "asyncinvoker.h",
      "asyncinvoker-inl.h",
      "atomicops.h",
      "bandwidthsmoother.cc",
      "bandwidthsmoother.h",
      "basictypes.h",
      "bind.h",
      "bind.h.pump",
      "callback.h",
      "callback.h.pump",
      "constructormagic.h",
      "filelock.cc",
      "filelock.h",
      "fileutils_mock.h",
      "genericslot.h",
      "genericslot.h.pump",
      "httpserver.cc",
      "httpserver.h",
      "json.cc",
      "json.h",
      "logging.cc",
      "logging.h",
      "mathutils.h",
      "multipart.cc",
      "multipart.h",
      "natserver.cc",
      "natserver.h",
      "natsocketfactory.cc",
      "natsocketfactory.h",
      "nattypes.cc",
      "nattypes.h",
      "optionsfile.cc",
      "optionsfile.h",
      "profiler.cc",
      "profiler.h",
      "proxyserver.cc",
      "proxyserver.h",
      "refcount.h",
      "referencecountedsingletonfactory.h",
      "rollingaccumulator.h",
      "scopedptrcollection.h",
      "scoped_ref_ptr.h",
      "sec_buffer.h",
      "sharedexclusivelock.cc",
      "sharedexclusivelock.h",
      "sslconfig.h",
      "sslroots.h",
      "testclient.cc",
      "testclient.h",
      "transformadapter.cc",
      "transformadapter.h",
      "versionparsing.cc",
      "versionparsing.h",
      "virtualsocketserver.cc",
      "virtualsocketserver.h",
      "window.h",
      "windowpickerfactory.h",
      "windowpicker.h",
    ]

    deps += [ "..:webrtc_common" ]

    if (is_posix) {
      sources += [
        "latebindingsymboltable.cc",
        "latebindingsymboltable.cc.def",
        "latebindingsymboltable.h",
        "latebindingsymboltable.h.def",
        "posix.cc",
        "posix.h",
      ]
    }

    if (is_linux) {
      sources += [
        "dbus.cc",
        "dbus.h",
        "libdbusglibsymboltable.cc",
        "libdbusglibsymboltable.h",
        "linuxfdwalk.c",
        "linuxfdwalk.h",
      ]
    }

    if (is_mac) {
      sources += [
        "macasyncsocket.cc",
        "macasyncsocket.h",
        "maccocoasocketserver.h",
        "maccocoasocketserver.mm",
        "macsocketserver.cc",
        "macsocketserver.h",
        "macwindowpicker.cc",
        "macwindowpicker.h",
      ]
    }

    if (is_win) {
      sources += [
        "diskcache_win32.cc",
        "diskcache_win32.h",
        "win32regkey.cc",
        "win32regkey.h",
        "win32socketinit.cc",
        "win32socketinit.h",
        "win32socketserver.cc",
        "win32socketserver.h",
      ]
    }
    if (rtc_build_json) {
      deps += [ "//third_party/jsoncpp" ]
    } else {
      include_dirs += [ rtc_jsoncpp_root ]

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

  # TODO(henrike): issue 3307, make rtc_base build with the Chromium default
  # compiler settings.
  configs -= [ "//build/config/compiler:chromium_code" ]
  configs += [ "//build/config/compiler:no_chromium_code" ]
  if (!is_win) {
    cflags += [ "-Wno-uninitialized" ]
    cflags_cc += [ "-Wno-non-virtual-dtor" ]
  }

  if (use_openssl) {
    public_configs += [ ":openssl_config" ]
    if (rtc_build_ssl) {
      deps += [ "//third_party/boringssl" ]
    } else {
      configs += [ "external_ssl_library" ]
    }
    sources += [
      "openssl.h",
      "openssladapter.cc",
      "openssladapter.h",
      "openssldigest.cc",
      "openssldigest.h",
      "opensslidentity.cc",
      "opensslidentity.h",
      "opensslstreamadapter.cc",
      "opensslstreamadapter.h",
    ]
  } else {
    public_configs += [ ":nss_config" ]
    if (rtc_build_ssl) {
      if (build_with_chromium) {
        deps += [ "//crypto:platform" ]
      } else {
        deps += [ "//net/third_party/nss/ssl:libssl" ]
        if (is_linux) {
          deps += [ ":linux_system_ssl" ]
        } else {
          deps += [
            "//third_party/nss:nspr",
            "//third_party/nss:nss",
          ]
        }
      }
    } else {
      configs += [ "external_ssl_library" ]
    }
    sources += [
      "nssidentity.cc",
      "nssidentity.h",
      "nssstreamadapter.cc",
      "nssstreamadapter.h",
    ]
  }

  if (is_android) {
    sources += [
      "ifaddrs-android.cc",
      "ifaddrs-android.h",
    ]

    libs += [
      "log",
      "GLESv2"
    ]
  }

  if (is_ios) {
    all_dependent_configs += [ ":ios_config" ]
  }

  if (use_x11) {
    sources += [
      "x11windowpicker.cc",
      "x11windowpicker.h",
    ]
    libs += [
      "dl",
      "rt",
      "Xext",
      "X11",
      "Xcomposite",
      "Xrender",
    ]
  }

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

  if (is_mac) {
    sources += [
      "maccocoathreadhelper.h",
      "maccocoathreadhelper.mm",
      "macconversion.cc",
      "macconversion.h",
      "macutils.cc",
      "macutils.h",
    ]

    all_dependent_configs = [ ":mac_config" ]

    if (current_cpu == "x86") {
      all_dependent_configs += [ ":mac_x86_config" ]
    }
  }

  if (is_win) {
    sources += [
      "schanneladapter.cc",
      "schanneladapter.h",
      "win32.cc",
      "win32.h",
      "win32filesystem.cc",
      "win32filesystem.h",
      "win32securityerrors.cc",
      "win32window.cc",
      "win32window.h",
      "win32windowpicker.cc",
      "win32windowpicker.h",
      "winfirewall.cc",
      "winfirewall.h",
      "winping.cc",
      "winping.h",
    ]

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

    cflags += [
      # Suppress warnings about WIN32_LEAN_AND_MEAN.
      "/wd4005",
      "/wd4703",
    ]

    defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
  }

  if (is_posix && is_debug) {
    # The Chromium build/common.gypi defines this for all posix
    # _except_ for ios & mac.  We want it there as well, e.g.
    # because ASSERT and friends trigger off of it.
    defines += [ "_DEBUG" ]
  }

  if (is_ios || (is_mac && current_cpu != "x86")) {
    defines += [ "CARBON_DEPRECATED=YES" ]
  }

  if (is_linux || is_android) {
    sources += [
      "linux.cc",
      "linux.h",
    ]
  }
}
