blob: 54fcdca97e92ddddfcaacf299ae9cef3c7fd791c [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 +0000132# Temporary target until Chromium's use of webrtc_base is updated to rtc_base.
133# TODO(kjellander): Remove when this is rolled into Chromium's DEPS.
134group("webrtc_base") {
135 deps = [
136 ":rtc_base",
137 ]
138}
139
140static_library("rtc_base") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000141 cflags = []
142 cflags_cc = []
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000143 libs = []
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000144 deps = [
145 ":rtc_base_approved",
146 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000147
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000148 configs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000149 "..:common_config",
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000150 ":rtc_base_config",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000151 ]
152
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000153 public_configs = [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000154 "..:common_inherited_config",
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000155 ":rtc_base_config",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000156 ]
157
158 defines = [
159 "LOGGING=1",
160 "USE_WEBRTC_DEV_BRANCH",
161 ]
162
163 sources = [
164 "asyncfile.cc",
165 "asyncfile.h",
166 "asynchttprequest.cc",
167 "asynchttprequest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000168 "asyncpacketsocket.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000169 "asyncsocket.cc",
170 "asyncsocket.h",
171 "asynctcpsocket.cc",
172 "asynctcpsocket.h",
173 "asyncudpsocket.cc",
174 "asyncudpsocket.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000175 "autodetectproxy.cc",
176 "autodetectproxy.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000177 "base64.cc",
178 "base64.h",
179 "basicdefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000180 "bytebuffer.cc",
181 "bytebuffer.h",
182 "byteorder.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000183 "common.cc",
184 "common.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000185 "cpumonitor.cc",
186 "cpumonitor.h",
187 "crc32.cc",
188 "crc32.h",
189 "criticalsection.h",
190 "cryptstring.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000191 "diskcache.cc",
192 "diskcache.h",
193 "event.cc",
194 "event.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000195 "fileutils.cc",
196 "fileutils.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000197 "firewallsocketserver.cc",
198 "firewallsocketserver.h",
199 "flags.cc",
200 "flags.h",
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000201 "format_macros.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000202 "gunit_prod.h",
203 "helpers.cc",
204 "helpers.h",
205 "httpbase.cc",
206 "httpbase.h",
207 "httpclient.cc",
208 "httpclient.h",
209 "httpcommon-inl.h",
210 "httpcommon.cc",
211 "httpcommon.h",
212 "httprequest.cc",
213 "httprequest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000214 "iosfilesystem.mm",
215 "ipaddress.cc",
216 "ipaddress.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000217 "linked_ptr.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000218 "mathutils.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000219 "messagedigest.cc",
220 "messagedigest.h",
221 "messagehandler.cc",
222 "messagehandler.h",
223 "messagequeue.cc",
224 "messagequeue.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000225 "nethelpers.cc",
226 "nethelpers.h",
227 "network.cc",
228 "network.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000229 "nullsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000230 "pathutils.cc",
231 "pathutils.h",
232 "physicalsocketserver.cc",
233 "physicalsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000234 "proxydetect.cc",
235 "proxydetect.h",
236 "proxyinfo.cc",
237 "proxyinfo.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000238 "ratelimiter.cc",
239 "ratelimiter.h",
240 "ratetracker.cc",
241 "ratetracker.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000242 "scoped_autorelease_pool.h",
243 "scoped_autorelease_pool.mm",
244 "scoped_ptr.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000245 "sha1.cc",
246 "sha1.h",
247 "sha1digest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000248 "signalthread.cc",
249 "signalthread.h",
250 "sigslot.h",
251 "sigslotrepeater.h",
252 "socket.h",
253 "socketadapters.cc",
254 "socketadapters.h",
255 "socketaddress.cc",
256 "socketaddress.h",
257 "socketaddresspair.cc",
258 "socketaddresspair.h",
259 "socketfactory.h",
260 "socketpool.cc",
261 "socketpool.h",
262 "socketserver.h",
263 "socketstream.cc",
264 "socketstream.h",
265 "ssladapter.cc",
266 "ssladapter.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000267 "sslfingerprint.cc",
268 "sslfingerprint.h",
269 "sslidentity.cc",
270 "sslidentity.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000271 "sslsocketfactory.cc",
272 "sslsocketfactory.h",
273 "sslstreamadapter.cc",
274 "sslstreamadapter.h",
275 "sslstreamadapterhelper.cc",
276 "sslstreamadapterhelper.h",
277 "stream.cc",
278 "stream.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000279 "systeminfo.cc",
280 "systeminfo.h",
281 "task.cc",
282 "task.h",
283 "taskparent.cc",
284 "taskparent.h",
285 "taskrunner.cc",
286 "taskrunner.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000287 "thread.cc",
288 "thread.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000289 "timing.cc",
290 "timing.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000291 "urlencode.cc",
292 "urlencode.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000293 "worker.cc",
294 "worker.h",
295 ]
296
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000297 if (is_posix) {
298 sources += [
299 "unixfilesystem.cc",
300 "unixfilesystem.h",
301 ]
302 }
303
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000304 if (build_with_chromium) {
305 sources += [
306 "../overrides/webrtc/base/basictypes.h",
307 "../overrides/webrtc/base/constructormagic.h",
308 "../overrides/webrtc/base/logging.cc",
309 "../overrides/webrtc/base/logging.h",
310 ]
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000311
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000312 if (is_win) {
313 sources += [ "../overrides/webrtc/base/win32socketinit.cc" ]
314 }
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000315
316 include_dirs = [
317 "../overrides",
henrike@webrtc.org6ac22e62014-08-11 21:06:30 +0000318 "../../boringssl/src/include",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000319 ]
320
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000321 public_configs += [ ":rtc_base_chromium_config" ]
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000322 } else {
323 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000324 "asyncinvoker.cc",
325 "asyncinvoker.h",
326 "asyncinvoker-inl.h",
327 "asyncresolverinterface.h",
328 "atomicops.h",
329 "bandwidthsmoother.cc",
330 "bandwidthsmoother.h",
331 "basictypes.h",
332 "bind.h",
333 "bind.h.pump",
334 "buffer.h",
335 "callback.h",
336 "callback.h.pump",
337 "constructormagic.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000338 "filelock.cc",
339 "filelock.h",
340 "fileutils_mock.h",
341 "genericslot.h",
342 "genericslot.h.pump",
343 "httpserver.cc",
344 "httpserver.h",
345 "json.cc",
346 "json.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000347 "logging.cc",
348 "logging.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000349 "mathutils.h",
350 "multipart.cc",
351 "multipart.h",
352 "natserver.cc",
353 "natserver.h",
354 "natsocketfactory.cc",
355 "natsocketfactory.h",
356 "nattypes.cc",
357 "nattypes.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000358 "optionsfile.cc",
359 "optionsfile.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000360 "profiler.cc",
361 "profiler.h",
362 "proxyserver.cc",
363 "proxyserver.h",
364 "refcount.h",
365 "referencecountedsingletonfactory.h",
366 "rollingaccumulator.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000367 "scopedptrcollection.h",
368 "scoped_ref_ptr.h",
369 "sec_buffer.h",
370 "sharedexclusivelock.cc",
371 "sharedexclusivelock.h",
372 "sslconfig.h",
373 "sslroots.h",
374 "stringdigest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000375 "testclient.cc",
376 "testclient.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000377 "transformadapter.cc",
378 "transformadapter.h",
379 "versionparsing.cc",
380 "versionparsing.h",
381 "virtualsocketserver.cc",
382 "virtualsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000383 "window.h",
384 "windowpickerfactory.h",
385 "windowpicker.h",
386 ]
387
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000388 if (is_posix) {
389 sources += [
390 "latebindingsymboltable.cc",
391 "latebindingsymboltable.cc.def",
392 "latebindingsymboltable.h",
393 "latebindingsymboltable.h.def",
394 "posix.cc",
395 "posix.h",
396 ]
397 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000398
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000399 if (is_linux) {
400 sources += [
401 "dbus.cc",
402 "dbus.h",
403 "libdbusglibsymboltable.cc",
404 "libdbusglibsymboltable.h",
405 "linuxfdwalk.c",
406 "linuxfdwalk.h",
henrike@webrtc.orgfb1eb432014-08-15 14:44:13 +0000407 ]
408 }
409
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000410 if (is_mac) {
411 sources += [
412 "macasyncsocket.cc",
413 "macasyncsocket.h",
414 "maccocoasocketserver.h",
415 "maccocoasocketserver.mm",
416 "macsocketserver.cc",
417 "macsocketserver.h",
418 "macwindowpicker.cc",
419 "macwindowpicker.h",
420 ]
421 }
422
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000423 if (is_win) {
424 sources += [
425 "diskcache_win32.cc",
426 "diskcache_win32.h",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000427 "win32regkey.cc",
428 "win32regkey.h",
429 "win32socketinit.cc",
430 "win32socketinit.h",
431 "win32socketserver.cc",
432 "win32socketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000433 ]
434 }
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000435 if (rtc_build_json) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000436 deps += [ "//third_party/jsoncpp" ]
437 } else {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000438 include_dirs += [ rtc_jsoncpp_root ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000439
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000440 # When defined changes the include path for json.h to where it is
441 # expected to be when building json outside of the standalone build.
442 defines += [ "WEBRTC_EXTERNAL_JSON" ]
443 }
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000444 } # !build_with_chromium
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000445
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000446 if (is_clang) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000447 # Suppress warnings from the Chrome Clang plugins.
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000448 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
449 configs -= [ "//build/config/clang:find_bad_constructs" ]
450 }
451
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000452 # TODO(henrike): issue 3307, make rtc_base build with the Chromium default
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000453 # compiler settings.
454 configs -= [ "//build/config/compiler:chromium_code" ]
455 configs += [ "//build/config/compiler:no_chromium_code" ]
kjellander@webrtc.orgc8bc7172014-12-12 12:10:46 +0000456 if (!is_win) {
457 cflags += [ "-Wno-uninitialized" ]
458 cflags_cc += [ "-Wno-non-virtual-dtor" ]
459 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000460
461 if (use_openssl) {
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000462 public_configs += [ ":openssl_config" ]
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000463 if (rtc_build_ssl) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000464 deps += [ "//third_party/boringssl" ]
465 } else {
466 configs += [ "external_ssl_library" ]
467 }
pthatcher@webrtc.org5d0071f2014-09-26 18:53:40 +0000468 sources += [
469 "openssl.h",
470 "openssladapter.cc",
471 "openssladapter.h",
472 "openssldigest.cc",
473 "openssldigest.h",
474 "opensslidentity.cc",
475 "opensslidentity.h",
476 "opensslstreamadapter.cc",
477 "opensslstreamadapter.h",
478 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000479 } else {
henrike@webrtc.org33a0e2d2014-10-27 18:13:40 +0000480 public_configs += [ ":nss_config" ]
481 if (rtc_build_ssl) {
482 if (build_with_chromium) {
483 deps += [ "//crypto:platform" ]
484 } else {
485 deps += [ "//net/third_party/nss/ssl:libssl" ]
486 if (is_linux) {
487 deps += [ ":linux_system_ssl" ]
488 } else {
489 deps += [
490 "//third_party/nss:nspr",
491 "//third_party/nss:nss",
492 ]
493 }
494 }
495 } else {
496 configs += [ "external_ssl_library" ]
497 }
pthatcher@webrtc.org5d0071f2014-09-26 18:53:40 +0000498 sources += [
499 "nssidentity.cc",
500 "nssidentity.h",
501 "nssstreamadapter.cc",
502 "nssstreamadapter.h",
503 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000504 }
505
506 if (is_android) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000507 sources += [
508 "ifaddrs-android.cc",
509 "ifaddrs-android.h",
510 ]
511
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000512 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000513 "log",
514 "GLESv2"
515 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000516 }
517
518 if (is_ios) {
519 all_dependent_configs += [ ":ios_config" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000520 }
521
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000522 if (use_x11) {
523 sources += [
524 "x11windowpicker.cc",
525 "x11windowpicker.h",
526 ]
527 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000528 "dl",
529 "rt",
530 "Xext",
531 "X11",
532 "Xcomposite",
533 "Xrender",
534 ]
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000535 }
536
537 if (is_linux) {
538 libs += [
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000539 "dl",
540 "rt",
541 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000542 }
543
544 if (is_mac) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000545 sources += [
546 "maccocoathreadhelper.h",
547 "maccocoathreadhelper.mm",
548 "macconversion.cc",
549 "macconversion.h",
550 "macutils.cc",
551 "macutils.h",
552 ]
553
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000554 all_dependent_configs = [ ":mac_config" ]
555
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000556 if (cpu_arch == "x86") {
557 all_dependent_configs += [ ":mac_x86_config" ]
558 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000559 }
560
561 if (is_win) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000562 sources += [
563 "schanneladapter.cc",
564 "schanneladapter.h",
565 "win32.cc",
566 "win32.h",
567 "win32filesystem.cc",
568 "win32filesystem.h",
569 "win32securityerrors.cc",
570 "win32window.cc",
571 "win32window.h",
572 "win32windowpicker.cc",
573 "win32windowpicker.h",
574 "winfirewall.cc",
575 "winfirewall.h",
576 "winping.cc",
577 "winping.h",
578 ]
579
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000580 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000581 "crypt32.lib",
582 "iphlpapi.lib",
583 "secur32.lib",
584 ]
585
586 cflags += [
587 # Suppress warnings about WIN32_LEAN_AND_MEAN.
588 "/wd4005",
589 "/wd4703",
590 ]
591
592 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000593 }
594
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000595 if (is_posix && is_debug) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000596 # The Chromium build/common.gypi defines this for all posix
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000597 # _except_ for ios & mac. We want it there as well, e.g.
598 # because ASSERT and friends trigger off of it.
599 defines += [ "_DEBUG" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000600 }
601
602 if (is_ios || (is_mac && cpu_arch != "x86")) {
603 defines += [ "CARBON_DEPRECATED=YES" ]
604 }
605
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000606 if (is_linux || is_android) {
607 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000608 "linux.cc",
609 "linux.h",
610 ]
611 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000612}