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/crypto.gni")
10 import("//build/config/ui.gni")
11 import("../build/webrtc.gni")
13 config("webrtc_base_config") {
15 "//third_party/jsoncpp/overrides/include",
16 "//third_party/jsoncpp/source/include",
22 "USE_WEBRTC_DEV_BRANCH",
25 # TODO(henrike): issue 3307, make webrtc_base build without disabling
27 cflags_cc = [ "-Wno-non-virtual-dtor" ]
30 config("webrtc_base_chromium_config") {
32 "NO_MAIN_THREAD_WRAPPING",
36 config("openssl_config") {
43 config("no_openssl_config") {
51 config("ios_config") {
53 #"Foundation.framework", # Already included in //build/config:default_libs.
55 "SystemConfiguration.framework",
56 #"UIKit.framework", # Already included in //build/config:default_libs.
60 config("mac_config") {
63 #"Foundation.framework", # Already included in //build/config:default_libs.
64 #"IOKit.framework", # Already included in //build/config:default_libs.
65 #"Security.framework", # Already included in //build/config:default_libs.
66 "SystemConfiguration.framework",
70 config("mac_x86_config") {
72 #"Carbon.framework", # Already included in //build/config:default_libs.
76 if (is_linux && !build_with_chromium) {
77 # Provides the same functionality as the //crypto:platform target, which
78 # WebRTC cannot use as we don't sync src/crypto from Chromium.
79 group("linux_system_ssl") {
81 deps = [ "//third_party/boringssl" ]
83 deps = [ "//net/third_party/nss/ssl:libssl" ]
85 direct_dependent_configs = [
86 "//net/third_party/nss/ssl:ssl_config",
87 "//third_party/nss:system_nss_no_ssl_config",
93 if (rtc_build_ssl == 0) {
94 config("external_ssl_library") {
95 assert(rtc_ssl_root != "",
96 "You must specify rtc_ssl_root when rtc_build_ssl==0.")
97 include_dirs = [ rtc_ssl_root ]
101 # The subset of rtc_base approved for use outside of libjingle.
102 static_library("rtc_base_approved") {
103 configs += [ "..:common_config" ]
104 direct_dependent_configs = [ "..:common_inherited_config" ]
120 "thread_annotations.h",
126 static_library("webrtc_base") {
131 ":rtc_base_approved",
136 ":webrtc_base_config",
139 direct_dependent_configs = [
140 "..:common_inherited_config",
141 ":webrtc_base_config",
146 "USE_WEBRTC_DEV_BRANCH",
152 "asynchttprequest.cc",
153 "asynchttprequest.h",
154 "asyncpacketsocket.h",
161 "autodetectproxy.cc",
183 "firewallsocketserver.cc",
184 "firewallsocketserver.h",
214 "nullsocketserver.h",
217 "physicalsocketserver.cc",
218 "physicalsocketserver.h",
227 "safe_conversions.h",
228 "safe_conversions_impl.h",
229 "scoped_autorelease_pool.h",
230 "scoped_autorelease_pool.mm",
244 "socketaddresspair.cc",
245 "socketaddresspair.h",
258 "sslsocketfactory.cc",
259 "sslsocketfactory.h",
260 "sslstreamadapter.cc",
261 "sslstreamadapter.h",
262 "sslstreamadapterhelper.cc",
263 "sslstreamadapterhelper.h",
277 "thread_checker_impl.cc",
278 "thread_checker_impl.h",
294 if (build_with_chromium) {
296 "../overrides/webrtc/base/basictypes.h",
297 "../overrides/webrtc/base/constructormagic.h",
298 "../overrides/webrtc/base/logging.cc",
299 "../overrides/webrtc/base/logging.h",
303 sources += [ "../overrides/webrtc/base/win32socketinit.cc" ]
308 "../../boringssl/src/include",
311 direct_dependent_configs += [ ":webrtc_base_chromium_config" ]
316 "asyncinvoker-inl.h",
317 "asyncresolverinterface.h",
319 "bandwidthsmoother.cc",
320 "bandwidthsmoother.h",
327 "constructormagic.h",
332 "genericslot.h.pump",
344 "natsocketfactory.cc",
345 "natsocketfactory.h",
355 "referencecountedsingletonfactory.h",
356 "rollingaccumulator.h",
357 "scopedptrcollection.h",
360 "sharedexclusivelock.cc",
361 "sharedexclusivelock.h",
367 "transformadapter.cc",
368 "transformadapter.h",
371 "virtualsocketserver.cc",
372 "virtualsocketserver.h",
374 "windowpickerfactory.h",
380 "latebindingsymboltable.cc",
381 "latebindingsymboltable.cc.def",
382 "latebindingsymboltable.h",
383 "latebindingsymboltable.h.def",
393 "libdbusglibsymboltable.cc",
394 "libdbusglibsymboltable.h",
404 "maccocoasocketserver.h",
405 "maccocoasocketserver.mm",
406 "macsocketserver.cc",
408 "macwindowpicker.cc",
415 "diskcache_win32.cc",
419 "win32socketinit.cc",
421 "win32socketserver.cc",
422 "win32socketserver.h",
425 if (rtc_build_json) {
426 deps += [ "//third_party/jsoncpp" ]
428 include_dirs += [ rtc_jsoncpp_root ]
430 # When defined changes the include path for json.h to where it is
431 # expected to be when building json outside of the standalone build.
432 defines += [ "WEBRTC_EXTERNAL_JSON" ]
434 } # !build_with_chromium
437 # Suppress warnings from the Chrome Clang plugins.
438 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
439 configs -= [ "//build/config/clang:find_bad_constructs" ]
442 # TODO(henrike): issue 3307, make webrtc_base build with the Chromium default
444 configs -= [ "//build/config/compiler:chromium_code" ]
445 configs += [ "//build/config/compiler:no_chromium_code" ]
446 cflags += [ "-Wno-uninitialized" ]
447 cflags_cc += [ "-Wno-non-virtual-dtor" ]
450 direct_dependent_configs += [ ":openssl_config" ]
452 deps += [ "//third_party/boringssl" ]
454 configs += [ "external_ssl_library" ]
462 "opensslidentity.cc",
464 "opensslstreamadapter.cc",
465 "opensslstreamadapter.h",
468 direct_dependent_configs += [ ":no_openssl_config" ]
472 "nssstreamadapter.cc",
473 "nssstreamadapter.h",
475 if (is_mac || is_ios || is_win) {
478 "//net/third_party/nss/ssl:libssl",
479 "//third_party/nss:nspr",
480 "//third_party/nss:nss",
483 configs += [ "external_ssl_library" ]
490 "ifaddrs-android.cc",
501 all_dependent_configs += [ ":ios_config" ]
506 "x11windowpicker.cc",
526 configs += [ "//third_party/nss:system_nss_no_ssl_config" ]
532 "maccocoathreadhelper.h",
533 "maccocoathreadhelper.mm",
540 all_dependent_configs = [ ":mac_config" ]
542 if (cpu_arch == "x86") {
543 all_dependent_configs += [ ":mac_x86_config" ]
549 "schanneladapter.cc",
553 "win32filesystem.cc",
555 "win32securityerrors.cc",
558 "win32windowpicker.cc",
559 "win32windowpicker.h",
573 # Suppress warnings about WIN32_LEAN_AND_MEAN.
578 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
581 if (is_posix && is_debug) {
582 # The Chromium build/common.gypi defines this for all posix
583 # _except_ for ios & mac. We want it there as well, e.g.
584 # because ASSERT and friends trigger off of it.
585 defines += [ "_DEBUG" ]
588 if (is_ios || (is_mac && cpu_arch != "x86")) {
589 defines += [ "CARBON_DEPRECATED=YES" ]
592 if (is_linux || is_android) {
599 if (is_posix && !is_mac && !is_ios && !is_android) {
600 if (build_with_chromium) {
601 deps += [ "//crypto:platform" ]
604 deps += [ ":linux_system_ssl" ]
606 configs += [ "external_ssl_library" ]