1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 # Use of this source code is governed by a BSD-style license
4 # that can be found in the LICENSE file in the root of the source
5 # tree. An additional intellectual property rights grant can be found
6 # in the file PATENTS. All contributing project authors may
7 # be found in the AUTHORS file in the root of the source tree.
9 import("//build/config/arm.gni")
10 import("//build/config/crypto.gni")
11 import("//build/config/linux/pkg_config.gni")
12 import("build/webrtc.gni")
14 # Contains the defines and includes in common.gypi that are duplicated both as
15 # target_defaults and direct_dependent_settings.
16 config("common_inherited_config") {
18 if (build_with_mozilla) {
19 defines += [ "WEBRTC_MOZILLA_BUILD" ]
21 if (build_with_chromium) {
23 "WEBRTC_CHROMIUM_BUILD",
24 "LOGGING_INSIDE_WEBRTC",
27 # overrides must be included first as that is the mechanism for
28 # selecting the override headers in Chromium.
30 # Allow includes to be prefixed with webrtc/ in case it is not an
31 # immediate subdirectory of the top-level.
36 defines += [ "WEBRTC_POSIX" ]
45 defines += [ "WEBRTC_LINUX" ]
48 defines += [ "WEBRTC_MAC" ]
51 defines += [ "WEBRTC_WIN" ]
58 if (enable_android_opensl) {
59 defines += [ "WEBRTC_ANDROID_OPENSLES" ]
64 pkg_config("dbus-glib") {
65 packages = [ "dbus-glib-1" ]
68 config("common_config") {
69 if (restrict_webrtc_logging) {
70 defines = [ "WEBRTC_RESTRICT_LOGGING" ]
74 defines += [ "HAVE_DBUS_GLIB" ]
75 # TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h>
76 # is still not found even if the execution of
77 # build/config/linux/pkg-config.py dbus-glib-1 returns correct include
79 all_dependent_configs = [ "dbus-glib" ]
83 defines += [ "WEBRTC_MODULE_UTILITY_VIDEO" ]
86 if (!build_with_chromium) {
88 # -Wextra is currently disabled in Chromium"s common.gypi. Enable
89 # for targets that can handle it. For Android/arm64 right now
90 # there will be an "enumeral and non-enumeral type in conditional
91 # expression" warning in android_tools/ndk_experimental"s version
93 # See: https://code.google.com/p/chromium/issues/detail?id=379699
94 if (cpu_arch != "arm64" || !is_android) {
97 # We need to repeat some flags from Chromium"s common.gypi
98 # here that get overridden by -Wextra.
99 "-Wno-unused-parameter",
100 "-Wno-missing-field-initializers",
101 "-Wno-strict-overflow",
104 "-Wnon-virtual-dtor",
105 # This is enabled for clang; enable for gcc as well.
106 "-Woverloaded-virtual",
112 cflags += [ "-Wthread-safety" ]
116 if (cpu_arch == "arm") {
117 defines += [ "WEBRTC_ARCH_ARM" ]
118 if (arm_version == 7) {
119 defines += [ "WEBRTC_ARCH_ARM_V7" ]
121 defines += [ "WEBRTC_ARCH_ARM_NEON" ]
123 defines += [ "WEBRTC_DETECT_ARM_NEON" ]
128 if (cpu_arch == "mipsel") {
129 defines += [ "MIPS32_LE" ]
131 defines += [ "MIPS_FPU_LE" ]
132 cflags += [ "-mhard-float" ]
134 cflags += [ "-msoft-float" ]
136 if (mips_arch_variant == "mips32r2") {
137 defines += [ "MIPS32_R2_LE" ]
138 cflags += [ "-mips32r2" ]
139 cflags_cc += [ "-mips32r2" ]
141 if (mips_dsp_rev == 1) {
142 defines += [ "MIPS_DSP_R1_LE" ]
143 cflags += [ "-mdsp" ]
144 cflags_cc += [ "-mdsp" ]
145 } else if (mips_dsp_rev == 2) {
150 cflags += [ "-mdspr2" ]
151 cflags_cc += [ "-mdspr2" ]
155 # TODO(kjellander): Handle warnings on Windows where WebRTC differ from the
156 # default warnings set in build/config/compiler/BUILD.gn.
158 if (is_android && is_clang) {
159 # The Android NDK doesn"t provide optimized versions of these
160 # functions. Ensure they are disabled for all compilers.
170 static_library("webrtc") {