GN: Prefix WebRTC specific variables with "rtc_"

BUG=3441
TESTED=Trybots + Running GN in a Chromium checkout with
src/third_party/webrtc symlinked to the WebRTC checkout
with this CL applied, both with the default GN settings
and using: --args="os=\"android\" cpu_arch=\"arm\""

R=brettw@chromium.org

Review URL: https://webrtc-codereview.appspot.com/27379004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7095 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kjellander@webrtc.org
2014-09-07 17:36:10 +00:00
parent f68cf93e1b
commit 6d08ca6379
13 changed files with 70 additions and 70 deletions

View File

@@ -57,13 +57,13 @@ config("common_inherited_config") {
"WEBRTC_LINUX", "WEBRTC_LINUX",
"WEBRTC_ANDROID", "WEBRTC_ANDROID",
] ]
if (enable_android_opensl) { if (rtc_enable_android_opensl) {
defines += [ "WEBRTC_ANDROID_OPENSLES" ] defines += [ "WEBRTC_ANDROID_OPENSLES" ]
} }
} }
} }
if (have_dbus_glib) { if (rtc_have_dbus_glib) {
pkg_config("dbus-glib") { pkg_config("dbus-glib") {
packages = [ "dbus-glib-1" ] packages = [ "dbus-glib-1" ]
} }
@@ -72,11 +72,11 @@ if (have_dbus_glib) {
config("common_config") { config("common_config") {
cflags = [] cflags = []
cflags_cc = [] cflags_cc = []
if (restrict_webrtc_logging) { if (rtc_restrict_logging) {
defines = [ "WEBRTC_RESTRICT_LOGGING" ] defines = [ "WEBRTC_RESTRICT_LOGGING" ]
} }
if (have_dbus_glib) { if (rtc_have_dbus_glib) {
defines += [ "HAVE_DBUS_GLIB" ] defines += [ "HAVE_DBUS_GLIB" ]
# TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h> # TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h>
# is still not found even if the execution of # is still not found even if the execution of
@@ -85,7 +85,7 @@ config("common_config") {
all_dependent_configs = [ "dbus-glib" ] all_dependent_configs = [ "dbus-glib" ]
} }
if (enable_video) { if (rtc_enable_video) {
defines += [ "WEBRTC_MODULE_UTILITY_VIDEO" ] defines += [ "WEBRTC_MODULE_UTILITY_VIDEO" ]
} }

View File

@@ -102,11 +102,11 @@ if (is_linux && !build_with_chromium) {
} }
} }
if (build_ssl == 0) { if (rtc_build_ssl == 0) {
config("external_ssl_library") { config("external_ssl_library") {
assert(webrtc_ssl_root != "", assert(rtc_ssl_root != "",
"You must specify webrtc_ssl_root when build_ssl==0.") "You must specify rtc_ssl_root when rtc_build_ssl==0.")
include_dirs = [ webrtc_ssl_root ] include_dirs = [ rtc_ssl_root ]
} }
} }
@@ -425,10 +425,10 @@ static_library("webrtc_base") {
"win32socketserver.h", "win32socketserver.h",
] ]
} }
if (build_json) { if (rtc_build_json) {
deps += [ "//third_party/jsoncpp" ] deps += [ "//third_party/jsoncpp" ]
} else { } else {
include_dirs += [ webrtc_jsoncpp_root ] include_dirs += [ rtc_jsoncpp_root ]
# When defined changes the include path for json.h to where it is # When defined changes the include path for json.h to where it is
# expected to be when building json outside of the standalone build. # expected to be when building json outside of the standalone build.
@@ -451,7 +451,7 @@ static_library("webrtc_base") {
if (use_openssl) { if (use_openssl) {
direct_dependent_configs += [ ":openssl_config" ] direct_dependent_configs += [ ":openssl_config" ]
if (build_ssl) { if (rtc_build_ssl) {
deps += [ "//third_party/boringssl" ] deps += [ "//third_party/boringssl" ]
} else { } else {
configs += [ "external_ssl_library" ] configs += [ "external_ssl_library" ]
@@ -479,7 +479,7 @@ static_library("webrtc_base") {
if (is_ios) { if (is_ios) {
all_dependent_configs += [ ":ios_config" ] all_dependent_configs += [ ":ios_config" ]
if (build_ssl) { if (rtc_build_ssl) {
deps += [ "//net/third_party/nss/ssl:libssl" ] deps += [ "//net/third_party/nss/ssl:libssl" ]
} else { } else {
configs += [ "external_ssl_library" ] configs += [ "external_ssl_library" ]
@@ -507,7 +507,7 @@ static_library("webrtc_base") {
"dl", "dl",
"rt", "rt",
] ]
if (build_ssl) { if (rtc_build_ssl) {
configs += [ "//third_party/nss:system_nss_no_ssl_config" ] configs += [ "//third_party/nss:system_nss_no_ssl_config" ]
} }
} }
@@ -600,7 +600,7 @@ static_library("webrtc_base") {
} }
if (is_mac || is_ios || is_win) { if (is_mac || is_ios || is_win) {
if (build_ssl) { if (rtc_build_ssl) {
deps += [ deps += [
"//net/third_party/nss/ssl:libssl", "//net/third_party/nss/ssl:libssl",
"//third_party/nss:nspr", "//third_party/nss:nspr",
@@ -615,7 +615,7 @@ static_library("webrtc_base") {
if (build_with_chromium) { if (build_with_chromium) {
deps += [ "//crypto:platform" ] deps += [ "//crypto:platform" ]
} else { } else {
if (build_ssl) { if (rtc_build_ssl) {
deps += [ ":linux_system_ssl" ] deps += [ ":linux_system_ssl" ]
} else { } else {
configs += [ "external_ssl_library" ] configs += [ "external_ssl_library" ]

View File

@@ -15,40 +15,40 @@ declare_args() {
build_with_libjingle = true build_with_libjingle = true
# Disable this to avoid building the Opus audio codec. # Disable this to avoid building the Opus audio codec.
include_opus = true rtc_include_opus = true
# Used to specify an external Jsoncpp include path when not compiling the # Used to specify an external Jsoncpp include path when not compiling the
# library that comes with WebRTC (i.e. build_json == 0). # library that comes with WebRTC (i.e. rtc_build_json == 0).
webrtc_jsoncpp_root = "//third_party/jsoncpp/source/include" rtc_jsoncpp_root = "//third_party/jsoncpp/source/include"
# Used to specify an external OpenSSL include path when not compiling the # Used to specify an external OpenSSL include path when not compiling the
# library that comes with WebRTC (i.e. build_ssl == 0). # library that comes with WebRTC (i.e. rtc_build_ssl == 0).
webrtc_ssl_root = "" rtc_ssl_root = ""
# Adds video support to dependencies shared by voice and video engine. # Adds video support to dependencies shared by voice and video engine.
# This should normally be enabled; the intended use is to disable only # This should normally be enabled; the intended use is to disable only
# when building voice engine exclusively. # when building voice engine exclusively.
enable_video = true rtc_enable_video = true
# Selects fixed-point code where possible. # Selects fixed-point code where possible.
prefer_fixed_point = false rtc_prefer_fixed_point = false
# Enable data logging. Produces text files with data logged within engines # Enable data logging. Produces text files with data logged within engines
# which can be easily parsed for offline processing. # which can be easily parsed for offline processing.
enable_data_logging = false rtc_enable_data_logging = false
# Enables the use of protocol buffers for debug recordings. # Enables the use of protocol buffers for debug recordings.
enable_protobuf = true rtc_enable_protobuf = true
# Disable these to not build components which can be externally provided. # Disable these to not build components which can be externally provided.
build_json = true rtc_build_json = true
build_libjpeg = true rtc_build_libjpeg = true
build_libyuv = true rtc_build_libyuv = true
build_libvpx = true rtc_build_libvpx = true
build_ssl = true rtc_build_ssl = true
# Disable by default. # Disable by default.
have_dbus_glib = false rtc_have_dbus_glib = false
# Enable to use the Mozilla internal settings. # Enable to use the Mozilla internal settings.
build_with_mozilla = false build_with_mozilla = false
@@ -59,26 +59,26 @@ declare_args() {
mips_dsp_rev = 0 mips_dsp_rev = 0
mips_fpu = true mips_fpu = true
enable_android_opensl = true rtc_enable_android_opensl = true
# Link-Time Optimizations. # Link-Time Optimizations.
# Executes code generation at link-time instead of compile-time. # Executes code generation at link-time instead of compile-time.
# https://gcc.gnu.org/wiki/LinkTimeOptimization # https://gcc.gnu.org/wiki/LinkTimeOptimization
use_lto = false rtc_use_lto = false
if (build_with_chromium) { if (build_with_chromium) {
# Exclude pulse audio on Chromium since its prerequisites don't require # Exclude pulse audio on Chromium since its prerequisites don't require
# pulse audio. # pulse audio.
include_pulse_audio = false rtc_include_pulse_audio = false
# Exclude internal ADM since Chromium uses its own IO handling. # Exclude internal ADM since Chromium uses its own IO handling.
include_internal_audio_device = false rtc_include_internal_audio_device = false
# Exclude internal VCM in Chromium build. # Exclude internal VCM in Chromium build.
include_internal_video_capture = false rtc_include_internal_video_capture = false
# Exclude internal video render module in Chromium build. # Exclude internal video render module in Chromium build.
include_internal_video_render = false rtc_include_internal_video_render = false
} else { } else {
# Settings for the standalone (not-in-Chromium) build. # Settings for the standalone (not-in-Chromium) build.
@@ -87,31 +87,31 @@ declare_args() {
# http://code.google.com/p/webrtc/issues/detail?id=163 # http://code.google.com/p/webrtc/issues/detail?id=163
clang_use_chrome_plugins = false clang_use_chrome_plugins = false
include_pulse_audio = true rtc_include_pulse_audio = true
include_internal_audio_device = true rtc_include_internal_audio_device = true
include_internal_video_capture = true rtc_include_internal_video_capture = true
include_internal_video_render = true rtc_include_internal_video_render = true
} }
if (build_with_libjingle) { if (build_with_libjingle) {
include_tests = false rtc_include_tests = false
restrict_webrtc_logging = true rtc_restrict_logging = true
} else { } else {
include_tests = true rtc_include_tests = true
restrict_webrtc_logging = false rtc_restrict_logging = false
} }
if (is_ios) { if (is_ios) {
build_libjpeg = false rtc_build_libjpeg = false
enable_protobuf = false rtc_enable_protobuf = false
} }
if (cpu_arch == "arm") { if (cpu_arch == "arm") {
prefer_fixed_point = true rtc_prefer_fixed_point = true
} }
# WebRTC builds ARM v7 Neon instruction set optimized code for both iOS and # WebRTC builds ARM v7 Neon instruction set optimized code for both iOS and
# Android, which is why we currently cannot use the variables in # Android, which is why we currently cannot use the variables in
# //build/config/arm.gni (since it disables Neon for Android). # //build/config/arm.gni (since it disables Neon for Android).
build_armv7_neon = (cpu_arch == "arm" && arm_version == 7) rtc_build_armv7_neon = (cpu_arch == "arm" && arm_version == 7)
} }

View File

@@ -170,7 +170,7 @@ if (cpu_arch == "x86" || cpu_arch == "x64") {
} }
} }
if (build_armv7_neon) { if (rtc_build_armv7_neon) {
source_set("common_audio_neon") { source_set("common_audio_neon") {
sources = [ sources = [
"fir_filter_neon.cc", "fir_filter_neon.cc",
@@ -199,7 +199,7 @@ if (build_armv7_neon) {
] ]
# Disable LTO in audio_processing_neon target due to compiler bug. # Disable LTO in audio_processing_neon target due to compiler bug.
if (use_lto) { if (rtc_use_lto) {
cflags -= [ cflags -= [
"-flto", "-flto",
"-ffat-lto-objects", "-ffat-lto-objects",

View File

@@ -42,7 +42,7 @@ source_set("common_video") {
deps = [ "../system_wrappers" ] deps = [ "../system_wrappers" ]
if (build_libyuv) { if (rtc_build_libyuv) {
deps += [ "//third_party/libyuv" ] deps += [ "//third_party/libyuv" ]
} else { } else {
# Need to add a directory normally exported by libyuv. # Need to add a directory normally exported by libyuv.

View File

@@ -102,7 +102,7 @@ source_set("audio_coding") {
"../../system_wrappers", "../../system_wrappers",
] ]
if (include_opus) { if (rtc_include_opus) {
defines += [ "WEBRTC_CODEC_OPUS" ] defines += [ "WEBRTC_CODEC_OPUS" ]
deps += [ ":webrtc_opus" ] deps += [ ":webrtc_opus" ]
} }
@@ -453,7 +453,7 @@ source_set("isacfix") {
"../../system_wrappers", "../../system_wrappers",
] ]
if (build_armv7_neon) { if (rtc_build_armv7_neon) {
deps += [ ":isac_neon" ] deps += [ ":isac_neon" ]
# Enable compilation for the ARM v7 Neon instruction set. This is needed # Enable compilation for the ARM v7 Neon instruction set. This is needed
@@ -497,7 +497,7 @@ source_set("isacfix") {
} }
} }
if (build_armv7_neon) { if (rtc_build_armv7_neon) {
sources += [ sources += [
"codecs/isac/fix/source/lattice_c.c", "codecs/isac/fix/source/lattice_c.c",
"codecs/isac/fix/source/pitch_estimator_c.c", "codecs/isac/fix/source/pitch_estimator_c.c",
@@ -505,7 +505,7 @@ source_set("isacfix") {
} }
} }
if (build_armv7_neon) { if (rtc_build_armv7_neon) {
source_set("isac_neon") { source_set("isac_neon") {
sources = [ sources = [
"codecs/isac/fix/source/entropy_coding_neon.c", "codecs/isac/fix/source/entropy_coding_neon.c",
@@ -521,7 +521,7 @@ if (build_armv7_neon) {
] ]
# Disable LTO in audio_processing_neon target due to compiler bug. # Disable LTO in audio_processing_neon target due to compiler bug.
if (use_lto) { if (rtc_use_lto) {
cflags -= [ cflags -= [
"-flto", "-flto",
"-ffat-lto-objects", "-ffat-lto-objects",

View File

@@ -55,7 +55,7 @@ source_set("audio_device") {
if (is_android) { if (is_android) {
include_dirs += [ "android" ] include_dirs += [ "android" ]
} }
if (include_internal_audio_device) { if (rtc_include_internal_audio_device) {
sources += [ sources += [
"linux/alsasymboltable_linux.cc", "linux/alsasymboltable_linux.cc",
"linux/alsasymboltable_linux.h", "linux/alsasymboltable_linux.h",
@@ -118,7 +118,7 @@ source_set("audio_device") {
"X11", "X11",
] ]
if (include_pulse_audio) { if (rtc_include_pulse_audio) {
sources += [ sources += [
"linux/audio_device_pulse_linux.cc", "linux/audio_device_pulse_linux.cc",
"linux/audio_device_pulse_linux.h", "linux/audio_device_pulse_linux.h",

View File

@@ -89,12 +89,12 @@ source_set("audio_processing") {
defines += [ "WEBRTC_UNTRUSTED_DELAY" ] defines += [ "WEBRTC_UNTRUSTED_DELAY" ]
} }
if (enable_protobuf) { if (rtc_enable_protobuf) {
defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ] defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
deps += [ ":audioproc_debug_proto" ] deps += [ ":audioproc_debug_proto" ]
} }
if (prefer_fixed_point) { if (rtc_prefer_fixed_point) {
defines += [ "WEBRTC_NS_FIXED" ] defines += [ "WEBRTC_NS_FIXED" ]
sources += [ sources += [
"ns/include/noise_suppression_x.h", "ns/include/noise_suppression_x.h",
@@ -124,7 +124,7 @@ source_set("audio_processing") {
deps += [ ":audio_processing_sse2" ] deps += [ ":audio_processing_sse2" ]
} }
if (build_armv7_neon) { if (rtc_build_armv7_neon) {
deps += [ ":audio_processing_neon" ] deps += [ ":audio_processing_neon" ]
} }
@@ -159,7 +159,7 @@ source_set("audio_processing") {
] ]
} }
if (enable_protobuf) { if (rtc_enable_protobuf) {
proto_library("audioproc_debug_proto") { proto_library("audioproc_debug_proto") {
sources = [ "debug.proto" ] sources = [ "debug.proto" ]
@@ -180,7 +180,7 @@ if (cpu_arch == "x86" || cpu_arch == "x64") {
} }
} }
if (build_armv7_neon) { if (rtc_build_armv7_neon) {
source_set("audio_processing_neon") { source_set("audio_processing_neon") {
sources = [ sources = [
"aec/aec_core_neon.c", "aec/aec_core_neon.c",
@@ -217,7 +217,7 @@ if (build_armv7_neon) {
] ]
# Disable LTO in audio_processing_neon target due to compiler bug. # Disable LTO in audio_processing_neon target due to compiler bug.
if (use_lto) { if (rtc_use_lto) {
cflags -= [ cflags -= [
"-flto", "-flto",
"-ffat-lto-objects", "-ffat-lto-objects",

View File

@@ -42,7 +42,7 @@ source_set("utility") {
"../audio_coding", "../audio_coding",
"../media_file", "../media_file",
] ]
if (enable_video) { if (rtc_enable_video) {
sources += [ sources += [
"source/frame_scaler.cc", "source/frame_scaler.cc",
"source/video_coder.cc", "source/video_coder.cc",

View File

@@ -35,7 +35,7 @@ source_set("video_capture") {
libs = [] libs = []
deps = [] deps = []
if (include_internal_video_capture) { if (rtc_include_internal_video_capture) {
if (is_linux) { if (is_linux) {
sources += [ sources += [
"linux/device_info_linux.cc", "linux/device_info_linux.cc",

View File

@@ -137,7 +137,7 @@ source_set("webrtc_vp8") {
"../../common_video", "../../common_video",
"../../system_wrappers", "../../system_wrappers",
] ]
# if (build_libvpx) { # if (rtc_build_libvpx) {
# deps += [ # deps += [
# "//third_party/libvpx", # "//third_party/libvpx",
# ] # ]

View File

@@ -35,7 +35,7 @@ source_set("video_render") {
libs = [] libs = []
deps = [] deps = []
if (include_internal_video_render) { if (rtc_include_internal_video_render) {
defines += [ "WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER" ] defines += [ "WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER" ]
if (is_linux) { if (is_linux) {

View File

@@ -119,7 +119,7 @@ static_library("system_wrappers") {
":system_wrappers_inherited_config", ":system_wrappers_inherited_config",
] ]
if (enable_data_logging) { if (rtc_enable_data_logging) {
sources += [ "source/data_log.cc" ] sources += [ "source/data_log.cc" ]
} else { } else {
sources += [ "source/data_log_no_op.cc" ] sources += [ "source/data_log_no_op.cc" ]