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 # TODO(kjellander): Rebase this to base.gyp changes after r6438.
11 import("//build/config/crypto.gni")
12 import("//build/config/ui.gni")
13 import("../build/webrtc.gni")
15 config("webrtc_base_config") {
17 "//third_party/jsoncpp/overrides/include",
18 "//third_party/jsoncpp/source/include",
23 "GTEST_RELATIVE_PATH",
26 # TODO(henrike): issue 3307, make webrtc_base build without disabling
28 cflags_cc = [ "-Wno-non-virtual-dtor" ]
31 config("webrtc_base_chromium_config") {
33 "NO_MAIN_THREAD_WRAPPING",
38 config("openssl_config") {
45 config("no_openssl_config") {
53 config("android_config") {
54 defines = [ "HAVE_OPENSSL_SSL_H" ]
57 config("no_android_config") {
64 config("ios_config") {
66 #"Foundation.framework", # Already included in //build/config:default_libs.
68 "SystemConfiguration.framework",
69 #"UIKit.framework", # Already included in //build/config:default_libs.
73 config("mac_config") {
76 #"Foundation.framework", # Already included in //build/config:default_libs.
77 #"IOKit.framework", # Already included in //build/config:default_libs.
78 #"Security.framework", # Already included in //build/config:default_libs.
79 "SystemConfiguration.framework",
83 config("mac_x86_config") {
85 #"Carbon.framework", # Already included in //build/config:default_libs.
89 config("linux_system_ssl_config") {
90 visibility = ":*" # Only targets in this file can depend on this.
92 # TODO(kjellander): Find out how to convert GYP include_dirs+ (i.e. insert
93 # first in the include path?).
94 include_dirs = [ "//net/third_party/nss/ssl" ]
96 configs = [ "//third_party/nss:system_nss_no_ssl_config" ]
99 # Provides the same functionality as the build/linux/system.gyp:ssl GYP target.
100 # This cannot be in build/linux/BUILD.gn since targets in build/ are not allowed
101 # to depend on targets outside of it. This could be replaced by the Chromium
102 # //crypto:platform target, but as WebRTC currently don't sync src/crypto from
103 # Chromium, it is not possible today.
104 config("linux_system_ssl") {
106 deps = [ "//third_party/boringssl" ]
108 deps = [ "//net/third_party/nss/ssl:libssl" ]
110 direct_dependent_configs = [
111 ":linux_system_ssl_config",
116 # There is a broken header guard in /usr/include/nss/secmod.h:
117 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
124 static_library("webrtc_base") {
131 ":webrtc_base_config",
134 direct_dependent_configs = [
135 "..:common_inherited_config",
136 ":webrtc_base_config",
141 "USE_WEBRTC_DEV_BRANCH",
147 "asynchttprequest.cc",
148 "asynchttprequest.h",
149 "asyncpacketsocket.h",
156 "autodetectproxy.cc",
180 "firewallsocketserver.cc",
181 "firewallsocketserver.h",
216 "nssstreamadapter.cc",
217 "nssstreamadapter.h",
218 "nullsocketserver.h",
221 "physicalsocketserver.cc",
222 "physicalsocketserver.h",
231 "safe_conversions.h",
232 "safe_conversions_impl.h",
233 "scoped_autorelease_pool.h",
234 "scoped_autorelease_pool.mm",
248 "socketaddresspair.cc",
249 "socketaddresspair.h",
262 "sslsocketfactory.cc",
263 "sslsocketfactory.h",
264 "sslstreamadapter.cc",
265 "sslstreamadapter.h",
266 "sslstreamadapterhelper.cc",
267 "sslstreamadapterhelper.h",
301 if (build_with_chromium) {
303 "../overrides/webrtc/base/basictypes.h",
304 "../overrides/webrtc/base/constructormagic.h",
305 "../overrides/webrtc/base/logging.cc",
306 "../overrides/webrtc/base/logging.h",
310 sources += [ "../overrides/webrtc/base/win32socketinit.cc" ]
315 "../../boringssl/src/include",
318 direct_dependent_configs += [ ":webrtc_base_chromium_config" ]
323 "asyncinvoker-inl.h",
324 "asyncresolverinterface.h",
326 "bandwidthsmoother.cc",
327 "bandwidthsmoother.h",
334 "constructormagic.h",
339 "genericslot.h.pump",
351 "natsocketfactory.cc",
352 "natsocketfactory.h",
363 "referencecountedsingletonfactory.h",
364 "rollingaccumulator.h",
365 "scopedptrcollection.h",
368 "sharedexclusivelock.cc",
369 "sharedexclusivelock.h",
375 "transformadapter.cc",
376 "transformadapter.h",
379 "virtualsocketserver.cc",
380 "virtualsocketserver.h",
382 "windowpickerfactory.h",
388 "latebindingsymboltable.cc",
389 "latebindingsymboltable.cc.def",
390 "latebindingsymboltable.h",
391 "latebindingsymboltable.h.def",
401 "libdbusglibsymboltable.cc",
402 "libdbusglibsymboltable.h",
410 "x11windowpicker.cc",
419 "maccocoasocketserver.h",
420 "maccocoasocketserver.mm",
421 "macsocketserver.cc",
423 "macwindowpicker.cc",
430 "diskcache_win32.cc",
434 "win32socketinit.cc",
436 "win32socketserver.cc",
437 "win32socketserver.h",
441 deps += [ "//third_party/jsoncpp" ]
442 } # !build_with_chromium
444 # TODO(henrike): issue 3307, make webrtc_base build with the Chromium default
446 configs -= [ "//build/config/compiler:chromium_code" ]
447 configs += [ "//build/config/compiler:no_chromium_code" ]
448 cflags += [ "-Wno-uninitialized" ]
449 cflags_cc += [ "-Wno-non-virtual-dtor" ]
452 direct_dependent_configs += [ ":openssl_config" ]
454 deps += [ "//third_party/boringssl" ]
456 direct_dependent_configs += [ ":no_openssl_config" ]
461 "ifaddrs-android.cc",
465 direct_dependent_configs += [ ":android_config" ]
472 direct_dependent_configs += [ ":no_android_config" ]
476 all_dependent_configs += [ ":ios_config" ]
478 deps += [ "//net/third_party/nss/ssl:libssl" ]
491 configs += [ "//third_party/nss:system_nss_no_ssl_config" ]
496 "maccocoathreadhelper.h",
497 "maccocoathreadhelper.mm",
504 all_dependent_configs = [ ":mac_config" ]
507 "crypto", # $(SDKROOT)/usr/lib/libcrypto.dylib
508 "ssl", # $(SDKROOT)/usr/lib/libssl.dylib
510 if (cpu_arch == "x86") {
511 all_dependent_configs += [ ":mac_x86_config" ]
517 "schanneladapter.cc",
521 "win32filesystem.cc",
523 "win32securityerrors.cc",
526 "win32windowpicker.cc",
527 "win32windowpicker.h",
541 # Suppress warnings about WIN32_LEAN_AND_MEAN.
546 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
549 if (is_posix && is_debug) {
550 # Chromium's build/common.gypi defines this for all posix
551 # _except_ for ios & mac. We want it there as well, e.g.
552 # because ASSERT and friends trigger off of it.
553 defines += [ "_DEBUG" ]
556 if (is_ios || (is_mac && cpu_arch != "x86")) {
557 defines += [ "CARBON_DEPRECATED=YES" ]
560 if (!is_ios && is_posix) {
567 "opensslidentity.cc",
569 "opensslstreamadapter.cc",
570 "opensslstreamadapter.h",
574 if (is_linux || is_android) {
581 if (is_mac || is_ios || is_win) {
583 "//net/third_party/nss/ssl:libssl",
584 "//third_party/nss:nspr",
585 "//third_party/nss:nss",
589 if (is_posix && !is_mac && !is_ios && !is_android) {
590 configs += [ ":linux_system_ssl" ]