Skip to content

Commit

Permalink
GN: Prefix WebRTC specific variables with "rtc_"
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kjellander@webrtc.org committed Sep 7, 2014
1 parent f68cf93 commit 6d08ca6
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 70 deletions.
10 changes: 5 additions & 5 deletions webrtc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ config("common_inherited_config") {
"WEBRTC_LINUX",
"WEBRTC_ANDROID",
]
if (enable_android_opensl) {
if (rtc_enable_android_opensl) {
defines += [ "WEBRTC_ANDROID_OPENSLES" ]
}
}
}

if (have_dbus_glib) {
if (rtc_have_dbus_glib) {
pkg_config("dbus-glib") {
packages = [ "dbus-glib-1" ]
}
Expand All @@ -72,11 +72,11 @@ if (have_dbus_glib) {
config("common_config") {
cflags = []
cflags_cc = []
if (restrict_webrtc_logging) {
if (rtc_restrict_logging) {
defines = [ "WEBRTC_RESTRICT_LOGGING" ]
}

if (have_dbus_glib) {
if (rtc_have_dbus_glib) {
defines += [ "HAVE_DBUS_GLIB" ]
# TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h>
# is still not found even if the execution of
Expand All @@ -85,7 +85,7 @@ config("common_config") {
all_dependent_configs = [ "dbus-glib" ]
}

if (enable_video) {
if (rtc_enable_video) {
defines += [ "WEBRTC_MODULE_UTILITY_VIDEO" ]
}

Expand Down
22 changes: 11 additions & 11 deletions webrtc/base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ if (is_linux && !build_with_chromium) {
}
}

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

Expand Down Expand Up @@ -425,10 +425,10 @@ static_library("webrtc_base") {
"win32socketserver.h",
]
}
if (build_json) {
if (rtc_build_json) {
deps += [ "//third_party/jsoncpp" ]
} else {
include_dirs += [ webrtc_jsoncpp_root ]
include_dirs += [ rtc_jsoncpp_root ]

# When defined changes the include path for json.h to where it is
# expected to be when building json outside of the standalone build.
Expand All @@ -451,7 +451,7 @@ static_library("webrtc_base") {

if (use_openssl) {
direct_dependent_configs += [ ":openssl_config" ]
if (build_ssl) {
if (rtc_build_ssl) {
deps += [ "//third_party/boringssl" ]
} else {
configs += [ "external_ssl_library" ]
Expand Down Expand Up @@ -479,7 +479,7 @@ static_library("webrtc_base") {
if (is_ios) {
all_dependent_configs += [ ":ios_config" ]

if (build_ssl) {
if (rtc_build_ssl) {
deps += [ "//net/third_party/nss/ssl:libssl" ]
} else {
configs += [ "external_ssl_library" ]
Expand Down Expand Up @@ -507,7 +507,7 @@ static_library("webrtc_base") {
"dl",
"rt",
]
if (build_ssl) {
if (rtc_build_ssl) {
configs += [ "//third_party/nss:system_nss_no_ssl_config" ]
}
}
Expand Down Expand Up @@ -600,7 +600,7 @@ static_library("webrtc_base") {
}

if (is_mac || is_ios || is_win) {
if (build_ssl) {
if (rtc_build_ssl) {
deps += [
"//net/third_party/nss/ssl:libssl",
"//third_party/nss:nspr",
Expand All @@ -615,7 +615,7 @@ static_library("webrtc_base") {
if (build_with_chromium) {
deps += [ "//crypto:platform" ]
} else {
if (build_ssl) {
if (rtc_build_ssl) {
deps += [ ":linux_system_ssl" ]
} else {
configs += [ "external_ssl_library" ]
Expand Down
66 changes: 33 additions & 33 deletions webrtc/build/webrtc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,40 @@ declare_args() {
build_with_libjingle = true

# 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
# library that comes with WebRTC (i.e. build_json == 0).
webrtc_jsoncpp_root = "//third_party/jsoncpp/source/include"
# 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. build_ssl == 0).
webrtc_ssl_root = ""
# library that comes with WebRTC (i.e. rtc_build_ssl == 0).
rtc_ssl_root = ""

# Adds video support to dependencies shared by voice and video engine.
# This should normally be enabled; the intended use is to disable only
# when building voice engine exclusively.
enable_video = true
rtc_enable_video = true

# 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
# 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.
enable_protobuf = true
rtc_enable_protobuf = true

# Disable these to not build components which can be externally provided.
build_json = true
build_libjpeg = true
build_libyuv = true
build_libvpx = true
build_ssl = true
rtc_build_json = true
rtc_build_libjpeg = true
rtc_build_libyuv = true
rtc_build_libvpx = true
rtc_build_ssl = true

# Disable by default.
have_dbus_glib = false
rtc_have_dbus_glib = false

# Enable to use the Mozilla internal settings.
build_with_mozilla = false
Expand All @@ -59,26 +59,26 @@ declare_args() {
mips_dsp_rev = 0
mips_fpu = true

enable_android_opensl = true
rtc_enable_android_opensl = true

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

if (build_with_chromium) {
# Exclude pulse audio on Chromium since its prerequisites don't require
# pulse audio.
include_pulse_audio = false
rtc_include_pulse_audio = false

# 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.
include_internal_video_capture = false
rtc_include_internal_video_capture = false

# Exclude internal video render module in Chromium build.
include_internal_video_render = false
rtc_include_internal_video_render = false
} else {
# Settings for the standalone (not-in-Chromium) build.

Expand All @@ -87,31 +87,31 @@ declare_args() {
# http://code.google.com/p/webrtc/issues/detail?id=163
clang_use_chrome_plugins = false

include_pulse_audio = true
include_internal_audio_device = true
include_internal_video_capture = true
include_internal_video_render = true
rtc_include_pulse_audio = true
rtc_include_internal_audio_device = true
rtc_include_internal_video_capture = true
rtc_include_internal_video_render = true
}

if (build_with_libjingle) {
include_tests = false
restrict_webrtc_logging = true
rtc_include_tests = false
rtc_restrict_logging = true
} else {
include_tests = true
restrict_webrtc_logging = false
rtc_include_tests = true
rtc_restrict_logging = false
}

if (is_ios) {
build_libjpeg = false
enable_protobuf = false
rtc_build_libjpeg = false
rtc_enable_protobuf = false
}

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
# Android, which is why we currently cannot use the variables in
# //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)
}
4 changes: 2 additions & 2 deletions webrtc/common_audio/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
sources = [
"fir_filter_neon.cc",
Expand Down Expand Up @@ -199,7 +199,7 @@ if (build_armv7_neon) {
]

# Disable LTO in audio_processing_neon target due to compiler bug.
if (use_lto) {
if (rtc_use_lto) {
cflags -= [
"-flto",
"-ffat-lto-objects",
Expand Down
2 changes: 1 addition & 1 deletion webrtc/common_video/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ source_set("common_video") {

deps = [ "../system_wrappers" ]

if (build_libyuv) {
if (rtc_build_libyuv) {
deps += [ "//third_party/libyuv" ]
} else {
# Need to add a directory normally exported by libyuv.
Expand Down
10 changes: 5 additions & 5 deletions webrtc/modules/audio_coding/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ source_set("audio_coding") {
"../../system_wrappers",
]

if (include_opus) {
if (rtc_include_opus) {
defines += [ "WEBRTC_CODEC_OPUS" ]
deps += [ ":webrtc_opus" ]
}
Expand Down Expand Up @@ -453,7 +453,7 @@ source_set("isacfix") {
"../../system_wrappers",
]

if (build_armv7_neon) {
if (rtc_build_armv7_neon) {
deps += [ ":isac_neon" ]

# Enable compilation for the ARM v7 Neon instruction set. This is needed
Expand Down Expand Up @@ -497,15 +497,15 @@ source_set("isacfix") {
}
}

if (build_armv7_neon) {
if (rtc_build_armv7_neon) {
sources += [
"codecs/isac/fix/source/lattice_c.c",
"codecs/isac/fix/source/pitch_estimator_c.c",
]
}
}

if (build_armv7_neon) {
if (rtc_build_armv7_neon) {
source_set("isac_neon") {
sources = [
"codecs/isac/fix/source/entropy_coding_neon.c",
Expand All @@ -521,7 +521,7 @@ if (build_armv7_neon) {
]

# Disable LTO in audio_processing_neon target due to compiler bug.
if (use_lto) {
if (rtc_use_lto) {
cflags -= [
"-flto",
"-ffat-lto-objects",
Expand Down
4 changes: 2 additions & 2 deletions webrtc/modules/audio_device/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ source_set("audio_device") {
if (is_android) {
include_dirs += [ "android" ]
}
if (include_internal_audio_device) {
if (rtc_include_internal_audio_device) {
sources += [
"linux/alsasymboltable_linux.cc",
"linux/alsasymboltable_linux.h",
Expand Down Expand Up @@ -118,7 +118,7 @@ source_set("audio_device") {
"X11",
]

if (include_pulse_audio) {
if (rtc_include_pulse_audio) {
sources += [
"linux/audio_device_pulse_linux.cc",
"linux/audio_device_pulse_linux.h",
Expand Down
12 changes: 6 additions & 6 deletions webrtc/modules/audio_processing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ source_set("audio_processing") {
defines += [ "WEBRTC_UNTRUSTED_DELAY" ]
}

if (enable_protobuf) {
if (rtc_enable_protobuf) {
defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
deps += [ ":audioproc_debug_proto" ]
}

if (prefer_fixed_point) {
if (rtc_prefer_fixed_point) {
defines += [ "WEBRTC_NS_FIXED" ]
sources += [
"ns/include/noise_suppression_x.h",
Expand Down Expand Up @@ -124,7 +124,7 @@ source_set("audio_processing") {
deps += [ ":audio_processing_sse2" ]
}

if (build_armv7_neon) {
if (rtc_build_armv7_neon) {
deps += [ ":audio_processing_neon" ]
}

Expand Down Expand Up @@ -159,7 +159,7 @@ source_set("audio_processing") {
]
}

if (enable_protobuf) {
if (rtc_enable_protobuf) {
proto_library("audioproc_debug_proto") {
sources = [ "debug.proto" ]

Expand All @@ -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") {
sources = [
"aec/aec_core_neon.c",
Expand Down Expand Up @@ -217,7 +217,7 @@ if (build_armv7_neon) {
]

# Disable LTO in audio_processing_neon target due to compiler bug.
if (use_lto) {
if (rtc_use_lto) {
cflags -= [
"-flto",
"-ffat-lto-objects",
Expand Down
2 changes: 1 addition & 1 deletion webrtc/modules/utility/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ source_set("utility") {
"../audio_coding",
"../media_file",
]
if (enable_video) {
if (rtc_enable_video) {
sources += [
"source/frame_scaler.cc",
"source/video_coder.cc",
Expand Down
Loading

0 comments on commit 6d08ca6

Please sign in to comment.