# 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/arm.gni")
import("//build/config/features.gni")
import("//build/config/mips.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//build_overrides/build.gni")
import("//testing/test.gni")

if (!build_with_chromium && is_component_build) {
  print("The Gn argument `is_component_build` is currently " +
        "ignored for WebRTC builds.")
  print("Component builds are supported by Chromium and the argument " +
        "`is_component_build` makes it possible to create shared libraries " +
        "instead of static libraries.")
  print("If an app depends on WebRTC it makes sense to just depend on the " +
        "WebRTC static library, so there is no difference between " +
        "`is_component_build=true` and `is_component_build=false`.")
  print(
      "More info about component builds at: " + "https://chromium.googlesource.com/chromium/src/+/master/docs/component_build.md")
  assert(!is_component_build, "Component builds are not supported in WebRTC.")
}

if (is_ios) {
  import("//build/config/ios/rules.gni")
}

declare_args() {
  # Include the iLBC audio codec?
  rtc_include_ilbc = true

  # Disable this to avoid building the Opus audio codec.
  rtc_include_opus = true

  # Enable this if the Opus version upon which WebRTC is built supports direct
  # encoding of 120 ms packets.
  rtc_opus_support_120ms_ptime = true

  # Enable this to let the Opus audio codec change complexity on the fly.
  rtc_opus_variable_complexity = false

  # Used to specify an external Jsoncpp include path when not compiling the
  # library that comes with WebRTC (i.e. rtc_build_json == 0).
  rtc_jsoncpp_root = "//third_party/jsoncpp/source/include"

  # Used to specify an external OpenSSL include path when not compiling the
  # library that comes with WebRTC (i.e. rtc_build_ssl == 0).
  rtc_ssl_root = ""

  # Selects fixed-point code where possible.
  rtc_prefer_fixed_point = false

  # Enables the use of protocol buffers for debug recordings.
  rtc_enable_protobuf = true

  # Disable the code for the intelligibility enhancer by default.
  rtc_enable_intelligibility_enhancer = false

  # Enable when an external authentication mechanism is used for performing
  # packet authentication for RTP packets instead of libsrtp.
  rtc_enable_external_auth = build_with_chromium

  # Selects whether debug dumps for the audio processing module
  # should be generated.
  apm_debug_dump = false

  # Set this to true to enable BWE test logging.
  rtc_enable_bwe_test_logging = false

  # Set this to disable building with support for SCTP data channels.
  rtc_enable_sctp = true

  # Set this to false to skip building examples.
  rtc_build_examples = true

  # Set this to false to skip building tools.
  rtc_build_tools = true

  # Set this to false to skip building code that requires X11.
  rtc_use_x11 = use_x11

  # Disable these to not build components which can be externally provided.
  rtc_build_json = true
  rtc_build_libsrtp = true
  rtc_build_libvpx = true
  rtc_libvpx_build_vp9 = true
  rtc_build_openmax_dl = true
  rtc_build_opus = true
  rtc_build_ssl = true
  rtc_build_usrsctp = true

  # Enable to use the Mozilla internal settings.
  build_with_mozilla = false

  rtc_enable_android_opensl = false

  # Link-Time Optimizations.
  # Executes code generation at link-time instead of compile-time.
  # https://gcc.gnu.org/wiki/LinkTimeOptimization
  rtc_use_lto = false

  # Set to "func", "block", "edge" for coverage generation.
  # At unit test runtime set UBSAN_OPTIONS="coverage=1".
  # It is recommend to set include_examples=0.
  # Use llvm's sancov -html-report for human readable reports.
  # See http://clang.llvm.org/docs/SanitizerCoverage.html .
  rtc_sanitize_coverage = ""

  # Links a default implementation of task queues to targets
  # that depend on the target rtc_task_queue. Set to false to
  # use an external implementation.
  rtc_link_task_queue_impl = true

  # Enable libevent task queues on platforms that support it.
  # rtc_link_task_queue_impl must be set to true for this to
  # have an effect.
  if (is_win || is_mac || is_ios || is_nacl) {
    rtc_enable_libevent = false
    rtc_build_libevent = false
  } else {
    rtc_enable_libevent = true
    rtc_build_libevent = true
  }

  if (current_cpu == "arm" || current_cpu == "arm64") {
    rtc_prefer_fixed_point = true
  }

  if (!is_ios && (current_cpu != "arm" || arm_version >= 7) &&
      current_cpu != "mips64el") {
    rtc_use_openmax_dl = true
  } else {
    rtc_use_openmax_dl = false
  }

  # Determines whether NEON code will be built.
  rtc_build_with_neon =
      (current_cpu == "arm" && arm_use_neon) || current_cpu == "arm64"

  # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on
  # all platforms except Android and iOS. Because FFmpeg can be built
  # with/without H.264 support, |ffmpeg_branding| has to separately be set to a
  # value that includes H.264, for example "Chrome". If FFmpeg is built without
  # H.264, compilation succeeds but |H264DecoderImpl| fails to initialize. See
  # also: |rtc_initialize_ffmpeg|.
  # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
  # http://www.openh264.org, https://www.ffmpeg.org/
  rtc_use_h264 =
      is_chrome_branded && proprietary_codecs && !is_android && !is_ios

  # By default, use normal platform audio support or dummy audio, but don't
  # use file-based audio playout and record.
  rtc_use_dummy_audio_file_devices = false

  # When set to true, replace the audio output with a sinus tone at 440Hz.
  # The ADM will ask for audio data from WebRTC but instead of reading real
  # audio samples from NetEQ, a sinus tone will be generated and replace the
  # real audio samples.
  rtc_audio_device_plays_sinus_tone = false

  # When set to true, test targets will declare the files needed to run memcheck
  # as data dependencies. This is to enable memcheck execution on swarming bots.
  rtc_use_memcheck = false

  # FFmpeg must be initialized for |H264DecoderImpl| to work. This can be done
  # by WebRTC during |H264DecoderImpl::InitDecode| or externally. FFmpeg must
  # only be initialized once. Projects that initialize FFmpeg externally, such
  # as Chromium, must turn this flag off so that WebRTC does not also
  # initialize.
  rtc_initialize_ffmpeg = !build_with_chromium

  # Build sources requiring GTK. NOTICE: This is not present in Chrome OS
  # build environments, even if available for Chromium builds.
  rtc_use_gtk = !build_with_chromium
}

# A second declare_args block, so that declarations within it can
# depend on the possibly overridden variables in the first
# declare_args block.
declare_args() {
  rtc_restrict_logging = build_with_chromium

  # Excluded in Chromium since its prerequisites don't require Pulse Audio.
  rtc_include_pulse_audio = !build_with_chromium

  # Chromium uses its own IO handling, so the internal ADM is only built for
  # standalone WebRTC.
  rtc_include_internal_audio_device = !build_with_chromium

  # Include tests in standalone checkout.
  rtc_include_tests = !build_with_chromium
}

# Make it possible to provide custom locations for some libraries (move these
# up into declare_args should we need to actually use them for the GN build).
rtc_libvpx_dir = "//third_party/libvpx"
rtc_opus_dir = "//third_party/opus"

# Desktop capturer is supported only on Windows, OSX and Linux.
rtc_desktop_capture_supported = is_win || is_mac || (is_linux && rtc_use_x11)

###############################################################################
# Templates
#

# Points to // in webrtc stand-alone or to //third_party/webrtc/ in
# chromium.
# We need absolute paths for all configs in templates as they are shared in
# different subdirectories.
webrtc_root = get_path_info(".", "abspath")

# Global configuration that should be applied to all WebRTC targets.
# You normally shouldn't need to include this in your target as it's
# automatically included when using the rtc_* templates.
# It sets defines, include paths and compilation warnings accordingly,
# both for WebRTC stand-alone builds and for the scenario when WebRTC
# native code is built as part of Chromium.
rtc_common_configs = [ webrtc_root + ":common_config" ]

if (is_mac || is_ios) {
  rtc_common_configs += [ "//build/config/compiler:enable_arc" ]
}

# Global public configuration that should be applied to all WebRTC targets. You
# normally shouldn't need to include this in your target as it's automatically
# included when using the rtc_* templates. It set the defines, include paths and
# compilation warnings that should be propagated to dependents of the targets
# depending on the target having this config.
rtc_common_inherited_config = webrtc_root + ":common_inherited_config"

# Common configs to remove or add in all rtc targets.
rtc_remove_configs = []
rtc_add_configs = rtc_common_configs

set_defaults("rtc_test") {
  configs = rtc_add_configs
  suppressed_configs = []
}

set_defaults("rtc_source_set") {
  configs = rtc_add_configs
  suppressed_configs = []
}

set_defaults("rtc_executable") {
  configs = rtc_add_configs
  suppressed_configs = []
}

set_defaults("rtc_static_library") {
  configs = rtc_add_configs
  suppressed_configs = []
}

set_defaults("rtc_shared_library") {
  configs = rtc_add_configs
  suppressed_configs = []
}

webrtc_default_visibility = [ webrtc_root + "/*" ]
if (build_with_chromium) {
  # Allow Chromium's WebRTC overrides targets to bypass the regular
  # visibility restrictions.
  webrtc_default_visibility += [ webrtc_root + "/../webrtc_overrides/*" ]
}

template("rtc_test") {
  test(target_name) {
    forward_variables_from(invoker,
                           "*",
                           [
                             "configs",
                             "public_configs",
                             "suppressed_configs",
                             "visibility",
                           ])

    # Always override to public because when target_os is Android the `test`
    # template can override it to [ "*" ] and we want to avoid conditional
    # visibility.
    visibility = [ "*" ]
    configs += invoker.configs
    configs -= rtc_remove_configs
    configs -= invoker.suppressed_configs
    public_configs = [ rtc_common_inherited_config ]
    if (defined(invoker.public_configs)) {
      public_configs += invoker.public_configs
    }
    if (!build_with_chromium && is_android) {
      android_manifest = webrtc_root + "test/android/AndroidManifest.xml"
      deps += [ webrtc_root + "test:native_test_java" ]
    }
  }
}

template("rtc_source_set") {
  source_set(target_name) {
    forward_variables_from(invoker,
                           "*",
                           [
                             "configs",
                             "public_configs",
                             "suppressed_configs",
                             "visibility",
                           ])
    forward_variables_from(invoker, [ "visibility" ])
    if (!defined(visibility)) {
      visibility = webrtc_default_visibility
    }
    configs += invoker.configs
    configs -= rtc_remove_configs
    configs -= invoker.suppressed_configs
    public_configs = [ rtc_common_inherited_config ]
    if (defined(invoker.public_configs)) {
      public_configs += invoker.public_configs
    }
  }
}

template("rtc_executable") {
  executable(target_name) {
    forward_variables_from(invoker,
                           "*",
                           [
                             "deps",
                             "configs",
                             "public_configs",
                             "suppressed_configs",
                             "visibility",
                           ])
    forward_variables_from(invoker, [ "visibility" ])
    if (!defined(visibility)) {
      visibility = webrtc_default_visibility
    }
    configs += invoker.configs
    configs -= rtc_remove_configs
    configs -= invoker.suppressed_configs
    deps = [
      "//build/config:exe_and_shlib_deps",
    ]
    deps += invoker.deps

    public_configs = [ rtc_common_inherited_config ]
    if (defined(invoker.public_configs)) {
      public_configs += invoker.public_configs
    }
  }
}

template("rtc_static_library") {
  static_library(target_name) {
    forward_variables_from(invoker,
                           "*",
                           [
                             "configs",
                             "public_configs",
                             "suppressed_configs",
                             "visibility",
                           ])
    forward_variables_from(invoker, [ "visibility" ])
    if (!defined(visibility)) {
      visibility = webrtc_default_visibility
    }
    configs += invoker.configs
    configs -= rtc_remove_configs
    configs -= invoker.suppressed_configs
    public_configs = [ rtc_common_inherited_config ]
    if (defined(invoker.public_configs)) {
      public_configs += invoker.public_configs
    }
  }
}

template("rtc_shared_library") {
  shared_library(target_name) {
    forward_variables_from(invoker,
                           "*",
                           [
                             "configs",
                             "public_configs",
                             "suppressed_configs",
                             "visibility",
                           ])
    forward_variables_from(invoker, [ "visibility" ])
    if (!defined(visibility)) {
      visibility = webrtc_default_visibility
    }
    configs += invoker.configs
    configs -= rtc_remove_configs
    configs -= invoker.suppressed_configs
    public_configs = [ rtc_common_inherited_config ]
    if (defined(invoker.public_configs)) {
      public_configs += invoker.public_configs
    }
  }
}

if (is_ios) {
  set_defaults("rtc_ios_xctest_test") {
    configs = rtc_add_configs
    suppressed_configs = []
  }

  template("rtc_ios_xctest_test") {
    ios_xctest_test(target_name) {
      forward_variables_from(invoker,
                             "*",
                             [
                               "configs",
                               "public_configs",
                               "suppressed_configs",
                               "visibility",
                             ])
      forward_variables_from(invoker, [ "visibility" ])
      if (!defined(visibility)) {
        visibility = webrtc_default_visibility
      }
      configs += invoker.configs
      configs -= rtc_remove_configs
      configs -= invoker.suppressed_configs
      public_configs = [ rtc_common_inherited_config ]
      if (defined(invoker.public_configs)) {
        public_configs += invoker.public_configs
      }
    }
  }

  template("ios_framework_bundle_with_umbrella_header") {
    forward_variables_from(invoker, [ "output_name" ])
    umbrella_header_path =
        "$target_gen_dir/$output_name.framework/Headers/$output_name.h"

    ios_framework_bundle(target_name) {
      forward_variables_from(invoker, "*", [])

      deps += [ ":copy_umbrella_header_$target_name" ]
    }

    action("umbrella_header_$target_name") {
      forward_variables_from(invoker, [ "public_headers" ])

      script = "//tools_webrtc/ios/generate_umbrella_header.py"

      outputs = [
        umbrella_header_path,
      ]
      args = [
               "--out",
               rebase_path(umbrella_header_path, root_build_dir),
               "--sources",
             ] + rebase_path(public_headers, "objc/Framework/Headers/")
    }

    copy("copy_umbrella_header_$target_name") {
      sources = [
        umbrella_header_path,
      ]
      outputs = [
        "$root_out_dir/$output_name.framework/Headers/$output_name.h",
      ]

      deps = [
        ":umbrella_header_$target_name",
      ]
    }
  }

  set_defaults("ios_framework_bundle_with_umbrella_header") {
    configs = default_shared_library_configs
  }
}

if (is_android) {
  template("rtc_android_library") {
    android_library(target_name) {
      forward_variables_from(invoker,
                             "*",
                             [
                               "configs",
                               "public_configs",
                               "suppressed_configs",
                               "visibility",
                             ])

      # Treat warnings as errors.
      javac_args = [ "-Werror" ]

      # TODO(sakal): Fix build hooks crbug.com/webrtc/8168
      no_build_hooks = true
    }
  }

  template("rtc_android_apk") {
    android_apk(target_name) {
      forward_variables_from(invoker,
                             "*",
                             [
                               "configs",
                               "public_configs",
                               "suppressed_configs",
                               "visibility",
                             ])

      # Treat warnings as errors.
      javac_args = [ "-Werror" ]

      # TODO(sakal): Fix build hooks crbug.com/webrtc/8168
      no_build_hooks = true
    }
  }

  template("rtc_instrumentation_test_apk") {
    instrumentation_test_apk(target_name) {
      forward_variables_from(invoker,
                             "*",
                             [
                               "configs",
                               "public_configs",
                               "suppressed_configs",
                               "visibility",
                             ])

      # Treat warnings as errors.
      javac_args = [ "-Werror" ]

      # TODO(sakal): Fix build hooks crbug.com/webrtc/8168
      no_build_hooks = true
    }
  }
}
