Reland of Moving webrtc.gni up one level from build/ (patchset #1 id:1 of https://codereview.webrtc.org/2657563002/ )
Reason for revert:
Starting to work on a fix (it seems that there are third_party dependencies that depends on the path to the webrtc.gni file)
Original issue's description:
> Revert of Moving webrtc.gni up one level from build/ (patchset #1 id:1 of https://codereview.webrtc.org/2651543003/ )
>
> Reason for revert:
> This was causing the following failure: https://build.chromium.org/p/chromium.webrtc.fyi/builders/Android%20Builder/builds/838/steps/generate_build_files/logs/stdio
>
> Original issue's description:
> > Moving webrtc.gni up one level from build/
> >
> > BUG=webrtc:7030
> >
> > Review-Url: https://codereview.webrtc.org/2651543003
> > Cr-Commit-Position: refs/heads/master@{#16241}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/35a32700fc9b5d932ddbd528c12f59c3274e4774
>
> TBR=kjellander@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7030
>
> Review-Url: https://codereview.webrtc.org/2657563002
> Cr-Commit-Position: refs/heads/master@{#16244}
> Committed: https://chromium.googlesource.com/external/webrtc/+/69dc7dbe247ead087f3bae0eb7e23f27f0de1ec3
TBR=kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7030
Review-Url: https://codereview.webrtc.org/2654773002
Cr-Commit-Position: refs/heads/master@{#16247}
diff --git a/BUILD.gn b/BUILD.gn
index 62e06ad..4e6816f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("webrtc/build/webrtc.gni")
+import("webrtc/webrtc.gni")
group("default") {
testonly = true
diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn
index c3ff51d..d99dc4d 100644
--- a/webrtc/BUILD.gn
+++ b/webrtc/BUILD.gn
@@ -10,7 +10,7 @@
import("//build/config/linux/pkg_config.gni")
import("//build/config/sanitizers/sanitizers.gni")
-import("build/webrtc.gni")
+import("webrtc.gni")
import("//third_party/protobuf/proto_library.gni")
if (is_android) {
import("//build/config/android/config.gni")
diff --git a/webrtc/api/BUILD.gn b/webrtc/api/BUILD.gn
index af49219..038766a 100644
--- a/webrtc/api/BUILD.gn
+++ b/webrtc/api/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
diff --git a/webrtc/audio/BUILD.gn b/webrtc/audio/BUILD.gn
index 9ded96f..80d5416 100644
--- a/webrtc/audio/BUILD.gn
+++ b/webrtc/audio/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
rtc_static_library("audio") {
sources = [
diff --git a/webrtc/audio/utility/BUILD.gn b/webrtc/audio/utility/BUILD.gn
index df5f322..2ef5eba 100644
--- a/webrtc/audio/utility/BUILD.gn
+++ b/webrtc/audio/utility/BUILD.gn
@@ -5,7 +5,7 @@
# 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/webrtc.gni")
+import("../../webrtc.gni")
group("utility") {
public_deps = [
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn
index 248ef13..13ad5fd 100644
--- a/webrtc/base/BUILD.gn
+++ b/webrtc/base/BUILD.gn
@@ -8,7 +8,7 @@
import("//build/config/crypto.gni")
import("//build/config/ui.gni")
-import("../build/webrtc.gni")
+import("../webrtc.gni")
if (is_android) {
import("//build/config/android/config.gni")
diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni
index d179ed4..04bab46 100644
--- a/webrtc/build/webrtc.gni
+++ b/webrtc/build/webrtc.gni
@@ -1,4 +1,4 @@
-# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
+# Copyright (c) 2017 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
@@ -6,320 +6,4 @@
# 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_overrides/build.gni")
-import("//testing/test.gni")
-
-declare_args() {
- # Disable this to avoid building the Opus audio codec.
- rtc_include_opus = true
-
- # Enable this to let the Opus audio codec change complexity on the fly.
- rtc_opus_variable_complexity = false
-
- # Disable to use absolute header paths for some libraries.
- rtc_relative_path = true
-
- # 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
-
- # Disable these to not build components which can be externally provided.
- rtc_build_expat = true
- rtc_build_json = true
- rtc_build_libjpeg = true
- rtc_build_libsrtp = true
- rtc_build_libvpx = true
- rtc_libvpx_build_vp9 = true
- rtc_build_libyuv = 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 = ""
-
- # Enable libevent task queues on platforms that support it.
- 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 = proprietary_codecs && !is_android && !is_ios
-
- # Determines whether QUIC code will be built.
- rtc_use_quic = false
-
- # 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, 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() {
- # Include the iLBC audio codec?
- rtc_include_ilbc = !(build_with_chromium || build_with_mozilla)
-
- 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_libyuv_dir = "//third_party/libyuv"
-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
-
-###############################################################################
-# Templates
-#
-
-# Points to //webrtc/ 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" ]
-
-# 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 = []
-}
-
-template("rtc_test") {
- test(target_name) {
- forward_variables_from(invoker,
- "*",
- [
- "configs",
- "public_configs",
- "suppressed_configs",
- ])
- 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_source_set") {
- source_set(target_name) {
- forward_variables_from(invoker,
- "*",
- [
- "configs",
- "public_configs",
- "suppressed_configs",
- ])
- 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",
- ])
- configs += invoker.configs
- configs -= rtc_remove_configs
- configs -= invoker.suppressed_configs
- deps = [
- "//build/config/sanitizers: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",
- ])
- 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",
- ])
- 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
- }
- }
-}
+import("../webrtc.gni")
diff --git a/webrtc/call/BUILD.gn b/webrtc/call/BUILD.gn
index 195c37f..acad72d 100644
--- a/webrtc/call/BUILD.gn
+++ b/webrtc/call/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
rtc_source_set("call_interfaces") {
sources = [
diff --git a/webrtc/common_audio/BUILD.gn b/webrtc/common_audio/BUILD.gn
index 2d46f67..a3cf046 100644
--- a/webrtc/common_audio/BUILD.gn
+++ b/webrtc/common_audio/BUILD.gn
@@ -7,7 +7,7 @@
# be found in the AUTHORS file in the root of the source tree.
import("//build/config/arm.gni")
-import("../build/webrtc.gni")
+import("../webrtc.gni")
config("common_audio_config") {
include_dirs = [
diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn
index 3b33bcc..1c13fa4 100644
--- a/webrtc/common_video/BUILD.gn
+++ b/webrtc/common_video/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
config("common_video_config") {
include_dirs = [
diff --git a/webrtc/examples/BUILD.gn b/webrtc/examples/BUILD.gn
index 6f7eaa7..dfe15d1 100644
--- a/webrtc/examples/BUILD.gn
+++ b/webrtc/examples/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
diff --git a/webrtc/logging/BUILD.gn b/webrtc/logging/BUILD.gn
index 792eb93..fd0caca 100644
--- a/webrtc/logging/BUILD.gn
+++ b/webrtc/logging/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
import("//third_party/protobuf/proto_library.gni")
if (is_android) {
import("//build/config/android/config.gni")
diff --git a/webrtc/media/BUILD.gn b/webrtc/media/BUILD.gn
index 7f8a1f6..06aed45 100644
--- a/webrtc/media/BUILD.gn
+++ b/webrtc/media/BUILD.gn
@@ -7,7 +7,7 @@
# be found in the AUTHORS file in the root of the source tree.
import("//build/config/linux/pkg_config.gni")
-import("../build/webrtc.gni")
+import("../webrtc.gni")
group("media") {
public_deps = [
diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn
index d87e7f9..e44b35f 100644
--- a/webrtc/modules/BUILD.gn
+++ b/webrtc/modules/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
import("audio_coding/audio_coding.gni")
group("modules") {
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index 044d57e..4046373 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
import("audio_coding.gni")
import("//build/config/arm.gni")
import("//third_party/protobuf/proto_library.gni")
diff --git a/webrtc/modules/audio_coding/audio_coding.gni b/webrtc/modules/audio_coding/audio_coding.gni
index 13577f8..0f3a75f 100644
--- a/webrtc/modules/audio_coding/audio_coding.gni
+++ b/webrtc/modules/audio_coding/audio_coding.gni
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
audio_codec_defines = []
if (rtc_include_ilbc) {
diff --git a/webrtc/modules/audio_conference_mixer/BUILD.gn b/webrtc/modules/audio_conference_mixer/BUILD.gn
index b4705d5..428bcac 100644
--- a/webrtc/modules/audio_conference_mixer/BUILD.gn
+++ b/webrtc/modules/audio_conference_mixer/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
config("audio_conference_mixer_config") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
diff --git a/webrtc/modules/audio_device/BUILD.gn b/webrtc/modules/audio_device/BUILD.gn
index 4dc6760..ac8fdbe 100644
--- a/webrtc/modules/audio_device/BUILD.gn
+++ b/webrtc/modules/audio_device/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
if (is_android) {
import("//build/config/android/config.gni")
diff --git a/webrtc/modules/audio_mixer/BUILD.gn b/webrtc/modules/audio_mixer/BUILD.gn
index 25c782b..083e02b 100644
--- a/webrtc/modules/audio_mixer/BUILD.gn
+++ b/webrtc/modules/audio_mixer/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
group("audio_mixer") {
public_deps = [
diff --git a/webrtc/modules/audio_processing/BUILD.gn b/webrtc/modules/audio_processing/BUILD.gn
index 4f3ea13..87501f4 100644
--- a/webrtc/modules/audio_processing/BUILD.gn
+++ b/webrtc/modules/audio_processing/BUILD.gn
@@ -8,7 +8,7 @@
import("//build/config/arm.gni")
import("//third_party/protobuf/proto_library.gni")
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
declare_args() {
# Disables the usual mode where we trust the reported system delay
diff --git a/webrtc/modules/bitrate_controller/BUILD.gn b/webrtc/modules/bitrate_controller/BUILD.gn
index b2747db..58398f3 100644
--- a/webrtc/modules/bitrate_controller/BUILD.gn
+++ b/webrtc/modules/bitrate_controller/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
rtc_static_library("bitrate_controller") {
# TODO(mbonadei): Remove (bugs.webrtc.org/6828)
diff --git a/webrtc/modules/congestion_controller/BUILD.gn b/webrtc/modules/congestion_controller/BUILD.gn
index 03e0d5c..a20339c 100644
--- a/webrtc/modules/congestion_controller/BUILD.gn
+++ b/webrtc/modules/congestion_controller/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
rtc_static_library("congestion_controller") {
sources = [
diff --git a/webrtc/modules/desktop_capture/BUILD.gn b/webrtc/modules/desktop_capture/BUILD.gn
index 67ec8ce..9c9a466 100644
--- a/webrtc/modules/desktop_capture/BUILD.gn
+++ b/webrtc/modules/desktop_capture/BUILD.gn
@@ -7,7 +7,7 @@
# be found in the AUTHORS file in the root of the source tree.
import("//build/config/ui.gni")
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
use_desktop_capture_differ_sse2 = current_cpu == "x86" || current_cpu == "x64"
diff --git a/webrtc/modules/media_file/BUILD.gn b/webrtc/modules/media_file/BUILD.gn
index 8003cd8..32825af 100644
--- a/webrtc/modules/media_file/BUILD.gn
+++ b/webrtc/modules/media_file/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
config("media_file_config") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
diff --git a/webrtc/modules/pacing/BUILD.gn b/webrtc/modules/pacing/BUILD.gn
index 0a357c0..f94def7 100644
--- a/webrtc/modules/pacing/BUILD.gn
+++ b/webrtc/modules/pacing/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
rtc_static_library("pacing") {
sources = [
diff --git a/webrtc/modules/remote_bitrate_estimator/BUILD.gn b/webrtc/modules/remote_bitrate_estimator/BUILD.gn
index 81028f6..13e2382 100644
--- a/webrtc/modules/remote_bitrate_estimator/BUILD.gn
+++ b/webrtc/modules/remote_bitrate_estimator/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
rtc_static_library("remote_bitrate_estimator") {
# TODO(mbonadei): Remove (bugs.webrtc.org/6828)
diff --git a/webrtc/modules/rtp_rtcp/BUILD.gn b/webrtc/modules/rtp_rtcp/BUILD.gn
index 9b23621..4fa4d49 100644
--- a/webrtc/modules/rtp_rtcp/BUILD.gn
+++ b/webrtc/modules/rtp_rtcp/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
rtc_static_library("rtp_rtcp") {
sources = [
diff --git a/webrtc/modules/utility/BUILD.gn b/webrtc/modules/utility/BUILD.gn
index 5b6a232..ec11b9f 100644
--- a/webrtc/modules/utility/BUILD.gn
+++ b/webrtc/modules/utility/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
rtc_static_library("utility") {
sources = [
diff --git a/webrtc/modules/video_capture/BUILD.gn b/webrtc/modules/video_capture/BUILD.gn
index 6887552..90b824a 100644
--- a/webrtc/modules/video_capture/BUILD.gn
+++ b/webrtc/modules/video_capture/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
# Note this target is missing an implementation for the video capture.
# Targets must link with either 'video_capture' or
diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn
index f84936a..5750d10 100644
--- a/webrtc/modules/video_coding/BUILD.gn
+++ b/webrtc/modules/video_coding/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
rtc_static_library("video_coding") {
sources = [
diff --git a/webrtc/modules/video_processing/BUILD.gn b/webrtc/modules/video_processing/BUILD.gn
index 5da0ae8..6da43b4 100644
--- a/webrtc/modules/video_processing/BUILD.gn
+++ b/webrtc/modules/video_processing/BUILD.gn
@@ -7,7 +7,7 @@
# be found in the AUTHORS file in the root of the source tree.
import("//build/config/arm.gni")
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
build_video_processing_sse2 = current_cpu == "x86" || current_cpu == "x64"
diff --git a/webrtc/p2p/BUILD.gn b/webrtc/p2p/BUILD.gn
index e99440c..04e9b17 100644
--- a/webrtc/p2p/BUILD.gn
+++ b/webrtc/p2p/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
group("p2p") {
public_deps = [
diff --git a/webrtc/pc/BUILD.gn b/webrtc/pc/BUILD.gn
index d447db7..5aa3ae4 100644
--- a/webrtc/pc/BUILD.gn
+++ b/webrtc/pc/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
diff --git a/webrtc/sdk/BUILD.gn b/webrtc/sdk/BUILD.gn
index e610242..9f3ccc6 100644
--- a/webrtc/sdk/BUILD.gn
+++ b/webrtc/sdk/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
if (is_ios) {
import("//build/config/ios/rules.gni")
}
diff --git a/webrtc/sdk/android/BUILD.gn b/webrtc/sdk/android/BUILD.gn
index 1df43e2..710d962 100644
--- a/webrtc/sdk/android/BUILD.gn
+++ b/webrtc/sdk/android/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("//webrtc/build/webrtc.gni")
+import("//webrtc/webrtc.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
diff --git a/webrtc/stats/BUILD.gn b/webrtc/stats/BUILD.gn
index 8fa8087..85ba21d 100644
--- a/webrtc/stats/BUILD.gn
+++ b/webrtc/stats/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
group("stats") {
public_deps = [
diff --git a/webrtc/system_wrappers/BUILD.gn b/webrtc/system_wrappers/BUILD.gn
index 745867b..96177fd 100644
--- a/webrtc/system_wrappers/BUILD.gn
+++ b/webrtc/system_wrappers/BUILD.gn
@@ -10,7 +10,7 @@
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
}
-import("../build/webrtc.gni")
+import("../webrtc.gni")
rtc_static_library("system_wrappers") {
sources = [
diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn
index 5ad85fc..9893814 100644
--- a/webrtc/test/BUILD.gn
+++ b/webrtc/test/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
import("//build/config/ui.gni")
if (is_android) {
import("//build/config/android/rules.gni")
diff --git a/webrtc/test/fuzzers/BUILD.gn b/webrtc/test/fuzzers/BUILD.gn
index ea2352a..031ed8b 100644
--- a/webrtc/test/fuzzers/BUILD.gn
+++ b/webrtc/test/fuzzers/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../../build/webrtc.gni")
+import("../../webrtc.gni")
import("//build/config/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
diff --git a/webrtc/tools/BUILD.gn b/webrtc/tools/BUILD.gn
index 8773cfc..46a0ede 100644
--- a/webrtc/tools/BUILD.gn
+++ b/webrtc/tools/BUILD.gn
@@ -7,7 +7,7 @@
# be found in the AUTHORS file in the root of the source tree.
import("//third_party/protobuf/proto_library.gni")
-import("../build/webrtc.gni")
+import("../webrtc.gni")
group("tools") {
# This target shall build all targets in tools/.
diff --git a/webrtc/video/BUILD.gn b/webrtc/video/BUILD.gn
index ed69526..48dff5b 100644
--- a/webrtc/video/BUILD.gn
+++ b/webrtc/video/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
rtc_static_library("video") {
sources = [
diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn
index c29e646..cb97693 100644
--- a/webrtc/voice_engine/BUILD.gn
+++ b/webrtc/voice_engine/BUILD.gn
@@ -6,7 +6,7 @@
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
-import("../build/webrtc.gni")
+import("../webrtc.gni")
rtc_static_library("audio_coder") {
sources = [
diff --git a/webrtc/webrtc.gni b/webrtc/webrtc.gni
new file mode 100644
index 0000000..53dcae2
--- /dev/null
+++ b/webrtc/webrtc.gni
@@ -0,0 +1,325 @@
+# 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_overrides/build.gni")
+import("//testing/test.gni")
+
+declare_args() {
+ # Disable this to avoid building the Opus audio codec.
+ rtc_include_opus = true
+
+ # Enable this to let the Opus audio codec change complexity on the fly.
+ rtc_opus_variable_complexity = false
+
+ # Disable to use absolute header paths for some libraries.
+ rtc_relative_path = true
+
+ # 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
+
+ # Disable these to not build components which can be externally provided.
+ rtc_build_expat = true
+ rtc_build_json = true
+ rtc_build_libjpeg = true
+ rtc_build_libsrtp = true
+ rtc_build_libvpx = true
+ rtc_libvpx_build_vp9 = true
+ rtc_build_libyuv = 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 = ""
+
+ # Enable libevent task queues on platforms that support it.
+ 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 = proprietary_codecs && !is_android && !is_ios
+
+ # Determines whether QUIC code will be built.
+ rtc_use_quic = false
+
+ # 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, 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() {
+ # Include the iLBC audio codec?
+ rtc_include_ilbc = !(build_with_chromium || build_with_mozilla)
+
+ 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_libyuv_dir = "//third_party/libyuv"
+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
+
+###############################################################################
+# Templates
+#
+
+# Points to //webrtc/ 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" ]
+
+# 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 = []
+}
+
+template("rtc_test") {
+ test(target_name) {
+ forward_variables_from(invoker,
+ "*",
+ [
+ "configs",
+ "public_configs",
+ "suppressed_configs",
+ ])
+ 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_source_set") {
+ source_set(target_name) {
+ forward_variables_from(invoker,
+ "*",
+ [
+ "configs",
+ "public_configs",
+ "suppressed_configs",
+ ])
+ 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",
+ ])
+ configs += invoker.configs
+ configs -= rtc_remove_configs
+ configs -= invoker.suppressed_configs
+ deps = [
+ "//build/config/sanitizers: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",
+ ])
+ 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",
+ ])
+ 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
+ }
+ }
+}