2014-06-17 08:54:03 +00:00
|
|
|
# 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.
|
|
|
|
|
|
2014-08-31 20:32:53 +00:00
|
|
|
import("//build/config/arm.gni")
|
2016-02-08 02:57:00 -08:00
|
|
|
import("//build/config/features.gni")
|
2015-01-25 19:17:56 +00:00
|
|
|
import("//build/config/mips.gni")
|
2016-09-02 07:03:15 -07:00
|
|
|
import("//build/config/sanitizers/sanitizers.gni")
|
2015-10-14 08:13:58 +02:00
|
|
|
import("//build_overrides/webrtc.gni")
|
2016-09-02 04:10:34 -07:00
|
|
|
import("//testing/test.gni")
|
2014-08-31 20:32:53 +00:00
|
|
|
|
2014-06-17 08:54:03 +00:00
|
|
|
declare_args() {
|
2014-08-31 20:32:53 +00:00
|
|
|
# Disable this to avoid building the Opus audio codec.
|
2014-09-07 17:36:10 +00:00
|
|
|
rtc_include_opus = true
|
2014-08-31 20:32:53 +00:00
|
|
|
|
Reland of GN: Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc}
The only thing that differs from the previous attempt in
https://codereview.webrtc.org/1979933002/ is that none of
the new targets are not hooked up to the webrtc target in
webrtc/BUILD.gn, which should make it not break the
chromium.webrtc.fyi bots.
Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc} in
preparation for removing src/third_party/libjingle in Chromium.
Changes between previous attempt and the one before that
(https://codereview.webrtc.org/1973313002) are:
* Added libstunprober target
* Adjusted warnings for Chromium's clang plugins
* webrtc/pc/externalhmac.{h,cc} added for Chromium builds.
BUG=webrtc:4256
NOTRY=True
NOPRESUBMIT=True
TBR=perkj@webrtc.org, tommi@webrtc.org
Review-Url: https://codereview.webrtc.org/2037983002
Cr-Commit-Position: refs/heads/master@{#13030}
2016-06-03 03:09:32 -07:00
|
|
|
# Disable to use absolute header paths for some libraries.
|
|
|
|
|
rtc_relative_path = true
|
|
|
|
|
|
2014-09-02 11:22:06 +00:00
|
|
|
# Used to specify an external Jsoncpp include path when not compiling the
|
2014-09-07 17:36:10 +00:00
|
|
|
# library that comes with WebRTC (i.e. rtc_build_json == 0).
|
|
|
|
|
rtc_jsoncpp_root = "//third_party/jsoncpp/source/include"
|
2014-09-02 11:22:06 +00:00
|
|
|
|
|
|
|
|
# Used to specify an external OpenSSL include path when not compiling the
|
2014-09-07 17:36:10 +00:00
|
|
|
# library that comes with WebRTC (i.e. rtc_build_ssl == 0).
|
|
|
|
|
rtc_ssl_root = ""
|
2014-09-02 11:22:06 +00:00
|
|
|
|
2014-06-17 08:54:03 +00:00
|
|
|
# Selects fixed-point code where possible.
|
2014-09-07 17:36:10 +00:00
|
|
|
rtc_prefer_fixed_point = false
|
2014-06-17 08:54:03 +00:00
|
|
|
|
2014-06-21 14:25:16 +00:00
|
|
|
# Enable data logging. Produces text files with data logged within engines
|
|
|
|
|
# which can be easily parsed for offline processing.
|
2014-09-07 17:36:10 +00:00
|
|
|
rtc_enable_data_logging = false
|
2014-06-21 14:25:16 +00:00
|
|
|
|
2014-06-17 08:54:03 +00:00
|
|
|
# Enables the use of protocol buffers for debug recordings.
|
2014-09-07 17:36:10 +00:00
|
|
|
rtc_enable_protobuf = true
|
2014-06-17 08:54:03 +00:00
|
|
|
|
2016-08-26 07:16:04 -07:00
|
|
|
# Disable the code for the intelligibility enhancer by default.
|
|
|
|
|
rtc_enable_intelligibility_enhancer = false
|
|
|
|
|
|
2016-09-01 08:58:21 -07:00
|
|
|
# Selects whether debug dumps for the audio processing module
|
|
|
|
|
# should be generated.
|
|
|
|
|
apm_debug_dump = false
|
|
|
|
|
|
2014-07-03 17:04:12 +00:00
|
|
|
# Disable these to not build components which can be externally provided.
|
2015-04-27 14:39:04 +02:00
|
|
|
rtc_build_expat = true
|
2014-09-07 17:36:10 +00:00
|
|
|
rtc_build_json = true
|
Reland of GN: Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc}
The only thing that differs from the previous attempt in
https://codereview.webrtc.org/1979933002/ is that none of
the new targets are not hooked up to the webrtc target in
webrtc/BUILD.gn, which should make it not break the
chromium.webrtc.fyi bots.
Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc} in
preparation for removing src/third_party/libjingle in Chromium.
Changes between previous attempt and the one before that
(https://codereview.webrtc.org/1973313002) are:
* Added libstunprober target
* Adjusted warnings for Chromium's clang plugins
* webrtc/pc/externalhmac.{h,cc} added for Chromium builds.
BUG=webrtc:4256
NOTRY=True
NOPRESUBMIT=True
TBR=perkj@webrtc.org, tommi@webrtc.org
Review-Url: https://codereview.webrtc.org/2037983002
Cr-Commit-Position: refs/heads/master@{#13030}
2016-06-03 03:09:32 -07:00
|
|
|
rtc_build_libjpeg = true
|
|
|
|
|
rtc_build_libsrtp = true
|
2014-09-07 17:36:10 +00:00
|
|
|
rtc_build_libvpx = true
|
2016-06-13 00:19:48 -07:00
|
|
|
rtc_libvpx_build_vp9 = true
|
2015-04-27 14:39:04 +02:00
|
|
|
rtc_build_libyuv = true
|
2015-04-24 08:46:51 -07:00
|
|
|
rtc_build_openmax_dl = true
|
2015-04-27 14:39:04 +02:00
|
|
|
rtc_build_opus = true
|
|
|
|
|
rtc_build_ssl = true
|
Reland of GN: Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc}
The only thing that differs from the previous attempt in
https://codereview.webrtc.org/1979933002/ is that none of
the new targets are not hooked up to the webrtc target in
webrtc/BUILD.gn, which should make it not break the
chromium.webrtc.fyi bots.
Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc} in
preparation for removing src/third_party/libjingle in Chromium.
Changes between previous attempt and the one before that
(https://codereview.webrtc.org/1973313002) are:
* Added libstunprober target
* Adjusted warnings for Chromium's clang plugins
* webrtc/pc/externalhmac.{h,cc} added for Chromium builds.
BUG=webrtc:4256
NOTRY=True
NOPRESUBMIT=True
TBR=perkj@webrtc.org, tommi@webrtc.org
Review-Url: https://codereview.webrtc.org/2037983002
Cr-Commit-Position: refs/heads/master@{#13030}
2016-06-03 03:09:32 -07:00
|
|
|
rtc_build_usrsctp = true
|
2014-07-03 17:04:12 +00:00
|
|
|
|
2014-06-17 08:54:03 +00:00
|
|
|
# Disable by default.
|
2014-09-07 17:36:10 +00:00
|
|
|
rtc_have_dbus_glib = false
|
2014-06-17 08:54:03 +00:00
|
|
|
|
|
|
|
|
# Enable to use the Mozilla internal settings.
|
|
|
|
|
build_with_mozilla = false
|
|
|
|
|
|
2015-01-12 14:27:23 +00:00
|
|
|
rtc_enable_android_opensl = false
|
2014-06-17 08:54:03 +00:00
|
|
|
|
2014-08-31 20:32:53 +00:00
|
|
|
# Link-Time Optimizations.
|
|
|
|
|
# Executes code generation at link-time instead of compile-time.
|
|
|
|
|
# https://gcc.gnu.org/wiki/LinkTimeOptimization
|
2014-09-07 17:36:10 +00:00
|
|
|
rtc_use_lto = false
|
2014-08-31 20:32:53 +00:00
|
|
|
|
2016-03-11 21:34:24 -08:00
|
|
|
rtc_restrict_logging = true
|
2014-08-28 13:51:08 +00:00
|
|
|
|
2016-07-22 08:57:23 +02:00
|
|
|
# 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 = ""
|
|
|
|
|
|
2016-05-17 03:44:28 -07:00
|
|
|
# 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
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-10 10:21:07 -08:00
|
|
|
if (current_cpu == "arm" || current_cpu == "arm64") {
|
2014-09-07 17:36:10 +00:00
|
|
|
rtc_prefer_fixed_point = true
|
2014-06-17 08:54:03 +00:00
|
|
|
}
|
2014-08-31 20:32:53 +00:00
|
|
|
|
2016-06-01 00:53:36 -07:00
|
|
|
if (!is_ios && (current_cpu != "arm" || arm_version >= 7) &&
|
|
|
|
|
current_cpu != "mips64el") {
|
2014-10-08 18:01:27 +00:00
|
|
|
rtc_use_openmax_dl = true
|
|
|
|
|
} else {
|
|
|
|
|
rtc_use_openmax_dl = false
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-24 18:25:54 -07:00
|
|
|
# Determines whether NEON code will be built.
|
2015-07-09 09:45:04 -07:00
|
|
|
rtc_build_with_neon =
|
2016-05-17 10:56:40 -07:00
|
|
|
(current_cpu == "arm" && arm_use_neon) || current_cpu == "arm64"
|
2015-06-29 14:34:58 -07:00
|
|
|
|
|
|
|
|
# Enable this to use HW H.264 encoder/decoder on iOS PeerConnections.
|
|
|
|
|
# Enabling this may break interop with Android clients that support H264.
|
|
|
|
|
rtc_use_objc_h264 = false
|
2016-01-11 10:19:02 -08:00
|
|
|
|
2016-01-21 03:34:40 -08:00
|
|
|
# Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on
|
2016-02-08 02:57:00 -08:00
|
|
|
# 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|.
|
2016-01-11 10:19:02 -08:00
|
|
|
# CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
|
|
|
|
|
# http://www.openh264.org, https://www.ffmpeg.org/
|
2016-02-08 02:57:00 -08:00
|
|
|
rtc_use_h264 = proprietary_codecs && !is_android && !is_ios
|
2016-02-02 02:26:05 -08:00
|
|
|
|
Reland of GN: Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc}
The only thing that differs from the previous attempt in
https://codereview.webrtc.org/1979933002/ is that none of
the new targets are not hooked up to the webrtc target in
webrtc/BUILD.gn, which should make it not break the
chromium.webrtc.fyi bots.
Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc} in
preparation for removing src/third_party/libjingle in Chromium.
Changes between previous attempt and the one before that
(https://codereview.webrtc.org/1973313002) are:
* Added libstunprober target
* Adjusted warnings for Chromium's clang plugins
* webrtc/pc/externalhmac.{h,cc} added for Chromium builds.
BUG=webrtc:4256
NOTRY=True
NOPRESUBMIT=True
TBR=perkj@webrtc.org, tommi@webrtc.org
Review-Url: https://codereview.webrtc.org/2037983002
Cr-Commit-Position: refs/heads/master@{#13030}
2016-06-03 03:09:32 -07:00
|
|
|
# Determines whether QUIC code will be built.
|
|
|
|
|
rtc_use_quic = false
|
|
|
|
|
|
2016-08-16 18:21:18 -07:00
|
|
|
# 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
|
|
|
|
|
|
2016-02-02 02:26:05 -08:00
|
|
|
# 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
|
Reland of GN: Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc}
The only thing that differs from the previous attempt in
https://codereview.webrtc.org/1979933002/ is that none of
the new targets are not hooked up to the webrtc target in
webrtc/BUILD.gn, which should make it not break the
chromium.webrtc.fyi bots.
Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc} in
preparation for removing src/third_party/libjingle in Chromium.
Changes between previous attempt and the one before that
(https://codereview.webrtc.org/1973313002) are:
* Added libstunprober target
* Adjusted warnings for Chromium's clang plugins
* webrtc/pc/externalhmac.{h,cc} added for Chromium builds.
BUG=webrtc:4256
NOTRY=True
NOPRESUBMIT=True
TBR=perkj@webrtc.org, tommi@webrtc.org
Review-Url: https://codereview.webrtc.org/2037983002
Cr-Commit-Position: refs/heads/master@{#13030}
2016-06-03 03:09:32 -07:00
|
|
|
|
|
|
|
|
# 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
|
2014-06-17 08:54:03 +00:00
|
|
|
}
|
2015-02-16 12:47:20 +00:00
|
|
|
|
2016-01-18 06:38:32 -08:00
|
|
|
# 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)
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-16 12:47:20 +00:00
|
|
|
# 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).
|
2016-03-04 14:39:28 -08:00
|
|
|
rtc_libvpx_dir = "//third_party/libvpx"
|
2015-02-16 12:47:20 +00:00
|
|
|
rtc_libyuv_dir = "//third_party/libyuv"
|
|
|
|
|
rtc_opus_dir = "//third_party/opus"
|
2016-09-02 04:10:34 -07:00
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
# 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")
|
|
|
|
|
|
2016-09-05 01:35:44 -07:00
|
|
|
# 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_config = webrtc_root + ":common_config"
|
|
|
|
|
|
2016-09-02 04:10:34 -07:00
|
|
|
# Common configs to remove or add in all rtc targets.
|
|
|
|
|
rtc_remove_configs = []
|
2016-09-05 01:35:44 -07:00
|
|
|
rtc_add_configs = [ rtc_common_config ]
|
2016-09-02 04:10:34 -07:00
|
|
|
|
2016-09-05 02:48:54 -07:00
|
|
|
if (!is_debug) {
|
|
|
|
|
rtc_remove_configs += [ "//build/config/compiler:default_optimization" ]
|
|
|
|
|
rtc_add_configs += [ "//build/config/compiler:optimize_max" ]
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-02 04:10:34 -07:00
|
|
|
set_defaults("rtc_test") {
|
2016-09-05 01:35:44 -07:00
|
|
|
configs = rtc_add_configs
|
2016-09-02 04:10:34 -07:00
|
|
|
suppressed_configs = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set_defaults("rtc_source_set") {
|
2016-09-05 01:35:44 -07:00
|
|
|
configs = rtc_add_configs
|
2016-09-02 04:10:34 -07:00
|
|
|
suppressed_configs = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set_defaults("rtc_executable") {
|
2016-09-05 01:35:44 -07:00
|
|
|
configs = rtc_add_configs
|
2016-09-02 04:10:34 -07:00
|
|
|
suppressed_configs = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set_defaults("rtc_static_library") {
|
2016-09-05 01:35:44 -07:00
|
|
|
configs = rtc_add_configs
|
2016-09-02 04:10:34 -07:00
|
|
|
suppressed_configs = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template("rtc_test") {
|
|
|
|
|
test(target_name) {
|
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
|
"*",
|
|
|
|
|
[
|
|
|
|
|
"configs",
|
|
|
|
|
"suppressed_configs",
|
|
|
|
|
])
|
|
|
|
|
configs += invoker.configs
|
|
|
|
|
configs -= rtc_remove_configs
|
|
|
|
|
configs -= invoker.suppressed_configs
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template("rtc_source_set") {
|
|
|
|
|
source_set(target_name) {
|
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
|
"*",
|
|
|
|
|
[
|
|
|
|
|
"configs",
|
|
|
|
|
"suppressed_configs",
|
|
|
|
|
])
|
|
|
|
|
configs += invoker.configs
|
|
|
|
|
configs -= rtc_remove_configs
|
|
|
|
|
configs -= invoker.suppressed_configs
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template("rtc_executable") {
|
|
|
|
|
executable(target_name) {
|
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
|
"*",
|
|
|
|
|
[
|
2016-09-02 07:03:15 -07:00
|
|
|
"deps",
|
2016-09-02 04:10:34 -07:00
|
|
|
"configs",
|
|
|
|
|
"suppressed_configs",
|
|
|
|
|
])
|
|
|
|
|
configs += invoker.configs
|
|
|
|
|
configs -= rtc_remove_configs
|
|
|
|
|
configs -= invoker.suppressed_configs
|
2016-09-02 07:03:15 -07:00
|
|
|
deps = [
|
|
|
|
|
"//build/config/sanitizers:deps",
|
|
|
|
|
]
|
|
|
|
|
deps += invoker.deps
|
2016-09-02 04:10:34 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template("rtc_static_library") {
|
|
|
|
|
static_library(target_name) {
|
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
|
"*",
|
|
|
|
|
[
|
|
|
|
|
"configs",
|
|
|
|
|
"suppressed_configs",
|
|
|
|
|
])
|
|
|
|
|
configs += invoker.configs
|
|
|
|
|
configs -= rtc_remove_configs
|
|
|
|
|
configs -= invoker.suppressed_configs
|
|
|
|
|
}
|
|
|
|
|
}
|