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