blob: 5cb1fd9bfe69996d170b60a6bddc2ba62031a0f4 [file] [log] [blame]
henrike@webrtc.orgf0488722014-05-13 18:00:26 +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
9{
10 'includes': [ '../build/common.gypi', ],
11 'conditions': [
12 ['os_posix == 1 and OS != "mac" and OS != "ios"', {
13 'conditions': [
14 ['sysroot!=""', {
15 'variables': {
16 'pkg-config': '../../../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
17 },
18 }, {
19 'variables': {
20 'pkg-config': 'pkg-config'
21 },
22 }],
23 ],
24 }],
25 ],
26 'targets': [
27 {
28 'target_name': 'webrtc_base',
29 'type': 'static_library',
30 'defines': [
31 'FEATURE_ENABLE_SSL',
32 'GTEST_RELATIVE_PATH',
33 'LOGGING=1',
34 'USE_WEBRTC_DEV_BRANCH',
35 ],
36 'sources': [
37 'asyncfile.cc',
38 'asyncfile.h',
39 'asynchttprequest.cc',
40 'asynchttprequest.h',
41 'asyncinvoker.cc',
42 'asyncinvoker.h',
kjellander@webrtc.org2bae3212014-06-16 07:11:19 +000043 'asyncinvoker-inl.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000044 'asyncpacketsocket.h',
45 'asyncresolverinterface.h',
46 'asyncsocket.cc',
47 'asyncsocket.h',
48 'asynctcpsocket.cc',
49 'asynctcpsocket.h',
50 'asyncudpsocket.cc',
51 'asyncudpsocket.h',
52 'atomicops.h',
53 'autodetectproxy.cc',
54 'autodetectproxy.h',
55 'bandwidthsmoother.cc',
56 'bandwidthsmoother.h',
57 'base64.cc',
58 'base64.h',
59 'basicdefs.h',
60 'basictypes.h',
61 'bind.h',
kjellander@webrtc.org2bae3212014-06-16 07:11:19 +000062 'bind.h.pump',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000063 'buffer.h',
64 'bytebuffer.cc',
65 'bytebuffer.h',
66 'byteorder.h',
67 'callback.h',
kjellander@webrtc.org2bae3212014-06-16 07:11:19 +000068 'callback.h.pump',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000069 'checks.cc',
70 'checks.h',
71 'common.cc',
72 'common.h',
73 'constructormagic.h',
74 'cpumonitor.cc',
75 'cpumonitor.h',
76 'crc32.cc',
77 'crc32.h',
78 'criticalsection.h',
79 'cryptstring.h',
80 'dbus.cc',
81 'dbus.h',
82 'diskcache.cc',
83 'diskcache.h',
84 'diskcache_win32.cc',
85 'diskcache_win32.h',
86 'event.cc',
87 'event.h',
88 'filelock.cc',
89 'filelock.h',
90 'fileutils.cc',
91 'fileutils.h',
92 'fileutils_mock.h',
93 'firewallsocketserver.cc',
94 'firewallsocketserver.h',
95 'flags.cc',
96 'flags.h',
97 'gunit_prod.h',
98 'helpers.cc',
99 'helpers.h',
100 'httpbase.cc',
101 'httpbase.h',
102 'httpclient.cc',
103 'httpclient.h',
104 'httpcommon-inl.h',
105 'httpcommon.cc',
106 'httpcommon.h',
107 'httprequest.cc',
108 'httprequest.h',
109 'httpserver.cc',
110 'httpserver.h',
111 'ifaddrs-android.cc',
112 'ifaddrs-android.h',
113 'iosfilesystem.mm',
114 'ipaddress.cc',
115 'ipaddress.h',
116 'json.cc',
117 'json.h',
118 'latebindingsymboltable.cc',
kjellander@webrtc.org2bae3212014-06-16 07:11:19 +0000119 'latebindingsymboltable.cc.def',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000120 'latebindingsymboltable.h',
kjellander@webrtc.org2bae3212014-06-16 07:11:19 +0000121 'latebindingsymboltable.h.def',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000122 'libdbusglibsymboltable.cc',
123 'libdbusglibsymboltable.h',
124 'linux.cc',
125 'linux.h',
126 'linuxfdwalk.c',
kjellander@webrtc.org2bae3212014-06-16 07:11:19 +0000127 'linuxfdwalk.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000128 'linuxwindowpicker.cc',
129 'linuxwindowpicker.h',
130 'linked_ptr.h',
131 'logging.cc',
132 'logging.h',
133 'macasyncsocket.cc',
134 'macasyncsocket.h',
135 'maccocoasocketserver.h',
136 'maccocoasocketserver.mm',
137 'maccocoathreadhelper.h',
138 'maccocoathreadhelper.mm',
139 'macconversion.cc',
140 'macconversion.h',
141 'macsocketserver.cc',
142 'macsocketserver.h',
143 'macutils.cc',
144 'macutils.h',
145 'macwindowpicker.cc',
146 'macwindowpicker.h',
147 'mathutils.h',
148 'md5.cc',
149 'md5.h',
150 'md5digest.h',
151 'messagedigest.cc',
152 'messagedigest.h',
153 'messagehandler.cc',
154 'messagehandler.h',
155 'messagequeue.cc',
156 'messagequeue.h',
157 'multipart.cc',
158 'multipart.h',
159 'natserver.cc',
160 'natserver.h',
161 'natsocketfactory.cc',
162 'natsocketfactory.h',
163 'nattypes.cc',
164 'nattypes.h',
165 'nethelpers.cc',
166 'nethelpers.h',
167 'network.cc',
168 'network.h',
169 'nssidentity.cc',
170 'nssidentity.h',
171 'nssstreamadapter.cc',
172 'nssstreamadapter.h',
173 'nullsocketserver.h',
174 'openssl.h',
175 'openssladapter.cc',
176 'openssladapter.h',
177 'openssldigest.cc',
178 'openssldigest.h',
179 'opensslidentity.cc',
180 'opensslidentity.h',
181 'opensslstreamadapter.cc',
182 'opensslstreamadapter.h',
183 'optionsfile.cc',
184 'optionsfile.h',
185 'pathutils.cc',
186 'pathutils.h',
187 'physicalsocketserver.cc',
188 'physicalsocketserver.h',
189 'posix.cc',
190 'posix.h',
191 'profiler.cc',
192 'profiler.h',
193 'proxydetect.cc',
194 'proxydetect.h',
195 'proxyinfo.cc',
196 'proxyinfo.h',
197 'proxyserver.cc',
198 'proxyserver.h',
199 'ratelimiter.cc',
200 'ratelimiter.h',
201 'ratetracker.cc',
202 'ratetracker.h',
203 'refcount.h',
204 'referencecountedsingletonfactory.h',
205 'rollingaccumulator.h',
kjellander@webrtc.org2bae3212014-06-16 07:11:19 +0000206 'safe_conversions.h',
207 'safe_conversions_impl.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000208 'schanneladapter.cc',
209 'schanneladapter.h',
210 'scoped_autorelease_pool.h',
211 'scoped_autorelease_pool.mm',
212 'scoped_ptr.h',
213 'scoped_ref_ptr.h',
214 'scopedptrcollection.h',
215 'sec_buffer.h',
216 'sha1.cc',
217 'sha1.h',
218 'sha1digest.h',
219 'sharedexclusivelock.cc',
220 'sharedexclusivelock.h',
221 'signalthread.cc',
222 'signalthread.h',
223 'sigslot.h',
224 'sigslotrepeater.h',
225 'socket.h',
226 'socketadapters.cc',
227 'socketadapters.h',
228 'socketaddress.cc',
229 'socketaddress.h',
230 'socketaddresspair.cc',
231 'socketaddresspair.h',
232 'socketfactory.h',
233 'socketpool.cc',
234 'socketpool.h',
235 'socketserver.h',
236 'socketstream.cc',
237 'socketstream.h',
238 'ssladapter.cc',
239 'ssladapter.h',
240 'sslconfig.h',
241 'sslfingerprint.cc',
242 'sslfingerprint.h',
243 'sslidentity.cc',
244 'sslidentity.h',
245 'sslroots.h',
246 'sslsocketfactory.cc',
247 'sslsocketfactory.h',
248 'sslstreamadapter.cc',
249 'sslstreamadapter.h',
250 'sslstreamadapterhelper.cc',
251 'sslstreamadapterhelper.h',
252 'stream.cc',
253 'stream.h',
254 'stringdigest.h',
255 'stringencode.cc',
256 'stringencode.h',
257 'stringutils.cc',
258 'stringutils.h',
259 'systeminfo.cc',
260 'systeminfo.h',
261 'task.cc',
262 'task.h',
263 'taskparent.cc',
264 'taskparent.h',
265 'taskrunner.cc',
266 'taskrunner.h',
267 'testclient.cc',
268 'testclient.h',
269 'thread.cc',
270 'thread.h',
henrik.lundin@webrtc.org1e3c5c22014-06-16 11:34:44 +0000271 'thread_checker.h',
272 'thread_checker_impl.cc',
273 'thread_checker_impl.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000274 'timeutils.cc',
275 'timeutils.h',
276 'timing.cc',
277 'timing.h',
278 'transformadapter.cc',
279 'transformadapter.h',
280 'unixfilesystem.cc',
281 'unixfilesystem.h',
282 'urlencode.cc',
283 'urlencode.h',
284 'versionparsing.cc',
285 'versionparsing.h',
286 'virtualsocketserver.cc',
287 'virtualsocketserver.h',
288 'win32.cc',
289 'win32.h',
290 'win32filesystem.cc',
291 'win32filesystem.h',
292 'win32regkey.cc',
293 'win32regkey.h',
294 'win32securityerrors.cc',
295 'win32socketinit.cc',
296 'win32socketinit.h',
297 'win32socketserver.cc',
298 'win32socketserver.h',
299 'win32window.cc',
300 'win32window.h',
301 'win32windowpicker.cc',
302 'win32windowpicker.h',
303 'window.h',
304 'windowpicker.h',
305 'windowpickerfactory.h',
306 'winfirewall.cc',
307 'winfirewall.h',
308 'winping.cc',
309 'winping.h',
310 'worker.cc',
311 'worker.h',
312 '../overrides/webrtc/base/basictypes.h',
313 '../overrides/webrtc/base/constructormagic.h',
314 '../overrides/webrtc/base/logging.cc',
315 '../overrides/webrtc/base/logging.h',
316 '../overrides/webrtc/base/win32socketinit.cc',
317 ],
318 # TODO(henrike): issue 3307, make webrtc_base build without disabling
319 # these flags.
320 'cflags!': [
321 '-Wextra',
322 '-Wall',
323 ],
324 'cflags_cc!': [
325 '-Wnon-virtual-dtor',
326 ],
327 'direct_dependent_settings': {
328 'cflags_cc!': [
329 '-Wnon-virtual-dtor',
330 ],
331 'defines': [
332 'FEATURE_ENABLE_SSL',
333 'GTEST_RELATIVE_PATH',
334 ],
335 },
336 'include_dirs': [
337 '../../third_party/jsoncpp/overrides/include',
338 '../../third_party/jsoncpp/source/include',
339 ],
340 'conditions': [
341 ['build_with_chromium==1', {
342 'include_dirs': [
343 '../overrides',
344 '../../openssl/openssl/include',
345 ],
346 'sources!': [
347 'asyncinvoker.cc',
348 'asyncinvoker.h',
349 'asyncinvoker-inl.h',
350 'asyncresolverinterface.h',
351 'atomicops.h',
352 'bandwidthsmoother.cc',
353 'bandwidthsmoother.h',
354 'basictypes.h',
355 'bind.h',
356 'bind.h.pump',
357 'buffer.h',
358 'callback.h',
359 'callback.h.pump',
360 'constructormagic.h',
361 'dbus.cc',
362 'dbus.h',
363 'diskcache_win32.cc',
364 'diskcache_win32.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000365 'filelock.cc',
366 'filelock.h',
367 'fileutils_mock.h',
368 'genericslot.h',
369 'genericslot.h.pump',
370 'httpserver.cc',
371 'httpserver.h',
372 'json.cc',
373 'json.h',
374 'latebindingsymboltable.cc',
375 'latebindingsymboltable.cc.def',
376 'latebindingsymboltable.h',
377 'latebindingsymboltable.h.def',
378 'libdbusglibsymboltable.cc',
379 'libdbusglibsymboltable.h',
380 'linuxfdwalk.c',
381 'linuxfdwalk.h',
382 'linuxwindowpicker.cc',
383 'linuxwindowpicker.h',
384 'logging.cc',
385 'logging.h',
386 'macasyncsocket.cc',
387 'macasyncsocket.h',
388 'maccocoasocketserver.h',
389 'maccocoasocketserver.mm',
390 'macsocketserver.cc',
391 'macsocketserver.h',
392 'macwindowpicker.cc',
393 'macwindowpicker.h',
394 'mathutils.h',
395 'multipart.cc',
396 'multipart.h',
397 'natserver.cc',
398 'natserver.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000399 'natsocketfactory.cc',
400 'natsocketfactory.h',
401 'nattypes.cc',
402 'nattypes.h',
403 'openssl.h',
404 'optionsfile.cc',
405 'optionsfile.h',
406 'posix.cc',
407 'posix.h',
408 'profiler.cc',
409 'profiler.h',
410 'proxyserver.cc',
411 'proxyserver.h',
412 'refcount.h',
413 'referencecountedsingletonfactory.h',
414 'rollingaccumulator.h',
415 'safe_conversions.h',
416 'safe_conversions_impl.h',
417 'scopedptrcollection.h',
418 'scoped_ref_ptr.h',
419 'sec_buffer.h',
420 'sharedexclusivelock.cc',
421 'sharedexclusivelock.h',
422 'sslconfig.h',
423 'sslroots.h',
424 'stringdigest.h',
425 'testbase64.h',
426 'testclient.cc',
427 'testclient.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000428 'transformadapter.cc',
429 'transformadapter.h',
430 'versionparsing.cc',
431 'versionparsing.h',
432 'virtualsocketserver.cc',
433 'virtualsocketserver.h',
434 'win32regkey.cc',
435 'win32regkey.h',
436 'win32socketinit.cc',
437 'win32socketinit.h',
438 'win32socketserver.cc',
439 'win32socketserver.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000440 'window.h',
441 'windowpickerfactory.h',
442 'windowpicker.h',
443 ],
444 'defines': [
445 'NO_MAIN_THREAD_WRAPPING',
446 'SSL_USE_NSS',
447 ],
448 'direct_dependent_settings': {
449 'defines': [
450 'NO_MAIN_THREAD_WRAPPING',
451 'SSL_USE_NSS',
452 ],
453 },
454 }, {
455 'dependencies': [
456 '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
457 ],
458 'sources!': [
459 '../overrides/webrtc/base/basictypes.h',
460 '../overrides/webrtc/base/constructormagic.h',
461 '../overrides/webrtc/base/win32socketinit.cc',
462 '../overrides/webrtc/base/logging.cc',
463 '../overrides/webrtc/base/logging.h',
464 ],
465 }],
466 ['use_openssl==1', {
467 'defines': [
468 'SSL_USE_OPENSSL',
469 'HAVE_OPENSSL_SSL_H',
470 ],
471 'direct_dependent_settings': {
472 'defines': [
473 'SSL_USE_OPENSSL',
474 'HAVE_OPENSSL_SSL_H',
475 ],
476 },
477 'dependencies': [
478 '<(DEPTH)/third_party/openssl/openssl.gyp:openssl',
479 ],
480 }, {
481 'defines': [
482 'SSL_USE_NSS',
483 'HAVE_NSS_SSL_H',
484 'SSL_USE_NSS_RNG',
485 ],
486 'direct_dependent_settings': {
487 'defines': [
488 'SSL_USE_NSS',
489 'HAVE_NSS_SSL_H',
490 'SSL_USE_NSS_RNG',
491 ],
492 },
493 }],
494 ['OS == "android"', {
495 'defines': [
496 'HAVE_OPENSSL_SSL_H'
497 ],
498 'direct_dependent_settings': {
499 'defines': [
500 'HAVE_OPENSSL_SSL_H'
501 ],
502 },
503 'link_settings': {
504 'libraries': [
505 '-llog',
506 '-lGLESv2',
507 ],
508 },
509 }, {
510 'defines': [
511 'HAVE_NSS_SSL_H'
512 'SSL_USE_NSS_RNG',
513 ],
514 'direct_dependent_settings': {
515 'defines': [
516 'HAVE_NSS_SSL_H'
517 'SSL_USE_NSS_RNG',
518 ],
519 },
520 'sources!': [
521 'ifaddrs-android.cc',
522 'ifaddrs-android.h',
523 ],
524 }],
525 ['OS=="ios"', {
526 'all_dependent_settings': {
527 'xcode_settings': {
528 'OTHER_LDFLAGS': [
529 '-framework Foundation',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000530 '-framework Security',
531 '-framework SystemConfiguration',
532 '-framework UIKit',
533 ],
534 },
535 },
536 'dependencies': [
537 '<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
538 ],
539 }],
540 ['OS=="linux"', {
541 'link_settings': {
542 'libraries': [
543 '-lcrypto',
544 '-ldl',
545 '-lrt',
546 '-lXext',
547 '-lX11',
548 '-lXcomposite',
549 '-lXrender',
550 '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
551 ],
552 },
553 'cflags': [
554 '<!@(<(pkg-config) --cflags nss)',
555 ],
556 'ldflags': [
557 '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
558 ],
559 }, {
560 'sources!': [
561 'dbus.cc',
562 'dbus.h',
563 'libdbusglibsymboltable.cc',
564 'libdbusglibsymboltable.h',
565 'linuxfdwalk.c',
566 'linuxwindowpicker.cc',
567 'linuxwindowpicker.h',
568 ],
569 }],
570 ['OS=="mac"', {
571 'link_settings': {
572 'libraries': [
573 '$(SDKROOT)/usr/lib/libcrypto.dylib',
574 '$(SDKROOT)/usr/lib/libssl.dylib',
575 ],
576 },
577 'all_dependent_settings': {
578 'link_settings': {
579 'xcode_settings': {
580 'OTHER_LDFLAGS': [
581 '-framework Cocoa',
582 '-framework Foundation',
583 '-framework IOKit',
584 '-framework Security',
585 '-framework SystemConfiguration',
586 ],
587 },
588 },
589 },
590 'conditions': [
591 ['target_arch=="ia32"', {
592 'all_dependent_settings': {
593 'link_settings': {
594 'xcode_settings': {
595 'OTHER_LDFLAGS': [
596 '-framework Carbon',
597 ],
598 },
599 },
600 },
601 }],
602 ],
603 }, {
604 'sources!': [
605 'macasyncsocket.cc',
606 'macasyncsocket.h',
607 'maccocoasocketserver.h',
608 'maccocoasocketserver.mm',
609 'macconversion.cc',
610 'macconversion.h',
611 'macsocketserver.cc',
612 'macsocketserver.h',
613 'macutils.cc',
614 'macutils.h',
615 'macwindowpicker.cc',
616 'macwindowpicker.h',
617 ],
618 }],
619 ['OS=="win"', {
620 'link_settings': {
621 'libraries': [
622 '-lcrypt32.lib',
623 '-liphlpapi.lib',
624 '-lsecur32.lib',
625 ],
626 },
627 # Suppress warnings about WIN32_LEAN_AND_MEAN.
628 'msvs_disabled_warnings': [4005, 4703],
629 'defines': [
630 '_CRT_NONSTDC_NO_DEPRECATE',
631 ],
632 }, {
633 'sources/': [
634 ['exclude', 'win32[a-z0-9]*\\.(h|cc)$'],
635 ],
636 'sources!': [
637 'schanneladapter.cc',
638 'schanneladapter.h',
639 'winping.cc',
640 'winping.h',
641 'winfirewall.cc',
642 'winfirewall.h',
643 ],
644 }],
645 ['os_posix==0', {
646 'sources!': [
647 'latebindingsymboltable.cc',
648 'latebindingsymboltable.h',
649 'posix.cc',
650 'posix.h',
651 'unixfilesystem.cc',
652 'unixfilesystem.h',
653 ],
654 }, {
655 'configurations': {
656 'Debug_Base': {
657 'defines': [
658 # Chromium's build/common.gypi defines this for all posix
659 # _except_ for ios & mac. We want it there as well, e.g.
660 # because ASSERT and friends trigger off of it.
661 '_DEBUG',
662 ],
663 },
664 }
665 }],
666 ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', {
667 'defines': [
668 'CARBON_DEPRECATED=YES',
669 ],
670 }],
671 ['OS!="ios" and OS!="mac"', {
672 'sources!': [
673 'scoped_autorelease_pool.mm',
674 ],
675 }],
676 ['OS=="ios" or os_posix==0', {
677 'sources!': [
678 'openssl.h',
679 'openssladapter.cc',
680 'openssladapter.h',
681 'openssldigest.cc',
682 'openssldigest.h',
683 'opensslidentity.cc',
684 'opensslidentity.h',
685 'opensslstreamadapter.cc',
686 'opensslstreamadapter.h',
687 ],
688 }],
689 ['OS!="linux" and OS!="android"', {
690 'sources!': [
691 'linux.cc',
692 'linux.h',
693 ],
694 }],
695 ['OS == "mac" or OS == "ios" or OS == "win"', {
696 'dependencies': [
697 '<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
698 '<(DEPTH)/third_party/nss/nss.gyp:nspr',
699 '<(DEPTH)/third_party/nss/nss.gyp:nss',
700 ],
701 }],
702 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
703 'dependencies': [
704 '<(DEPTH)/build/linux/system.gyp:ssl',
705 ],
706 }],
707 ],
708 },
709 ],
710}