blob: 003fc1bc209c9aa06b5d3b176678a61eb3946c75 [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
13config("webrtc_base_config") {
14 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
25 # TODO(henrike): issue 3307, make webrtc_base build without disabling
26 # these flags.
27 cflags_cc = [ "-Wno-non-virtual-dtor" ]
28}
29
30config("webrtc_base_chromium_config") {
31 defines = [
32 "NO_MAIN_THREAD_WRAPPING",
33 "SSL_USE_NSS",
34 ]
35}
36
37config("openssl_config") {
38 defines = [
39 "SSL_USE_OPENSSL",
40 "HAVE_OPENSSL_SSL_H",
41 ]
42}
43
44config("no_openssl_config") {
45 defines = [
46 "SSL_USE_NSS",
47 "HAVE_NSS_SSL_H",
48 "SSL_USE_NSS_RNG",
49 ]
50}
51
52config("android_config") {
53 defines = [ "HAVE_OPENSSL_SSL_H" ]
54}
55
56config("no_android_config") {
57 defines = [
58 "HAVE_NSS_SSL_H",
59 "SSL_USE_NSS_RNG",
60 ]
61}
62
63config("ios_config") {
64 ldflags = [
65 #"Foundation.framework", # Already included in //build/config:default_libs.
66 "Security.framework",
67 "SystemConfiguration.framework",
68 #"UIKit.framework", # Already included in //build/config:default_libs.
69 ]
70}
71
72config("mac_config") {
73 ldflags = [
74 "Cocoa.framework",
75 #"Foundation.framework", # Already included in //build/config:default_libs.
76 #"IOKit.framework", # Already included in //build/config:default_libs.
77 #"Security.framework", # Already included in //build/config:default_libs.
78 "SystemConfiguration.framework",
79 ]
80}
81
82config("mac_x86_config") {
83 libs = [
84 #"Carbon.framework", # Already included in //build/config:default_libs.
85 ]
86}
87
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000088if (is_linux && !build_with_chromium) {
89 # Provides the same functionality as the //crypto:platform target, which
90 # WebRTC cannot use as we don't sync src/crypto from Chromium.
91 group("linux_system_ssl") {
92 if (use_openssl) {
93 deps = [ "//third_party/boringssl" ]
94 } else {
95 deps = [ "//net/third_party/nss/ssl:libssl" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000096
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000097 direct_dependent_configs = [
98 "//net/third_party/nss/ssl:ssl_config",
99 "//third_party/nss:system_nss_no_ssl_config",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000100 ]
101 }
102 }
103}
104
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000105if (rtc_build_ssl == 0) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000106 config("external_ssl_library") {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000107 assert(rtc_ssl_root != "",
108 "You must specify rtc_ssl_root when rtc_build_ssl==0.")
109 include_dirs = [ rtc_ssl_root ]
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000110 }
111}
kjellander@webrtc.org4a251992014-08-18 17:56:28 +0000112
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000113# The subset of rtc_base approved for use outside of libjingle.
114static_library("rtc_base_approved") {
115 configs += [ "..:common_config" ]
116 direct_dependent_configs = [ "..:common_inherited_config" ]
117
118 sources = [
119 "checks.cc",
120 "checks.h",
121 "exp_filter.cc",
122 "exp_filter.h",
123 "md5.cc",
124 "md5.h",
125 "md5digest.h",
126 "stringencode.cc",
127 "stringencode.h",
128 "stringutils.cc",
129 "stringutils.h",
130 "timeutils.cc",
131 "timeutils.h",
132 ]
133}
134
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000135static_library("webrtc_base") {
136 cflags = []
137 cflags_cc = []
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000138 libs = []
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000139 deps = [
140 ":rtc_base_approved",
141 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000142
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000143 configs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000144 "..:common_config",
145 ":webrtc_base_config",
146 ]
147
148 direct_dependent_configs = [
149 "..:common_inherited_config",
150 ":webrtc_base_config",
151 ]
152
153 defines = [
154 "LOGGING=1",
155 "USE_WEBRTC_DEV_BRANCH",
156 ]
157
158 sources = [
159 "asyncfile.cc",
160 "asyncfile.h",
161 "asynchttprequest.cc",
162 "asynchttprequest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000163 "asyncpacketsocket.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000164 "asyncsocket.cc",
165 "asyncsocket.h",
166 "asynctcpsocket.cc",
167 "asynctcpsocket.h",
168 "asyncudpsocket.cc",
169 "asyncudpsocket.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000170 "autodetectproxy.cc",
171 "autodetectproxy.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000172 "base64.cc",
173 "base64.h",
174 "basicdefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000175 "bytebuffer.cc",
176 "bytebuffer.h",
177 "byteorder.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000178 "common.cc",
179 "common.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000180 "cpumonitor.cc",
181 "cpumonitor.h",
182 "crc32.cc",
183 "crc32.h",
184 "criticalsection.h",
185 "cryptstring.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000186 "diskcache.cc",
187 "diskcache.h",
188 "event.cc",
189 "event.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000190 "fileutils.cc",
191 "fileutils.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000192 "firewallsocketserver.cc",
193 "firewallsocketserver.h",
194 "flags.cc",
195 "flags.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000196 "gunit_prod.h",
197 "helpers.cc",
198 "helpers.h",
199 "httpbase.cc",
200 "httpbase.h",
201 "httpclient.cc",
202 "httpclient.h",
203 "httpcommon-inl.h",
204 "httpcommon.cc",
205 "httpcommon.h",
206 "httprequest.cc",
207 "httprequest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000208 "iosfilesystem.mm",
209 "ipaddress.cc",
210 "ipaddress.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000211 "linked_ptr.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000212 "mathutils.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000213 "messagedigest.cc",
214 "messagedigest.h",
215 "messagehandler.cc",
216 "messagehandler.h",
217 "messagequeue.cc",
218 "messagequeue.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000219 "nethelpers.cc",
220 "nethelpers.h",
221 "network.cc",
222 "network.h",
223 "nssidentity.cc",
224 "nssidentity.h",
225 "nssstreamadapter.cc",
226 "nssstreamadapter.h",
227 "nullsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000228 "pathutils.cc",
229 "pathutils.h",
230 "physicalsocketserver.cc",
231 "physicalsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000232 "proxydetect.cc",
233 "proxydetect.h",
234 "proxyinfo.cc",
235 "proxyinfo.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000236 "ratelimiter.cc",
237 "ratelimiter.h",
238 "ratetracker.cc",
239 "ratetracker.h",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000240 "safe_conversions.h",
241 "safe_conversions_impl.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.orge281f7f2014-09-02 11:22:06 +0000289 "thread_checker.h",
290 "thread_checker_impl.cc",
291 "thread_checker_impl.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000292 "timing.cc",
293 "timing.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000294 "urlencode.cc",
295 "urlencode.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000296 "worker.cc",
297 "worker.h",
298 ]
299
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000300 if (is_posix) {
301 sources += [
302 "unixfilesystem.cc",
303 "unixfilesystem.h",
304 ]
305 }
306
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000307 if (build_with_chromium) {
308 sources += [
309 "../overrides/webrtc/base/basictypes.h",
310 "../overrides/webrtc/base/constructormagic.h",
311 "../overrides/webrtc/base/logging.cc",
312 "../overrides/webrtc/base/logging.h",
313 ]
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000314
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000315 if (is_win) {
316 sources += [ "../overrides/webrtc/base/win32socketinit.cc" ]
317 }
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000318
319 include_dirs = [
320 "../overrides",
henrike@webrtc.org6ac22e62014-08-11 21:06:30 +0000321 "../../boringssl/src/include",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000322 ]
323
324 direct_dependent_configs += [ ":webrtc_base_chromium_config" ]
325 } else {
326 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000327 "asyncinvoker.cc",
328 "asyncinvoker.h",
329 "asyncinvoker-inl.h",
330 "asyncresolverinterface.h",
331 "atomicops.h",
332 "bandwidthsmoother.cc",
333 "bandwidthsmoother.h",
334 "basictypes.h",
335 "bind.h",
336 "bind.h.pump",
337 "buffer.h",
338 "callback.h",
339 "callback.h.pump",
340 "constructormagic.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000341 "filelock.cc",
342 "filelock.h",
343 "fileutils_mock.h",
344 "genericslot.h",
345 "genericslot.h.pump",
346 "httpserver.cc",
347 "httpserver.h",
348 "json.cc",
349 "json.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000350 "logging.cc",
351 "logging.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000352 "mathutils.h",
353 "multipart.cc",
354 "multipart.h",
355 "natserver.cc",
356 "natserver.h",
357 "natsocketfactory.cc",
358 "natsocketfactory.h",
359 "nattypes.cc",
360 "nattypes.h",
361 "openssl.h",
362 "optionsfile.cc",
363 "optionsfile.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000364 "profiler.cc",
365 "profiler.h",
366 "proxyserver.cc",
367 "proxyserver.h",
368 "refcount.h",
369 "referencecountedsingletonfactory.h",
370 "rollingaccumulator.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000371 "scopedptrcollection.h",
372 "scoped_ref_ptr.h",
373 "sec_buffer.h",
374 "sharedexclusivelock.cc",
375 "sharedexclusivelock.h",
376 "sslconfig.h",
377 "sslroots.h",
378 "stringdigest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000379 "testclient.cc",
380 "testclient.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000381 "transformadapter.cc",
382 "transformadapter.h",
383 "versionparsing.cc",
384 "versionparsing.h",
385 "virtualsocketserver.cc",
386 "virtualsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000387 "window.h",
388 "windowpickerfactory.h",
389 "windowpicker.h",
390 ]
391
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000392 if (is_posix) {
393 sources += [
394 "latebindingsymboltable.cc",
395 "latebindingsymboltable.cc.def",
396 "latebindingsymboltable.h",
397 "latebindingsymboltable.h.def",
398 "posix.cc",
399 "posix.h",
400 ]
401 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000402
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000403 if (is_linux) {
404 sources += [
405 "dbus.cc",
406 "dbus.h",
407 "libdbusglibsymboltable.cc",
408 "libdbusglibsymboltable.h",
409 "linuxfdwalk.c",
410 "linuxfdwalk.h",
henrike@webrtc.orgfb1eb432014-08-15 14:44:13 +0000411 ]
412 }
413
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000414 if (is_mac) {
415 sources += [
416 "macasyncsocket.cc",
417 "macasyncsocket.h",
418 "maccocoasocketserver.h",
419 "maccocoasocketserver.mm",
420 "macsocketserver.cc",
421 "macsocketserver.h",
422 "macwindowpicker.cc",
423 "macwindowpicker.h",
424 ]
425 }
426
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000427 if (is_win) {
428 sources += [
429 "diskcache_win32.cc",
430 "diskcache_win32.h",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000431 "win32regkey.cc",
432 "win32regkey.h",
433 "win32socketinit.cc",
434 "win32socketinit.h",
435 "win32socketserver.cc",
436 "win32socketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000437 ]
438 }
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000439 if (rtc_build_json) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000440 deps += [ "//third_party/jsoncpp" ]
441 } else {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000442 include_dirs += [ rtc_jsoncpp_root ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000443
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000444 # When defined changes the include path for json.h to where it is
445 # expected to be when building json outside of the standalone build.
446 defines += [ "WEBRTC_EXTERNAL_JSON" ]
447 }
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000448 } # !build_with_chromium
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000449
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000450 if (is_clang) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000451 # Suppress warnings from the Chrome Clang plugins.
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000452 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
453 configs -= [ "//build/config/clang:find_bad_constructs" ]
454 }
455
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000456 # TODO(henrike): issue 3307, make webrtc_base build with the Chromium default
457 # compiler settings.
458 configs -= [ "//build/config/compiler:chromium_code" ]
459 configs += [ "//build/config/compiler:no_chromium_code" ]
460 cflags += [ "-Wno-uninitialized" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000461 cflags_cc += [ "-Wno-non-virtual-dtor" ]
462
463 if (use_openssl) {
464 direct_dependent_configs += [ ":openssl_config" ]
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000465 if (rtc_build_ssl) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000466 deps += [ "//third_party/boringssl" ]
467 } else {
468 configs += [ "external_ssl_library" ]
469 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000470 } else {
471 direct_dependent_configs += [ ":no_openssl_config" ]
472 }
473
474 if (is_android) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000475 sources += [
476 "ifaddrs-android.cc",
477 "ifaddrs-android.h",
478 ]
479
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000480 direct_dependent_configs += [ ":android_config" ]
481
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000482 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000483 "log",
484 "GLESv2"
485 ]
486 } else {
487 direct_dependent_configs += [ ":no_android_config" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000488 }
489
490 if (is_ios) {
491 all_dependent_configs += [ ":ios_config" ]
492
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000493 if (rtc_build_ssl) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000494 deps += [ "//net/third_party/nss/ssl:libssl" ]
495 } else {
496 configs += [ "external_ssl_library" ]
497 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000498 }
499
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000500 if (use_x11) {
501 sources += [
502 "x11windowpicker.cc",
503 "x11windowpicker.h",
504 ]
505 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000506 "dl",
507 "rt",
508 "Xext",
509 "X11",
510 "Xcomposite",
511 "Xrender",
512 ]
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000513 }
514
515 if (is_linux) {
516 libs += [
517 "crypto",
518 "dl",
519 "rt",
520 ]
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000521 if (rtc_build_ssl) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000522 configs += [ "//third_party/nss:system_nss_no_ssl_config" ]
523 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000524 }
525
526 if (is_mac) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000527 sources += [
528 "maccocoathreadhelper.h",
529 "maccocoathreadhelper.mm",
530 "macconversion.cc",
531 "macconversion.h",
532 "macutils.cc",
533 "macutils.h",
534 ]
535
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000536 all_dependent_configs = [ ":mac_config" ]
537
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000538 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000539 "crypto", # $(SDKROOT)/usr/lib/libcrypto.dylib
540 "ssl", # $(SDKROOT)/usr/lib/libssl.dylib
541 ]
542 if (cpu_arch == "x86") {
543 all_dependent_configs += [ ":mac_x86_config" ]
544 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000545 }
546
547 if (is_win) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000548 sources += [
549 "schanneladapter.cc",
550 "schanneladapter.h",
551 "win32.cc",
552 "win32.h",
553 "win32filesystem.cc",
554 "win32filesystem.h",
555 "win32securityerrors.cc",
556 "win32window.cc",
557 "win32window.h",
558 "win32windowpicker.cc",
559 "win32windowpicker.h",
560 "winfirewall.cc",
561 "winfirewall.h",
562 "winping.cc",
563 "winping.h",
564 ]
565
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000566 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000567 "crypt32.lib",
568 "iphlpapi.lib",
569 "secur32.lib",
570 ]
571
572 cflags += [
573 # Suppress warnings about WIN32_LEAN_AND_MEAN.
574 "/wd4005",
575 "/wd4703",
576 ]
577
578 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000579 }
580
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000581 if (is_posix && is_debug) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000582 # The Chromium build/common.gypi defines this for all posix
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000583 # _except_ for ios & mac. We want it there as well, e.g.
584 # because ASSERT and friends trigger off of it.
585 defines += [ "_DEBUG" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000586 }
587
588 if (is_ios || (is_mac && cpu_arch != "x86")) {
589 defines += [ "CARBON_DEPRECATED=YES" ]
590 }
591
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000592 if (!is_ios) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000593 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000594 "openssl.h",
595 "openssladapter.cc",
596 "openssladapter.h",
597 "openssldigest.cc",
598 "openssldigest.h",
599 "opensslidentity.cc",
600 "opensslidentity.h",
601 "opensslstreamadapter.cc",
602 "opensslstreamadapter.h",
603 ]
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 }
612
613 if (is_mac || is_ios || is_win) {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000614 if (rtc_build_ssl) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000615 deps += [
616 "//net/third_party/nss/ssl:libssl",
617 "//third_party/nss:nspr",
618 "//third_party/nss:nss",
619 ]
620 } else {
621 configs += [ "external_ssl_library" ]
622 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000623 }
624
625 if (is_posix && !is_mac && !is_ios && !is_android) {
kjellander@webrtc.org4a251992014-08-18 17:56:28 +0000626 if (build_with_chromium) {
627 deps += [ "//crypto:platform" ]
628 } else {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000629 if (rtc_build_ssl) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000630 deps += [ ":linux_system_ssl" ]
631 } else {
632 configs += [ "external_ssl_library" ]
633 }
kjellander@webrtc.org4a251992014-08-18 17:56:28 +0000634 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000635 }
636}