blob: 94b9637b350b052a2e6912eda178f48407ae7966 [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',
271 'timeutils.cc',
272 'timeutils.h',
273 'timing.cc',
274 'timing.h',
275 'transformadapter.cc',
276 'transformadapter.h',
277 'unixfilesystem.cc',
278 'unixfilesystem.h',
279 'urlencode.cc',
280 'urlencode.h',
281 'versionparsing.cc',
282 'versionparsing.h',
283 'virtualsocketserver.cc',
284 'virtualsocketserver.h',
285 'win32.cc',
286 'win32.h',
287 'win32filesystem.cc',
288 'win32filesystem.h',
289 'win32regkey.cc',
290 'win32regkey.h',
291 'win32securityerrors.cc',
292 'win32socketinit.cc',
293 'win32socketinit.h',
294 'win32socketserver.cc',
295 'win32socketserver.h',
296 'win32window.cc',
297 'win32window.h',
298 'win32windowpicker.cc',
299 'win32windowpicker.h',
300 'window.h',
301 'windowpicker.h',
302 'windowpickerfactory.h',
303 'winfirewall.cc',
304 'winfirewall.h',
305 'winping.cc',
306 'winping.h',
307 'worker.cc',
308 'worker.h',
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 '../overrides/webrtc/base/win32socketinit.cc',
314 ],
315 # TODO(henrike): issue 3307, make webrtc_base build without disabling
316 # these flags.
317 'cflags!': [
318 '-Wextra',
319 '-Wall',
320 ],
321 'cflags_cc!': [
322 '-Wnon-virtual-dtor',
323 ],
324 'direct_dependent_settings': {
325 'cflags_cc!': [
326 '-Wnon-virtual-dtor',
327 ],
328 'defines': [
329 'FEATURE_ENABLE_SSL',
330 'GTEST_RELATIVE_PATH',
331 ],
332 },
333 'include_dirs': [
334 '../../third_party/jsoncpp/overrides/include',
335 '../../third_party/jsoncpp/source/include',
336 ],
337 'conditions': [
338 ['build_with_chromium==1', {
339 'include_dirs': [
340 '../overrides',
341 '../../openssl/openssl/include',
342 ],
343 'sources!': [
344 'asyncinvoker.cc',
345 'asyncinvoker.h',
346 'asyncinvoker-inl.h',
347 'asyncresolverinterface.h',
348 'atomicops.h',
349 'bandwidthsmoother.cc',
350 'bandwidthsmoother.h',
351 'basictypes.h',
352 'bind.h',
353 'bind.h.pump',
354 'buffer.h',
355 'callback.h',
356 'callback.h.pump',
357 'constructormagic.h',
358 'dbus.cc',
359 'dbus.h',
360 'diskcache_win32.cc',
361 'diskcache_win32.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000362 'filelock.cc',
363 'filelock.h',
364 'fileutils_mock.h',
365 'genericslot.h',
366 'genericslot.h.pump',
367 'httpserver.cc',
368 'httpserver.h',
369 'json.cc',
370 'json.h',
371 'latebindingsymboltable.cc',
372 'latebindingsymboltable.cc.def',
373 'latebindingsymboltable.h',
374 'latebindingsymboltable.h.def',
375 'libdbusglibsymboltable.cc',
376 'libdbusglibsymboltable.h',
377 'linuxfdwalk.c',
378 'linuxfdwalk.h',
379 'linuxwindowpicker.cc',
380 'linuxwindowpicker.h',
381 'logging.cc',
382 'logging.h',
383 'macasyncsocket.cc',
384 'macasyncsocket.h',
385 'maccocoasocketserver.h',
386 'maccocoasocketserver.mm',
387 'macsocketserver.cc',
388 'macsocketserver.h',
389 'macwindowpicker.cc',
390 'macwindowpicker.h',
391 'mathutils.h',
392 'multipart.cc',
393 'multipart.h',
394 'natserver.cc',
395 'natserver.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000396 'natsocketfactory.cc',
397 'natsocketfactory.h',
398 'nattypes.cc',
399 'nattypes.h',
400 'openssl.h',
401 'optionsfile.cc',
402 'optionsfile.h',
403 'posix.cc',
404 'posix.h',
405 'profiler.cc',
406 'profiler.h',
407 'proxyserver.cc',
408 'proxyserver.h',
409 'refcount.h',
410 'referencecountedsingletonfactory.h',
411 'rollingaccumulator.h',
412 'safe_conversions.h',
413 'safe_conversions_impl.h',
414 'scopedptrcollection.h',
415 'scoped_ref_ptr.h',
416 'sec_buffer.h',
417 'sharedexclusivelock.cc',
418 'sharedexclusivelock.h',
419 'sslconfig.h',
420 'sslroots.h',
421 'stringdigest.h',
422 'testbase64.h',
423 'testclient.cc',
424 'testclient.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000425 'transformadapter.cc',
426 'transformadapter.h',
427 'versionparsing.cc',
428 'versionparsing.h',
429 'virtualsocketserver.cc',
430 'virtualsocketserver.h',
431 'win32regkey.cc',
432 'win32regkey.h',
433 'win32socketinit.cc',
434 'win32socketinit.h',
435 'win32socketserver.cc',
436 'win32socketserver.h',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000437 'window.h',
438 'windowpickerfactory.h',
439 'windowpicker.h',
440 ],
441 'defines': [
442 'NO_MAIN_THREAD_WRAPPING',
443 'SSL_USE_NSS',
444 ],
445 'direct_dependent_settings': {
446 'defines': [
447 'NO_MAIN_THREAD_WRAPPING',
448 'SSL_USE_NSS',
449 ],
450 },
451 }, {
452 'dependencies': [
453 '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
454 ],
455 'sources!': [
456 '../overrides/webrtc/base/basictypes.h',
457 '../overrides/webrtc/base/constructormagic.h',
458 '../overrides/webrtc/base/win32socketinit.cc',
459 '../overrides/webrtc/base/logging.cc',
460 '../overrides/webrtc/base/logging.h',
461 ],
462 }],
463 ['use_openssl==1', {
464 'defines': [
465 'SSL_USE_OPENSSL',
466 'HAVE_OPENSSL_SSL_H',
467 ],
468 'direct_dependent_settings': {
469 'defines': [
470 'SSL_USE_OPENSSL',
471 'HAVE_OPENSSL_SSL_H',
472 ],
473 },
474 'dependencies': [
475 '<(DEPTH)/third_party/openssl/openssl.gyp:openssl',
476 ],
477 }, {
478 'defines': [
479 'SSL_USE_NSS',
480 'HAVE_NSS_SSL_H',
481 'SSL_USE_NSS_RNG',
482 ],
483 'direct_dependent_settings': {
484 'defines': [
485 'SSL_USE_NSS',
486 'HAVE_NSS_SSL_H',
487 'SSL_USE_NSS_RNG',
488 ],
489 },
490 }],
491 ['OS == "android"', {
492 'defines': [
493 'HAVE_OPENSSL_SSL_H'
494 ],
495 'direct_dependent_settings': {
496 'defines': [
497 'HAVE_OPENSSL_SSL_H'
498 ],
499 },
500 'link_settings': {
501 'libraries': [
502 '-llog',
503 '-lGLESv2',
504 ],
505 },
506 }, {
507 'defines': [
508 'HAVE_NSS_SSL_H'
509 'SSL_USE_NSS_RNG',
510 ],
511 'direct_dependent_settings': {
512 'defines': [
513 'HAVE_NSS_SSL_H'
514 'SSL_USE_NSS_RNG',
515 ],
516 },
517 'sources!': [
518 'ifaddrs-android.cc',
519 'ifaddrs-android.h',
520 ],
521 }],
522 ['OS=="ios"', {
523 'all_dependent_settings': {
524 'xcode_settings': {
525 'OTHER_LDFLAGS': [
526 '-framework Foundation',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000527 '-framework Security',
528 '-framework SystemConfiguration',
529 '-framework UIKit',
530 ],
531 },
532 },
533 'dependencies': [
534 '<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
535 ],
536 }],
537 ['OS=="linux"', {
538 'link_settings': {
539 'libraries': [
540 '-lcrypto',
541 '-ldl',
542 '-lrt',
543 '-lXext',
544 '-lX11',
545 '-lXcomposite',
546 '-lXrender',
547 '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
548 ],
549 },
550 'cflags': [
551 '<!@(<(pkg-config) --cflags nss)',
552 ],
553 'ldflags': [
554 '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
555 ],
556 }, {
557 'sources!': [
558 'dbus.cc',
559 'dbus.h',
560 'libdbusglibsymboltable.cc',
561 'libdbusglibsymboltable.h',
562 'linuxfdwalk.c',
563 'linuxwindowpicker.cc',
564 'linuxwindowpicker.h',
565 ],
566 }],
567 ['OS=="mac"', {
568 'link_settings': {
569 'libraries': [
570 '$(SDKROOT)/usr/lib/libcrypto.dylib',
571 '$(SDKROOT)/usr/lib/libssl.dylib',
572 ],
573 },
574 'all_dependent_settings': {
575 'link_settings': {
576 'xcode_settings': {
577 'OTHER_LDFLAGS': [
578 '-framework Cocoa',
579 '-framework Foundation',
580 '-framework IOKit',
581 '-framework Security',
582 '-framework SystemConfiguration',
583 ],
584 },
585 },
586 },
587 'conditions': [
588 ['target_arch=="ia32"', {
589 'all_dependent_settings': {
590 'link_settings': {
591 'xcode_settings': {
592 'OTHER_LDFLAGS': [
593 '-framework Carbon',
594 ],
595 },
596 },
597 },
598 }],
599 ],
600 }, {
601 'sources!': [
602 'macasyncsocket.cc',
603 'macasyncsocket.h',
604 'maccocoasocketserver.h',
605 'maccocoasocketserver.mm',
606 'macconversion.cc',
607 'macconversion.h',
608 'macsocketserver.cc',
609 'macsocketserver.h',
610 'macutils.cc',
611 'macutils.h',
612 'macwindowpicker.cc',
613 'macwindowpicker.h',
614 ],
615 }],
616 ['OS=="win"', {
617 'link_settings': {
618 'libraries': [
619 '-lcrypt32.lib',
620 '-liphlpapi.lib',
621 '-lsecur32.lib',
622 ],
623 },
624 # Suppress warnings about WIN32_LEAN_AND_MEAN.
625 'msvs_disabled_warnings': [4005, 4703],
626 'defines': [
627 '_CRT_NONSTDC_NO_DEPRECATE',
628 ],
629 }, {
630 'sources/': [
631 ['exclude', 'win32[a-z0-9]*\\.(h|cc)$'],
632 ],
633 'sources!': [
634 'schanneladapter.cc',
635 'schanneladapter.h',
636 'winping.cc',
637 'winping.h',
638 'winfirewall.cc',
639 'winfirewall.h',
640 ],
641 }],
642 ['os_posix==0', {
643 'sources!': [
644 'latebindingsymboltable.cc',
645 'latebindingsymboltable.h',
646 'posix.cc',
647 'posix.h',
648 'unixfilesystem.cc',
649 'unixfilesystem.h',
650 ],
651 }, {
652 'configurations': {
653 'Debug_Base': {
654 'defines': [
655 # Chromium's build/common.gypi defines this for all posix
656 # _except_ for ios & mac. We want it there as well, e.g.
657 # because ASSERT and friends trigger off of it.
658 '_DEBUG',
659 ],
660 },
661 }
662 }],
663 ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', {
664 'defines': [
665 'CARBON_DEPRECATED=YES',
666 ],
667 }],
668 ['OS!="ios" and OS!="mac"', {
669 'sources!': [
670 'scoped_autorelease_pool.mm',
671 ],
672 }],
673 ['OS=="ios" or os_posix==0', {
674 'sources!': [
675 'openssl.h',
676 'openssladapter.cc',
677 'openssladapter.h',
678 'openssldigest.cc',
679 'openssldigest.h',
680 'opensslidentity.cc',
681 'opensslidentity.h',
682 'opensslstreamadapter.cc',
683 'opensslstreamadapter.h',
684 ],
685 }],
686 ['OS!="linux" and OS!="android"', {
687 'sources!': [
688 'linux.cc',
689 'linux.h',
690 ],
691 }],
692 ['OS == "mac" or OS == "ios" or OS == "win"', {
693 'dependencies': [
694 '<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
695 '<(DEPTH)/third_party/nss/nss.gyp:nspr',
696 '<(DEPTH)/third_party/nss/nss.gyp:nss',
697 ],
698 }],
699 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
700 'dependencies': [
701 '<(DEPTH)/build/linux/system.gyp:ssl',
702 ],
703 }],
704 ],
705 },
706 ],
707}