blob: 21235d301ce45cc250bdb10f82ac336904dfed88 [file] [log] [blame]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +00001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
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.
8
9import("//build/config/crypto.gni")
henrike@webrtc.orgfb1eb432014-08-15 14:44:13 +000010import("//build/config/ui.gni")
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000011import("../build/webrtc.gni")
12
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +000013config("rtc_base_config") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000014 include_dirs = [
15 "//third_party/jsoncpp/overrides/include",
16 "//third_party/jsoncpp/source/include",
17 ]
18
19 defines = [
20 "FEATURE_ENABLE_SSL",
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000021 "LOGGING=1",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000022 ]
23
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +000024 # TODO(henrike): issue 3307, make rtc_base build without disabling
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000025 # these flags.
26 cflags_cc = [ "-Wno-non-virtual-dtor" ]
27}
28
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +000029config("rtc_base_chromium_config") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000030 defines = [
31 "NO_MAIN_THREAD_WRAPPING",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000032 ]
33}
34
35config("openssl_config") {
36 defines = [
37 "SSL_USE_OPENSSL",
38 "HAVE_OPENSSL_SSL_H",
39 ]
40}
41
henrike@webrtc.org33a0e2d2014-10-27 18:13:40 +000042config("nss_config") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000043 defines = [
44 "SSL_USE_NSS",
45 "HAVE_NSS_SSL_H",
46 "SSL_USE_NSS_RNG",
47 ]
48}
49
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000050config("ios_config") {
kjellander@webrtc.org556caff2014-12-19 13:28:37 +000051 libs = [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000052 #"Foundation.framework", # Already included in //build/config:default_libs.
53 "Security.framework",
54 "SystemConfiguration.framework",
55 #"UIKit.framework", # Already included in //build/config:default_libs.
56 ]
57}
58
59config("mac_config") {
kjellander@webrtc.org556caff2014-12-19 13:28:37 +000060 libs = [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000061 "Cocoa.framework",
62 #"Foundation.framework", # Already included in //build/config:default_libs.
63 #"IOKit.framework", # Already included in //build/config:default_libs.
64 #"Security.framework", # Already included in //build/config:default_libs.
65 "SystemConfiguration.framework",
66 ]
67}
68
69config("mac_x86_config") {
70 libs = [
71 #"Carbon.framework", # Already included in //build/config:default_libs.
72 ]
73}
74
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000075if (is_linux && !build_with_chromium) {
76 # Provides the same functionality as the //crypto:platform target, which
77 # WebRTC cannot use as we don't sync src/crypto from Chromium.
78 group("linux_system_ssl") {
79 if (use_openssl) {
80 deps = [ "//third_party/boringssl" ]
81 } else {
82 deps = [ "//net/third_party/nss/ssl:libssl" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000083
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +000084 public_configs = [
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000085 "//net/third_party/nss/ssl:ssl_config",
86 "//third_party/nss:system_nss_no_ssl_config",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000087 ]
88 }
89 }
90}
91
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000092if (rtc_build_ssl == 0) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000093 config("external_ssl_library") {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000094 assert(rtc_ssl_root != "",
95 "You must specify rtc_ssl_root when rtc_build_ssl==0.")
96 include_dirs = [ rtc_ssl_root ]
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000097 }
98}
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000099
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000100# The subset of rtc_base approved for use outside of libjingle.
101static_library("rtc_base_approved") {
102 configs += [ "..:common_config" ]
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000103 public_configs = [ "..:common_inherited_config" ]
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000104
105 sources = [
106 "checks.cc",
107 "checks.h",
tommi@webrtc.org4c0fd962015-02-09 10:23:27 +0000108 "event.cc",
109 "event.h",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000110 "exp_filter.cc",
111 "exp_filter.h",
112 "md5.cc",
113 "md5.h",
114 "md5digest.h",
xians@webrtc.orge46bc772014-10-10 08:36:56 +0000115 "platform_file.cc",
116 "platform_file.h",
andrew@webrtc.org0ab42bc2014-12-17 22:56:09 +0000117 "safe_conversions.h",
118 "safe_conversions_impl.h",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000119 "stringencode.cc",
120 "stringencode.h",
121 "stringutils.cc",
122 "stringutils.h",
kwiberg@webrtc.orgaf9d56f2015-01-13 20:32:04 +0000123 "template_util.h",
pbos@webrtc.org38344ed2014-09-24 06:05:00 +0000124 "thread_annotations.h",
tommi@webrtc.org04cd4662015-01-26 15:27:29 +0000125 "thread_checker.h",
126 "thread_checker_impl.cc",
127 "thread_checker_impl.h",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000128 "timeutils.cc",
129 "timeutils.h",
130 ]
131}
132
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000133static_library("rtc_base") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000134 cflags = []
135 cflags_cc = []
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000136 libs = []
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000137 deps = [
138 ":rtc_base_approved",
139 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000140
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000141 configs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000142 "..:common_config",
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000143 ":rtc_base_config",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000144 ]
145
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000146 public_configs = [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000147 "..:common_inherited_config",
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000148 ":rtc_base_config",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000149 ]
150
151 defines = [
152 "LOGGING=1",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000153 ]
154
155 sources = [
pkasting@chromium.orge7a4a122015-01-28 21:36:55 +0000156 "arraysize.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000157 "asyncfile.cc",
158 "asyncfile.h",
159 "asynchttprequest.cc",
160 "asynchttprequest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000161 "asyncpacketsocket.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000162 "asyncsocket.cc",
163 "asyncsocket.h",
164 "asynctcpsocket.cc",
165 "asynctcpsocket.h",
166 "asyncudpsocket.cc",
167 "asyncudpsocket.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000168 "autodetectproxy.cc",
169 "autodetectproxy.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000170 "base64.cc",
171 "base64.h",
172 "basicdefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000173 "bytebuffer.cc",
174 "bytebuffer.h",
175 "byteorder.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000176 "common.cc",
177 "common.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000178 "cpumonitor.cc",
179 "cpumonitor.h",
180 "crc32.cc",
181 "crc32.h",
182 "criticalsection.h",
183 "cryptstring.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000184 "diskcache.cc",
185 "diskcache.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000186 "fileutils.cc",
187 "fileutils.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000188 "firewallsocketserver.cc",
189 "firewallsocketserver.h",
190 "flags.cc",
191 "flags.h",
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000192 "format_macros.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000193 "gunit_prod.h",
194 "helpers.cc",
195 "helpers.h",
196 "httpbase.cc",
197 "httpbase.h",
198 "httpclient.cc",
199 "httpclient.h",
200 "httpcommon-inl.h",
201 "httpcommon.cc",
202 "httpcommon.h",
203 "httprequest.cc",
204 "httprequest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000205 "iosfilesystem.mm",
206 "ipaddress.cc",
207 "ipaddress.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000208 "linked_ptr.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000209 "mathutils.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000210 "messagedigest.cc",
211 "messagedigest.h",
212 "messagehandler.cc",
213 "messagehandler.h",
214 "messagequeue.cc",
215 "messagequeue.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000216 "nethelpers.cc",
217 "nethelpers.h",
218 "network.cc",
219 "network.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000220 "nullsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000221 "pathutils.cc",
222 "pathutils.h",
223 "physicalsocketserver.cc",
224 "physicalsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000225 "proxydetect.cc",
226 "proxydetect.h",
227 "proxyinfo.cc",
228 "proxyinfo.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000229 "ratelimiter.cc",
230 "ratelimiter.h",
231 "ratetracker.cc",
232 "ratetracker.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000233 "scoped_autorelease_pool.h",
234 "scoped_autorelease_pool.mm",
235 "scoped_ptr.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000236 "sha1.cc",
237 "sha1.h",
238 "sha1digest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000239 "signalthread.cc",
240 "signalthread.h",
241 "sigslot.h",
242 "sigslotrepeater.h",
243 "socket.h",
244 "socketadapters.cc",
245 "socketadapters.h",
246 "socketaddress.cc",
247 "socketaddress.h",
248 "socketaddresspair.cc",
249 "socketaddresspair.h",
250 "socketfactory.h",
251 "socketpool.cc",
252 "socketpool.h",
253 "socketserver.h",
254 "socketstream.cc",
255 "socketstream.h",
256 "ssladapter.cc",
257 "ssladapter.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000258 "sslfingerprint.cc",
259 "sslfingerprint.h",
260 "sslidentity.cc",
261 "sslidentity.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000262 "sslsocketfactory.cc",
263 "sslsocketfactory.h",
264 "sslstreamadapter.cc",
265 "sslstreamadapter.h",
266 "sslstreamadapterhelper.cc",
267 "sslstreamadapterhelper.h",
268 "stream.cc",
269 "stream.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000270 "systeminfo.cc",
271 "systeminfo.h",
272 "task.cc",
273 "task.h",
274 "taskparent.cc",
275 "taskparent.h",
276 "taskrunner.cc",
277 "taskrunner.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000278 "thread.cc",
279 "thread.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000280 "timing.cc",
281 "timing.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000282 "urlencode.cc",
283 "urlencode.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000284 "worker.cc",
285 "worker.h",
286 ]
287
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000288 if (is_posix) {
289 sources += [
290 "unixfilesystem.cc",
291 "unixfilesystem.h",
292 ]
293 }
294
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000295 if (build_with_chromium) {
296 sources += [
297 "../overrides/webrtc/base/basictypes.h",
298 "../overrides/webrtc/base/constructormagic.h",
299 "../overrides/webrtc/base/logging.cc",
300 "../overrides/webrtc/base/logging.h",
301 ]
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000302
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000303 deps += [ "..:webrtc_common" ]
304
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000305 if (is_win) {
306 sources += [ "../overrides/webrtc/base/win32socketinit.cc" ]
307 }
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000308
309 include_dirs = [
310 "../overrides",
henrike@webrtc.org6ac22e62014-08-11 21:06:30 +0000311 "../../boringssl/src/include",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000312 ]
313
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000314 public_configs += [ ":rtc_base_chromium_config" ]
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000315 } else {
316 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000317 "asyncinvoker.cc",
318 "asyncinvoker.h",
319 "asyncinvoker-inl.h",
320 "asyncresolverinterface.h",
321 "atomicops.h",
322 "bandwidthsmoother.cc",
323 "bandwidthsmoother.h",
324 "basictypes.h",
325 "bind.h",
326 "bind.h.pump",
327 "buffer.h",
328 "callback.h",
329 "callback.h.pump",
330 "constructormagic.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000331 "filelock.cc",
332 "filelock.h",
333 "fileutils_mock.h",
334 "genericslot.h",
335 "genericslot.h.pump",
336 "httpserver.cc",
337 "httpserver.h",
338 "json.cc",
339 "json.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000340 "logging.cc",
341 "logging.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000342 "mathutils.h",
343 "multipart.cc",
344 "multipart.h",
345 "natserver.cc",
346 "natserver.h",
347 "natsocketfactory.cc",
348 "natsocketfactory.h",
349 "nattypes.cc",
350 "nattypes.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000351 "optionsfile.cc",
352 "optionsfile.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000353 "profiler.cc",
354 "profiler.h",
355 "proxyserver.cc",
356 "proxyserver.h",
357 "refcount.h",
358 "referencecountedsingletonfactory.h",
359 "rollingaccumulator.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000360 "scopedptrcollection.h",
361 "scoped_ref_ptr.h",
362 "sec_buffer.h",
tommi@webrtc.orgfe196992015-02-07 22:35:54 +0000363 "sharedexclusivelock.cc",
364 "sharedexclusivelock.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000365 "sslconfig.h",
366 "sslroots.h",
367 "stringdigest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000368 "testclient.cc",
369 "testclient.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000370 "transformadapter.cc",
371 "transformadapter.h",
372 "versionparsing.cc",
373 "versionparsing.h",
374 "virtualsocketserver.cc",
375 "virtualsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000376 "window.h",
377 "windowpickerfactory.h",
378 "windowpicker.h",
379 ]
380
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000381 deps += [ "..:webrtc_common" ]
382
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000383 if (is_posix) {
384 sources += [
385 "latebindingsymboltable.cc",
386 "latebindingsymboltable.cc.def",
387 "latebindingsymboltable.h",
388 "latebindingsymboltable.h.def",
389 "posix.cc",
390 "posix.h",
391 ]
392 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000393
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000394 if (is_linux) {
395 sources += [
396 "dbus.cc",
397 "dbus.h",
398 "libdbusglibsymboltable.cc",
399 "libdbusglibsymboltable.h",
400 "linuxfdwalk.c",
401 "linuxfdwalk.h",
henrike@webrtc.orgfb1eb432014-08-15 14:44:13 +0000402 ]
403 }
404
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000405 if (is_mac) {
406 sources += [
407 "macasyncsocket.cc",
408 "macasyncsocket.h",
409 "maccocoasocketserver.h",
410 "maccocoasocketserver.mm",
411 "macsocketserver.cc",
412 "macsocketserver.h",
413 "macwindowpicker.cc",
414 "macwindowpicker.h",
415 ]
416 }
417
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000418 if (is_win) {
419 sources += [
420 "diskcache_win32.cc",
421 "diskcache_win32.h",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000422 "win32regkey.cc",
423 "win32regkey.h",
424 "win32socketinit.cc",
425 "win32socketinit.h",
426 "win32socketserver.cc",
427 "win32socketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000428 ]
429 }
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000430 if (rtc_build_json) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000431 deps += [ "//third_party/jsoncpp" ]
432 } else {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000433 include_dirs += [ rtc_jsoncpp_root ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000434
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000435 # When defined changes the include path for json.h to where it is
436 # expected to be when building json outside of the standalone build.
437 defines += [ "WEBRTC_EXTERNAL_JSON" ]
438 }
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000439 } # !build_with_chromium
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000440
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000441 if (is_clang) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000442 # Suppress warnings from the Chrome Clang plugins.
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000443 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
444 configs -= [ "//build/config/clang:find_bad_constructs" ]
445 }
446
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000447 # TODO(henrike): issue 3307, make rtc_base build with the Chromium default
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000448 # compiler settings.
449 configs -= [ "//build/config/compiler:chromium_code" ]
450 configs += [ "//build/config/compiler:no_chromium_code" ]
kjellander@webrtc.orgc8bc7172014-12-12 12:10:46 +0000451 if (!is_win) {
452 cflags += [ "-Wno-uninitialized" ]
453 cflags_cc += [ "-Wno-non-virtual-dtor" ]
454 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000455
456 if (use_openssl) {
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000457 public_configs += [ ":openssl_config" ]
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000458 if (rtc_build_ssl) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000459 deps += [ "//third_party/boringssl" ]
460 } else {
461 configs += [ "external_ssl_library" ]
462 }
pthatcher@webrtc.org5d0071f2014-09-26 18:53:40 +0000463 sources += [
464 "openssl.h",
465 "openssladapter.cc",
466 "openssladapter.h",
467 "openssldigest.cc",
468 "openssldigest.h",
469 "opensslidentity.cc",
470 "opensslidentity.h",
471 "opensslstreamadapter.cc",
472 "opensslstreamadapter.h",
473 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000474 } else {
henrike@webrtc.org33a0e2d2014-10-27 18:13:40 +0000475 public_configs += [ ":nss_config" ]
476 if (rtc_build_ssl) {
477 if (build_with_chromium) {
478 deps += [ "//crypto:platform" ]
479 } else {
480 deps += [ "//net/third_party/nss/ssl:libssl" ]
481 if (is_linux) {
482 deps += [ ":linux_system_ssl" ]
483 } else {
484 deps += [
485 "//third_party/nss:nspr",
486 "//third_party/nss:nss",
487 ]
488 }
489 }
490 } else {
491 configs += [ "external_ssl_library" ]
492 }
pthatcher@webrtc.org5d0071f2014-09-26 18:53:40 +0000493 sources += [
494 "nssidentity.cc",
495 "nssidentity.h",
496 "nssstreamadapter.cc",
497 "nssstreamadapter.h",
498 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000499 }
500
501 if (is_android) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000502 sources += [
503 "ifaddrs-android.cc",
504 "ifaddrs-android.h",
505 ]
506
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000507 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000508 "log",
509 "GLESv2"
510 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000511 }
512
513 if (is_ios) {
514 all_dependent_configs += [ ":ios_config" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000515 }
516
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000517 if (use_x11) {
518 sources += [
519 "x11windowpicker.cc",
520 "x11windowpicker.h",
521 ]
522 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000523 "dl",
524 "rt",
525 "Xext",
526 "X11",
527 "Xcomposite",
528 "Xrender",
529 ]
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000530 }
531
532 if (is_linux) {
533 libs += [
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000534 "dl",
535 "rt",
536 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000537 }
538
539 if (is_mac) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000540 sources += [
541 "maccocoathreadhelper.h",
542 "maccocoathreadhelper.mm",
543 "macconversion.cc",
544 "macconversion.h",
545 "macutils.cc",
546 "macutils.h",
547 ]
548
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000549 all_dependent_configs = [ ":mac_config" ]
550
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000551 if (current_cpu == "x86") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000552 all_dependent_configs += [ ":mac_x86_config" ]
553 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000554 }
555
556 if (is_win) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000557 sources += [
558 "schanneladapter.cc",
559 "schanneladapter.h",
560 "win32.cc",
561 "win32.h",
562 "win32filesystem.cc",
563 "win32filesystem.h",
564 "win32securityerrors.cc",
565 "win32window.cc",
566 "win32window.h",
567 "win32windowpicker.cc",
568 "win32windowpicker.h",
569 "winfirewall.cc",
570 "winfirewall.h",
571 "winping.cc",
572 "winping.h",
573 ]
574
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000575 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000576 "crypt32.lib",
577 "iphlpapi.lib",
578 "secur32.lib",
579 ]
580
581 cflags += [
582 # Suppress warnings about WIN32_LEAN_AND_MEAN.
583 "/wd4005",
584 "/wd4703",
585 ]
586
587 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000588 }
589
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000590 if (is_posix && is_debug) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000591 # The Chromium build/common.gypi defines this for all posix
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000592 # _except_ for ios & mac. We want it there as well, e.g.
593 # because ASSERT and friends trigger off of it.
594 defines += [ "_DEBUG" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000595 }
596
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000597 if (is_ios || (is_mac && current_cpu != "x86")) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000598 defines += [ "CARBON_DEPRECATED=YES" ]
599 }
600
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000601 if (is_linux || is_android) {
602 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000603 "linux.cc",
604 "linux.h",
605 ]
606 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000607}