blob: b0da45af422ab802c289ee21fb508e79f8f05fc5 [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.orge281f7f2014-09-02 11:22:06 +0000105if (build_ssl == 0) {
106 config("external_ssl_library") {
107 assert(webrtc_ssl_root != "",
108 "You must specify webrtc_ssl_root when build_ssl==0.")
109 include_dirs = [ webrtc_ssl_root ]
110 }
111}
kjellander@webrtc.org4a251992014-08-18 17:56:28 +0000112
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000113static_library("webrtc_base") {
114 cflags = []
115 cflags_cc = []
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000116 libs = []
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000117 deps= []
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000118
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000119 configs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000120 "..:common_config",
121 ":webrtc_base_config",
122 ]
123
124 direct_dependent_configs = [
125 "..:common_inherited_config",
126 ":webrtc_base_config",
127 ]
128
129 defines = [
130 "LOGGING=1",
131 "USE_WEBRTC_DEV_BRANCH",
132 ]
133
134 sources = [
135 "asyncfile.cc",
136 "asyncfile.h",
137 "asynchttprequest.cc",
138 "asynchttprequest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000139 "asyncpacketsocket.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000140 "asyncsocket.cc",
141 "asyncsocket.h",
142 "asynctcpsocket.cc",
143 "asynctcpsocket.h",
144 "asyncudpsocket.cc",
145 "asyncudpsocket.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000146 "autodetectproxy.cc",
147 "autodetectproxy.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000148 "base64.cc",
149 "base64.h",
150 "basicdefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000151 "bytebuffer.cc",
152 "bytebuffer.h",
153 "byteorder.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000154 "checks.cc",
155 "checks.h",
156 "common.cc",
157 "common.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000158 "cpumonitor.cc",
159 "cpumonitor.h",
160 "crc32.cc",
161 "crc32.h",
162 "criticalsection.h",
163 "cryptstring.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000164 "diskcache.cc",
165 "diskcache.h",
166 "event.cc",
167 "event.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000168 "fileutils.cc",
169 "fileutils.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000170 "firewallsocketserver.cc",
171 "firewallsocketserver.h",
172 "flags.cc",
173 "flags.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000174 "gunit_prod.h",
175 "helpers.cc",
176 "helpers.h",
177 "httpbase.cc",
178 "httpbase.h",
179 "httpclient.cc",
180 "httpclient.h",
181 "httpcommon-inl.h",
182 "httpcommon.cc",
183 "httpcommon.h",
184 "httprequest.cc",
185 "httprequest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000186 "iosfilesystem.mm",
187 "ipaddress.cc",
188 "ipaddress.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000189 "linked_ptr.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000190 "mathutils.h",
191 "md5.cc",
192 "md5.h",
193 "md5digest.h",
194 "messagedigest.cc",
195 "messagedigest.h",
196 "messagehandler.cc",
197 "messagehandler.h",
198 "messagequeue.cc",
199 "messagequeue.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000200 "nethelpers.cc",
201 "nethelpers.h",
202 "network.cc",
203 "network.h",
204 "nssidentity.cc",
205 "nssidentity.h",
206 "nssstreamadapter.cc",
207 "nssstreamadapter.h",
208 "nullsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000209 "pathutils.cc",
210 "pathutils.h",
211 "physicalsocketserver.cc",
212 "physicalsocketserver.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000213 "proxydetect.cc",
214 "proxydetect.h",
215 "proxyinfo.cc",
216 "proxyinfo.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000217 "ratelimiter.cc",
218 "ratelimiter.h",
219 "ratetracker.cc",
220 "ratetracker.h",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000221 "safe_conversions.h",
222 "safe_conversions_impl.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000223 "scoped_autorelease_pool.h",
224 "scoped_autorelease_pool.mm",
225 "scoped_ptr.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000226 "sha1.cc",
227 "sha1.h",
228 "sha1digest.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000229 "signalthread.cc",
230 "signalthread.h",
231 "sigslot.h",
232 "sigslotrepeater.h",
233 "socket.h",
234 "socketadapters.cc",
235 "socketadapters.h",
236 "socketaddress.cc",
237 "socketaddress.h",
238 "socketaddresspair.cc",
239 "socketaddresspair.h",
240 "socketfactory.h",
241 "socketpool.cc",
242 "socketpool.h",
243 "socketserver.h",
244 "socketstream.cc",
245 "socketstream.h",
246 "ssladapter.cc",
247 "ssladapter.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000248 "sslfingerprint.cc",
249 "sslfingerprint.h",
250 "sslidentity.cc",
251 "sslidentity.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000252 "sslsocketfactory.cc",
253 "sslsocketfactory.h",
254 "sslstreamadapter.cc",
255 "sslstreamadapter.h",
256 "sslstreamadapterhelper.cc",
257 "sslstreamadapterhelper.h",
258 "stream.cc",
259 "stream.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000260 "stringencode.cc",
261 "stringencode.h",
262 "stringutils.cc",
263 "stringutils.h",
264 "systeminfo.cc",
265 "systeminfo.h",
266 "task.cc",
267 "task.h",
268 "taskparent.cc",
269 "taskparent.h",
270 "taskrunner.cc",
271 "taskrunner.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000272 "thread.cc",
273 "thread.h",
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000274 "thread_checker.h",
275 "thread_checker_impl.cc",
276 "thread_checker_impl.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000277 "timeutils.cc",
278 "timeutils.h",
279 "timing.cc",
280 "timing.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000281 "urlencode.cc",
282 "urlencode.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000283 "worker.cc",
284 "worker.h",
285 ]
286
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000287 if (is_posix) {
288 sources += [
289 "unixfilesystem.cc",
290 "unixfilesystem.h",
291 ]
292 }
293
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000294 if (build_with_chromium) {
295 sources += [
296 "../overrides/webrtc/base/basictypes.h",
297 "../overrides/webrtc/base/constructormagic.h",
298 "../overrides/webrtc/base/logging.cc",
299 "../overrides/webrtc/base/logging.h",
300 ]
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000301
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000302 if (is_win) {
303 sources += [ "../overrides/webrtc/base/win32socketinit.cc" ]
304 }
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000305
306 include_dirs = [
307 "../overrides",
henrike@webrtc.org6ac22e62014-08-11 21:06:30 +0000308 "../../boringssl/src/include",
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000309 ]
310
311 direct_dependent_configs += [ ":webrtc_base_chromium_config" ]
312 } else {
313 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000314 "asyncinvoker.cc",
315 "asyncinvoker.h",
316 "asyncinvoker-inl.h",
317 "asyncresolverinterface.h",
318 "atomicops.h",
319 "bandwidthsmoother.cc",
320 "bandwidthsmoother.h",
321 "basictypes.h",
322 "bind.h",
323 "bind.h.pump",
324 "buffer.h",
325 "callback.h",
326 "callback.h.pump",
327 "constructormagic.h",
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000328 "exp_filter.cc",
329 "exp_filter.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000330 "filelock.cc",
331 "filelock.h",
332 "fileutils_mock.h",
333 "genericslot.h",
334 "genericslot.h.pump",
335 "httpserver.cc",
336 "httpserver.h",
337 "json.cc",
338 "json.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000339 "logging.cc",
340 "logging.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000341 "mathutils.h",
342 "multipart.cc",
343 "multipart.h",
344 "natserver.cc",
345 "natserver.h",
346 "natsocketfactory.cc",
347 "natsocketfactory.h",
348 "nattypes.cc",
349 "nattypes.h",
350 "openssl.h",
351 "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",
363 "sharedexclusivelock.cc",
364 "sharedexclusivelock.h",
365 "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.orge281f7f2014-09-02 11:22:06 +0000428 if (build_json) {
429 deps += [ "//third_party/jsoncpp" ]
430 } else {
431 include_dirs += [ webrtc_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.org62711f82014-06-29 13:37:08 +0000445 # TODO(henrike): issue 3307, make webrtc_base build with the Chromium default
446 # compiler settings.
447 configs -= [ "//build/config/compiler:chromium_code" ]
448 configs += [ "//build/config/compiler:no_chromium_code" ]
449 cflags += [ "-Wno-uninitialized" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000450 cflags_cc += [ "-Wno-non-virtual-dtor" ]
451
452 if (use_openssl) {
453 direct_dependent_configs += [ ":openssl_config" ]
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000454 if (build_ssl) {
455 deps += [ "//third_party/boringssl" ]
456 } else {
457 configs += [ "external_ssl_library" ]
458 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000459 } else {
460 direct_dependent_configs += [ ":no_openssl_config" ]
461 }
462
463 if (is_android) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000464 sources += [
465 "ifaddrs-android.cc",
466 "ifaddrs-android.h",
467 ]
468
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000469 direct_dependent_configs += [ ":android_config" ]
470
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000471 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000472 "log",
473 "GLESv2"
474 ]
475 } else {
476 direct_dependent_configs += [ ":no_android_config" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000477 }
478
479 if (is_ios) {
480 all_dependent_configs += [ ":ios_config" ]
481
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000482 if (build_ssl) {
483 deps += [ "//net/third_party/nss/ssl:libssl" ]
484 } else {
485 configs += [ "external_ssl_library" ]
486 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000487 }
488
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000489 if (use_x11) {
490 sources += [
491 "x11windowpicker.cc",
492 "x11windowpicker.h",
493 ]
494 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000495 "dl",
496 "rt",
497 "Xext",
498 "X11",
499 "Xcomposite",
500 "Xrender",
501 ]
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000502 }
503
504 if (is_linux) {
505 libs += [
506 "crypto",
507 "dl",
508 "rt",
509 ]
510 if (build_ssl) {
511 configs += [ "//third_party/nss:system_nss_no_ssl_config" ]
512 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000513 }
514
515 if (is_mac) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000516 sources += [
517 "maccocoathreadhelper.h",
518 "maccocoathreadhelper.mm",
519 "macconversion.cc",
520 "macconversion.h",
521 "macutils.cc",
522 "macutils.h",
523 ]
524
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000525 all_dependent_configs = [ ":mac_config" ]
526
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000527 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000528 "crypto", # $(SDKROOT)/usr/lib/libcrypto.dylib
529 "ssl", # $(SDKROOT)/usr/lib/libssl.dylib
530 ]
531 if (cpu_arch == "x86") {
532 all_dependent_configs += [ ":mac_x86_config" ]
533 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000534 }
535
536 if (is_win) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000537 sources += [
538 "schanneladapter.cc",
539 "schanneladapter.h",
540 "win32.cc",
541 "win32.h",
542 "win32filesystem.cc",
543 "win32filesystem.h",
544 "win32securityerrors.cc",
545 "win32window.cc",
546 "win32window.h",
547 "win32windowpicker.cc",
548 "win32windowpicker.h",
549 "winfirewall.cc",
550 "winfirewall.h",
551 "winping.cc",
552 "winping.h",
553 ]
554
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000555 libs += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000556 "crypt32.lib",
557 "iphlpapi.lib",
558 "secur32.lib",
559 ]
560
561 cflags += [
562 # Suppress warnings about WIN32_LEAN_AND_MEAN.
563 "/wd4005",
564 "/wd4703",
565 ]
566
567 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000568 }
569
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000570 if (is_posix && is_debug) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000571 # The Chromium build/common.gypi defines this for all posix
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000572 # _except_ for ios & mac. We want it there as well, e.g.
573 # because ASSERT and friends trigger off of it.
574 defines += [ "_DEBUG" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000575 }
576
577 if (is_ios || (is_mac && cpu_arch != "x86")) {
578 defines += [ "CARBON_DEPRECATED=YES" ]
579 }
580
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000581 if (!is_ios) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000582 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000583 "openssl.h",
584 "openssladapter.cc",
585 "openssladapter.h",
586 "openssldigest.cc",
587 "openssldigest.h",
588 "opensslidentity.cc",
589 "opensslidentity.h",
590 "opensslstreamadapter.cc",
591 "opensslstreamadapter.h",
592 ]
593 }
594
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000595 if (is_linux || is_android) {
596 sources += [
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000597 "linux.cc",
598 "linux.h",
599 ]
600 }
601
602 if (is_mac || is_ios || is_win) {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000603 if (build_ssl) {
604 deps += [
605 "//net/third_party/nss/ssl:libssl",
606 "//third_party/nss:nspr",
607 "//third_party/nss:nss",
608 ]
609 } else {
610 configs += [ "external_ssl_library" ]
611 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000612 }
613
614 if (is_posix && !is_mac && !is_ios && !is_android) {
kjellander@webrtc.org4a251992014-08-18 17:56:28 +0000615 if (build_with_chromium) {
616 deps += [ "//crypto:platform" ]
617 } else {
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +0000618 if (build_ssl) {
619 deps += [ ":linux_system_ssl" ]
620 } else {
621 configs += [ "external_ssl_library" ]
622 }
kjellander@webrtc.org4a251992014-08-18 17:56:28 +0000623 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000624 }
625}