blob: e758d868dc6f8791780a35473195e86d32f70248 [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",
22 "USE_WEBRTC_DEV_BRANCH",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000023 ]
24
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +000025 # TODO(henrike): issue 3307, make rtc_base build without disabling
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000026 # these flags.
27 cflags_cc = [ "-Wno-non-virtual-dtor" ]
28}
29
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +000030config("rtc_base_chromium_config") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000031 defines = [
32 "NO_MAIN_THREAD_WRAPPING",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000033 ]
34}
35
36config("openssl_config") {
37 defines = [
38 "SSL_USE_OPENSSL",
39 "HAVE_OPENSSL_SSL_H",
40 ]
41}
42
henrike@webrtc.org33a0e2d2014-10-27 18:13:40 +000043config("nss_config") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000044 defines = [
45 "SSL_USE_NSS",
46 "HAVE_NSS_SSL_H",
47 "SSL_USE_NSS_RNG",
48 ]
49}
50
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000051config("ios_config") {
kjellander@webrtc.org556caff2014-12-19 13:28:37 +000052 libs = [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000053 #"Foundation.framework", # Already included in //build/config:default_libs.
54 "Security.framework",
55 "SystemConfiguration.framework",
56 #"UIKit.framework", # Already included in //build/config:default_libs.
57 ]
58}
59
60config("mac_config") {
kjellander@webrtc.org556caff2014-12-19 13:28:37 +000061 libs = [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000062 "Cocoa.framework",
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",
67 ]
68}
69
70config("mac_x86_config") {
71 libs = [
72 #"Carbon.framework", # Already included in //build/config:default_libs.
73 ]
74}
75
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000076if (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") {
80 if (use_openssl) {
81 deps = [ "//third_party/boringssl" ]
82 } else {
83 deps = [ "//net/third_party/nss/ssl:libssl" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000084
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +000085 public_configs = [
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000086 "//net/third_party/nss/ssl:ssl_config",
87 "//third_party/nss:system_nss_no_ssl_config",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000088 ]
89 }
90 }
91}
92
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000093if (rtc_build_ssl == 0) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000094 config("external_ssl_library") {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000095 assert(rtc_ssl_root != "",
96 "You must specify rtc_ssl_root when rtc_build_ssl==0.")
97 include_dirs = [ rtc_ssl_root ]
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000098 }
99}
kjellander@webrtc.org4a251992014-08-18 17:56:28 +0000100
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000101# The subset of rtc_base approved for use outside of libjingle.
102static_library("rtc_base_approved") {
103 configs += [ "..:common_config" ]
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000104 public_configs = [ "..:common_inherited_config" ]
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000105
106 sources = [
107 "checks.cc",
108 "checks.h",
109 "exp_filter.cc",
110 "exp_filter.h",
111 "md5.cc",
112 "md5.h",
113 "md5digest.h",
xians@webrtc.orge46bc772014-10-10 08:36:56 +0000114 "platform_file.cc",
115 "platform_file.h",
andrew@webrtc.org0ab42bc2014-12-17 22:56:09 +0000116 "safe_conversions.h",
117 "safe_conversions_impl.h",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000118 "stringencode.cc",
119 "stringencode.h",
120 "stringutils.cc",
121 "stringutils.h",
kwiberg@webrtc.orgaf9d56f2015-01-13 20:32:04 +0000122 "template_util.h",
pbos@webrtc.org38344ed2014-09-24 06:05:00 +0000123 "thread_annotations.h",
tommi@webrtc.org04cd4662015-01-26 15:27:29 +0000124 "thread_checker.h",
125 "thread_checker_impl.cc",
126 "thread_checker_impl.h",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000127 "timeutils.cc",
128 "timeutils.h",
129 ]
130}
131
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000132static_library("rtc_base") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000133 cflags = []
134 cflags_cc = []
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000135 libs = []
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000136 deps = [
137 ":rtc_base_approved",
138 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000139
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000140 configs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000141 "..:common_config",
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000142 ":rtc_base_config",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000143 ]
144
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000145 public_configs = [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000146 "..:common_inherited_config",
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000147 ":rtc_base_config",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000148 ]
149
150 defines = [
151 "LOGGING=1",
152 "USE_WEBRTC_DEV_BRANCH",
153 ]
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",
tommi@webrtc.orgfe196992015-02-07 22:35:54 +0000186 "event.cc",
187 "event.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000188 "fileutils.cc",
189 "fileutils.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000190 "firewallsocketserver.cc",
191 "firewallsocketserver.h",
192 "flags.cc",
193 "flags.h",
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000194 "format_macros.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000195 "gunit_prod.h",
196 "helpers.cc",
197 "helpers.h",
198 "httpbase.cc",
199 "httpbase.h",
200 "httpclient.cc",
201 "httpclient.h",
202 "httpcommon-inl.h",
203 "httpcommon.cc",
204 "httpcommon.h",
205 "httprequest.cc",
206 "httprequest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000207 "iosfilesystem.mm",
208 "ipaddress.cc",
209 "ipaddress.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000210 "linked_ptr.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000211 "mathutils.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000212 "messagedigest.cc",
213 "messagedigest.h",
214 "messagehandler.cc",
215 "messagehandler.h",
216 "messagequeue.cc",
217 "messagequeue.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000218 "nethelpers.cc",
219 "nethelpers.h",
220 "network.cc",
221 "network.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000222 "nullsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000223 "pathutils.cc",
224 "pathutils.h",
225 "physicalsocketserver.cc",
226 "physicalsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000227 "proxydetect.cc",
228 "proxydetect.h",
229 "proxyinfo.cc",
230 "proxyinfo.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000231 "ratelimiter.cc",
232 "ratelimiter.h",
233 "ratetracker.cc",
234 "ratetracker.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000235 "scoped_autorelease_pool.h",
236 "scoped_autorelease_pool.mm",
237 "scoped_ptr.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000238 "sha1.cc",
239 "sha1.h",
240 "sha1digest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000241 "signalthread.cc",
242 "signalthread.h",
243 "sigslot.h",
244 "sigslotrepeater.h",
245 "socket.h",
246 "socketadapters.cc",
247 "socketadapters.h",
248 "socketaddress.cc",
249 "socketaddress.h",
250 "socketaddresspair.cc",
251 "socketaddresspair.h",
252 "socketfactory.h",
253 "socketpool.cc",
254 "socketpool.h",
255 "socketserver.h",
256 "socketstream.cc",
257 "socketstream.h",
258 "ssladapter.cc",
259 "ssladapter.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000260 "sslfingerprint.cc",
261 "sslfingerprint.h",
262 "sslidentity.cc",
263 "sslidentity.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000264 "sslsocketfactory.cc",
265 "sslsocketfactory.h",
266 "sslstreamadapter.cc",
267 "sslstreamadapter.h",
268 "sslstreamadapterhelper.cc",
269 "sslstreamadapterhelper.h",
270 "stream.cc",
271 "stream.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000272 "systeminfo.cc",
273 "systeminfo.h",
274 "task.cc",
275 "task.h",
276 "taskparent.cc",
277 "taskparent.h",
278 "taskrunner.cc",
279 "taskrunner.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000280 "thread.cc",
281 "thread.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000282 "timing.cc",
283 "timing.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000284 "urlencode.cc",
285 "urlencode.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000286 "worker.cc",
287 "worker.h",
288 ]
289
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000290 if (is_posix) {
291 sources += [
292 "unixfilesystem.cc",
293 "unixfilesystem.h",
294 ]
295 }
296
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000297 if (build_with_chromium) {
298 sources += [
299 "../overrides/webrtc/base/basictypes.h",
300 "../overrides/webrtc/base/constructormagic.h",
301 "../overrides/webrtc/base/logging.cc",
302 "../overrides/webrtc/base/logging.h",
303 ]
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000304
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
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000381 if (is_posix) {
382 sources += [
383 "latebindingsymboltable.cc",
384 "latebindingsymboltable.cc.def",
385 "latebindingsymboltable.h",
386 "latebindingsymboltable.h.def",
387 "posix.cc",
388 "posix.h",
389 ]
390 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000391
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000392 if (is_linux) {
393 sources += [
394 "dbus.cc",
395 "dbus.h",
396 "libdbusglibsymboltable.cc",
397 "libdbusglibsymboltable.h",
398 "linuxfdwalk.c",
399 "linuxfdwalk.h",
henrike@webrtc.orgfb1eb432014-08-15 14:44:13 +0000400 ]
401 }
402
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000403 if (is_mac) {
404 sources += [
405 "macasyncsocket.cc",
406 "macasyncsocket.h",
407 "maccocoasocketserver.h",
408 "maccocoasocketserver.mm",
409 "macsocketserver.cc",
410 "macsocketserver.h",
411 "macwindowpicker.cc",
412 "macwindowpicker.h",
413 ]
414 }
415
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000416 if (is_win) {
417 sources += [
418 "diskcache_win32.cc",
419 "diskcache_win32.h",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000420 "win32regkey.cc",
421 "win32regkey.h",
422 "win32socketinit.cc",
423 "win32socketinit.h",
424 "win32socketserver.cc",
425 "win32socketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000426 ]
427 }
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000428 if (rtc_build_json) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000429 deps += [ "//third_party/jsoncpp" ]
430 } else {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000431 include_dirs += [ rtc_jsoncpp_root ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000432
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000433 # When defined changes the include path for json.h to where it is
434 # expected to be when building json outside of the standalone build.
435 defines += [ "WEBRTC_EXTERNAL_JSON" ]
436 }
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000437 } # !build_with_chromium
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000438
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000439 if (is_clang) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000440 # Suppress warnings from the Chrome Clang plugins.
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000441 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
442 configs -= [ "//build/config/clang:find_bad_constructs" ]
443 }
444
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000445 # TODO(henrike): issue 3307, make rtc_base build with the Chromium default
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000446 # compiler settings.
447 configs -= [ "//build/config/compiler:chromium_code" ]
448 configs += [ "//build/config/compiler:no_chromium_code" ]
kjellander@webrtc.orgc8bc7172014-12-12 12:10:46 +0000449 if (!is_win) {
450 cflags += [ "-Wno-uninitialized" ]
451 cflags_cc += [ "-Wno-non-virtual-dtor" ]
452 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000453
454 if (use_openssl) {
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000455 public_configs += [ ":openssl_config" ]
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000456 if (rtc_build_ssl) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000457 deps += [ "//third_party/boringssl" ]
458 } else {
459 configs += [ "external_ssl_library" ]
460 }
pthatcher@webrtc.org5d0071f2014-09-26 18:53:40 +0000461 sources += [
462 "openssl.h",
463 "openssladapter.cc",
464 "openssladapter.h",
465 "openssldigest.cc",
466 "openssldigest.h",
467 "opensslidentity.cc",
468 "opensslidentity.h",
469 "opensslstreamadapter.cc",
470 "opensslstreamadapter.h",
471 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000472 } else {
henrike@webrtc.org33a0e2d2014-10-27 18:13:40 +0000473 public_configs += [ ":nss_config" ]
474 if (rtc_build_ssl) {
475 if (build_with_chromium) {
476 deps += [ "//crypto:platform" ]
477 } else {
478 deps += [ "//net/third_party/nss/ssl:libssl" ]
479 if (is_linux) {
480 deps += [ ":linux_system_ssl" ]
481 } else {
482 deps += [
483 "//third_party/nss:nspr",
484 "//third_party/nss:nss",
485 ]
486 }
487 }
488 } else {
489 configs += [ "external_ssl_library" ]
490 }
pthatcher@webrtc.org5d0071f2014-09-26 18:53:40 +0000491 sources += [
492 "nssidentity.cc",
493 "nssidentity.h",
494 "nssstreamadapter.cc",
495 "nssstreamadapter.h",
496 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000497 }
498
499 if (is_android) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000500 sources += [
501 "ifaddrs-android.cc",
502 "ifaddrs-android.h",
503 ]
504
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000505 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000506 "log",
507 "GLESv2"
508 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000509 }
510
511 if (is_ios) {
512 all_dependent_configs += [ ":ios_config" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000513 }
514
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000515 if (use_x11) {
516 sources += [
517 "x11windowpicker.cc",
518 "x11windowpicker.h",
519 ]
520 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000521 "dl",
522 "rt",
523 "Xext",
524 "X11",
525 "Xcomposite",
526 "Xrender",
527 ]
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000528 }
529
530 if (is_linux) {
531 libs += [
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000532 "dl",
533 "rt",
534 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000535 }
536
537 if (is_mac) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000538 sources += [
539 "maccocoathreadhelper.h",
540 "maccocoathreadhelper.mm",
541 "macconversion.cc",
542 "macconversion.h",
543 "macutils.cc",
544 "macutils.h",
545 ]
546
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000547 all_dependent_configs = [ ":mac_config" ]
548
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000549 if (cpu_arch == "x86") {
550 all_dependent_configs += [ ":mac_x86_config" ]
551 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000552 }
553
554 if (is_win) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000555 sources += [
556 "schanneladapter.cc",
557 "schanneladapter.h",
558 "win32.cc",
559 "win32.h",
560 "win32filesystem.cc",
561 "win32filesystem.h",
562 "win32securityerrors.cc",
563 "win32window.cc",
564 "win32window.h",
565 "win32windowpicker.cc",
566 "win32windowpicker.h",
567 "winfirewall.cc",
568 "winfirewall.h",
569 "winping.cc",
570 "winping.h",
571 ]
572
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000573 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000574 "crypt32.lib",
575 "iphlpapi.lib",
576 "secur32.lib",
577 ]
578
579 cflags += [
580 # Suppress warnings about WIN32_LEAN_AND_MEAN.
581 "/wd4005",
582 "/wd4703",
583 ]
584
585 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000586 }
587
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000588 if (is_posix && is_debug) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000589 # The Chromium build/common.gypi defines this for all posix
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000590 # _except_ for ios & mac. We want it there as well, e.g.
591 # because ASSERT and friends trigger off of it.
592 defines += [ "_DEBUG" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000593 }
594
595 if (is_ios || (is_mac && cpu_arch != "x86")) {
596 defines += [ "CARBON_DEPRECATED=YES" ]
597 }
598
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000599 if (is_linux || is_android) {
600 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000601 "linux.cc",
602 "linux.h",
603 ]
604 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000605}