blob: 3bd978c4fe548e7617aecc8a88e04514175597ea [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
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000303 if (is_win) {
304 sources += [ "../overrides/webrtc/base/win32socketinit.cc" ]
305 }
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000306
307 include_dirs = [
308 "../overrides",
henrike@webrtc.org6ac22e62014-08-11 21:06:30 +0000309 "../../boringssl/src/include",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000310 ]
311
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000312 public_configs += [ ":rtc_base_chromium_config" ]
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000313 } else {
314 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000315 "asyncinvoker.cc",
316 "asyncinvoker.h",
317 "asyncinvoker-inl.h",
318 "asyncresolverinterface.h",
319 "atomicops.h",
320 "bandwidthsmoother.cc",
321 "bandwidthsmoother.h",
322 "basictypes.h",
323 "bind.h",
324 "bind.h.pump",
325 "buffer.h",
326 "callback.h",
327 "callback.h.pump",
328 "constructormagic.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000329 "filelock.cc",
330 "filelock.h",
331 "fileutils_mock.h",
332 "genericslot.h",
333 "genericslot.h.pump",
334 "httpserver.cc",
335 "httpserver.h",
336 "json.cc",
337 "json.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000338 "logging.cc",
339 "logging.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000340 "mathutils.h",
341 "multipart.cc",
342 "multipart.h",
343 "natserver.cc",
344 "natserver.h",
345 "natsocketfactory.cc",
346 "natsocketfactory.h",
347 "nattypes.cc",
348 "nattypes.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000349 "optionsfile.cc",
350 "optionsfile.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000351 "profiler.cc",
352 "profiler.h",
353 "proxyserver.cc",
354 "proxyserver.h",
355 "refcount.h",
356 "referencecountedsingletonfactory.h",
357 "rollingaccumulator.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000358 "scopedptrcollection.h",
359 "scoped_ref_ptr.h",
360 "sec_buffer.h",
tommi@webrtc.orgfe196992015-02-07 22:35:54 +0000361 "sharedexclusivelock.cc",
362 "sharedexclusivelock.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000363 "sslconfig.h",
364 "sslroots.h",
365 "stringdigest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000366 "testclient.cc",
367 "testclient.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000368 "transformadapter.cc",
369 "transformadapter.h",
370 "versionparsing.cc",
371 "versionparsing.h",
372 "virtualsocketserver.cc",
373 "virtualsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000374 "window.h",
375 "windowpickerfactory.h",
376 "windowpicker.h",
377 ]
378
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000379 if (is_posix) {
380 sources += [
381 "latebindingsymboltable.cc",
382 "latebindingsymboltable.cc.def",
383 "latebindingsymboltable.h",
384 "latebindingsymboltable.h.def",
385 "posix.cc",
386 "posix.h",
387 ]
388 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000389
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000390 if (is_linux) {
391 sources += [
392 "dbus.cc",
393 "dbus.h",
394 "libdbusglibsymboltable.cc",
395 "libdbusglibsymboltable.h",
396 "linuxfdwalk.c",
397 "linuxfdwalk.h",
henrike@webrtc.orgfb1eb432014-08-15 14:44:13 +0000398 ]
399 }
400
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000401 if (is_mac) {
402 sources += [
403 "macasyncsocket.cc",
404 "macasyncsocket.h",
405 "maccocoasocketserver.h",
406 "maccocoasocketserver.mm",
407 "macsocketserver.cc",
408 "macsocketserver.h",
409 "macwindowpicker.cc",
410 "macwindowpicker.h",
411 ]
412 }
413
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000414 if (is_win) {
415 sources += [
416 "diskcache_win32.cc",
417 "diskcache_win32.h",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000418 "win32regkey.cc",
419 "win32regkey.h",
420 "win32socketinit.cc",
421 "win32socketinit.h",
422 "win32socketserver.cc",
423 "win32socketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000424 ]
425 }
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000426 if (rtc_build_json) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000427 deps += [ "//third_party/jsoncpp" ]
428 } else {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000429 include_dirs += [ rtc_jsoncpp_root ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000430
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000431 # When defined changes the include path for json.h to where it is
432 # expected to be when building json outside of the standalone build.
433 defines += [ "WEBRTC_EXTERNAL_JSON" ]
434 }
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000435 } # !build_with_chromium
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000436
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000437 if (is_clang) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000438 # Suppress warnings from the Chrome Clang plugins.
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000439 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
440 configs -= [ "//build/config/clang:find_bad_constructs" ]
441 }
442
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000443 # TODO(henrike): issue 3307, make rtc_base build with the Chromium default
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000444 # compiler settings.
445 configs -= [ "//build/config/compiler:chromium_code" ]
446 configs += [ "//build/config/compiler:no_chromium_code" ]
kjellander@webrtc.orgc8bc7172014-12-12 12:10:46 +0000447 if (!is_win) {
448 cflags += [ "-Wno-uninitialized" ]
449 cflags_cc += [ "-Wno-non-virtual-dtor" ]
450 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000451
452 if (use_openssl) {
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000453 public_configs += [ ":openssl_config" ]
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000454 if (rtc_build_ssl) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000455 deps += [ "//third_party/boringssl" ]
456 } else {
457 configs += [ "external_ssl_library" ]
458 }
pthatcher@webrtc.org5d0071f2014-09-26 18:53:40 +0000459 sources += [
460 "openssl.h",
461 "openssladapter.cc",
462 "openssladapter.h",
463 "openssldigest.cc",
464 "openssldigest.h",
465 "opensslidentity.cc",
466 "opensslidentity.h",
467 "opensslstreamadapter.cc",
468 "opensslstreamadapter.h",
469 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000470 } else {
henrike@webrtc.org33a0e2d2014-10-27 18:13:40 +0000471 public_configs += [ ":nss_config" ]
472 if (rtc_build_ssl) {
473 if (build_with_chromium) {
474 deps += [ "//crypto:platform" ]
475 } else {
476 deps += [ "//net/third_party/nss/ssl:libssl" ]
477 if (is_linux) {
478 deps += [ ":linux_system_ssl" ]
479 } else {
480 deps += [
481 "//third_party/nss:nspr",
482 "//third_party/nss:nss",
483 ]
484 }
485 }
486 } else {
487 configs += [ "external_ssl_library" ]
488 }
pthatcher@webrtc.org5d0071f2014-09-26 18:53:40 +0000489 sources += [
490 "nssidentity.cc",
491 "nssidentity.h",
492 "nssstreamadapter.cc",
493 "nssstreamadapter.h",
494 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000495 }
496
497 if (is_android) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000498 sources += [
499 "ifaddrs-android.cc",
500 "ifaddrs-android.h",
501 ]
502
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000503 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000504 "log",
505 "GLESv2"
506 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000507 }
508
509 if (is_ios) {
510 all_dependent_configs += [ ":ios_config" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000511 }
512
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000513 if (use_x11) {
514 sources += [
515 "x11windowpicker.cc",
516 "x11windowpicker.h",
517 ]
518 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000519 "dl",
520 "rt",
521 "Xext",
522 "X11",
523 "Xcomposite",
524 "Xrender",
525 ]
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000526 }
527
528 if (is_linux) {
529 libs += [
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000530 "dl",
531 "rt",
532 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000533 }
534
535 if (is_mac) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000536 sources += [
537 "maccocoathreadhelper.h",
538 "maccocoathreadhelper.mm",
539 "macconversion.cc",
540 "macconversion.h",
541 "macutils.cc",
542 "macutils.h",
543 ]
544
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000545 all_dependent_configs = [ ":mac_config" ]
546
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000547 if (cpu_arch == "x86") {
548 all_dependent_configs += [ ":mac_x86_config" ]
549 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000550 }
551
552 if (is_win) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000553 sources += [
554 "schanneladapter.cc",
555 "schanneladapter.h",
556 "win32.cc",
557 "win32.h",
558 "win32filesystem.cc",
559 "win32filesystem.h",
560 "win32securityerrors.cc",
561 "win32window.cc",
562 "win32window.h",
563 "win32windowpicker.cc",
564 "win32windowpicker.h",
565 "winfirewall.cc",
566 "winfirewall.h",
567 "winping.cc",
568 "winping.h",
569 ]
570
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000571 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000572 "crypt32.lib",
573 "iphlpapi.lib",
574 "secur32.lib",
575 ]
576
577 cflags += [
578 # Suppress warnings about WIN32_LEAN_AND_MEAN.
579 "/wd4005",
580 "/wd4703",
581 ]
582
583 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000584 }
585
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000586 if (is_posix && is_debug) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000587 # The Chromium build/common.gypi defines this for all posix
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000588 # _except_ for ios & mac. We want it there as well, e.g.
589 # because ASSERT and friends trigger off of it.
590 defines += [ "_DEBUG" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000591 }
592
593 if (is_ios || (is_mac && cpu_arch != "x86")) {
594 defines += [ "CARBON_DEPRECATED=YES" ]
595 }
596
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000597 if (is_linux || is_android) {
598 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000599 "linux.cc",
600 "linux.h",
601 ]
602 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000603}