Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / system_wrappers / source / system_wrappers.gyp
1 # Copyright (c) 2012 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   'targets': [
12     {
13       'target_name': 'system_wrappers',
14       'type': 'static_library',
15       'include_dirs': [
16         'spreadsortlib',
17         '../interface',
18       ],
19       'direct_dependent_settings': {
20         'include_dirs': [
21           '../interface',
22         ],
23       },
24       'sources': [
25         '../interface/aligned_malloc.h',
26         '../interface/atomic32.h',
27         '../interface/clock.h',
28         '../interface/compile_assert.h',
29         '../interface/condition_variable_wrapper.h',
30         '../interface/cpu_info.h',
31         '../interface/cpu_features_wrapper.h',
32         '../interface/critical_section_wrapper.h',
33         '../interface/data_log.h',
34         '../interface/data_log_c.h',
35         '../interface/data_log_impl.h',
36         '../interface/event_tracer.h',
37         '../interface/event_wrapper.h',
38         '../interface/file_wrapper.h',
39         '../interface/fix_interlocked_exchange_pointer_win.h',
40         '../interface/logcat_trace_context.h',
41         '../interface/logging.h',
42         '../interface/ref_count.h',
43         '../interface/rtp_to_ntp.h',
44         '../interface/rw_lock_wrapper.h',
45         '../interface/scoped_ptr.h',
46         '../interface/scoped_refptr.h',
47         '../interface/scoped_vector.h',
48         '../interface/sleep.h',
49         '../interface/sort.h',
50         '../interface/static_instance.h',
51         '../interface/stl_util.h',
52         '../interface/stringize_macros.h',
53         '../interface/thread_annotations.h',
54         '../interface/thread_wrapper.h',
55         '../interface/tick_util.h',
56         '../interface/timestamp_extrapolator.h',
57         '../interface/trace.h',
58         '../interface/trace_event.h',
59         '../interface/utf_util_win.h',
60         'aligned_malloc.cc',
61         'atomic32_mac.cc',
62         'atomic32_posix.cc',
63         'atomic32_win.cc',
64         'clock.cc',
65         'condition_variable.cc',
66         'condition_variable_posix.cc',
67         'condition_variable_posix.h',
68         'condition_variable_event_win.cc',
69         'condition_variable_event_win.h',
70         'condition_variable_native_win.cc',
71         'condition_variable_native_win.h',
72         'cpu_info.cc',
73         'cpu_features.cc',
74         'critical_section.cc',
75         'critical_section_posix.cc',
76         'critical_section_posix.h',
77         'critical_section_win.cc',
78         'critical_section_win.h',
79         'data_log.cc',
80         'data_log_c.cc',
81         'data_log_no_op.cc',
82         'event.cc',
83         'event_posix.cc',
84         'event_posix.h',
85         'event_tracer.cc',
86         'event_win.cc',
87         'event_win.h',
88         'file_impl.cc',
89         'file_impl.h',
90         'logcat_trace_context.cc',
91         'logging.cc',
92         'rtp_to_ntp.cc',
93         'rw_lock.cc',
94         'rw_lock_generic.cc',
95         'rw_lock_generic.h',
96         'rw_lock_posix.cc',
97         'rw_lock_posix.h',
98         'rw_lock_win.cc',
99         'rw_lock_win.h',
100         'set_thread_name_win.h',
101         'sleep.cc',
102         'sort.cc',
103         'tick_util.cc',
104         'thread.cc',
105         'thread_posix.cc',
106         'thread_posix.h',
107         'thread_win.cc',
108         'thread_win.h',
109         'timestamp_extrapolator.cc',
110         'trace_impl.cc',
111         'trace_impl.h',
112         'trace_posix.cc',
113         'trace_posix.h',
114         'trace_win.cc',
115         'trace_win.h',
116       ],
117       'conditions': [
118         ['enable_data_logging==1', {
119           'sources!': [ 'data_log_no_op.cc', ],
120         }, {
121           'sources!': [ 'data_log.cc', ],
122         },],
123         ['OS=="android"', {
124           'defines': [
125             'WEBRTC_THREAD_RR',
126             # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC
127             # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now,
128             # remove it after I verify that CLOCK_MONOTONIC is fully functional
129             # with condition and event functions in system_wrappers.
130             'WEBRTC_CLOCK_TYPE_REALTIME',
131            ],
132           'dependencies': [ 'cpu_features_android', ],
133           'link_settings': {
134             'libraries': [
135               '-llog',
136             ],
137           },
138         }, {  # OS!="android"
139           'sources!': [
140             '../interface/logcat_trace_context.h',
141             'logcat_trace_context.cc',
142           ],
143         }],
144         ['OS=="linux"', {
145           'defines': [
146             'WEBRTC_THREAD_RR',
147             # TODO(andrew): can we select this automatically?
148             # Define this if the Linux system does not support CLOCK_MONOTONIC.
149             #'WEBRTC_CLOCK_TYPE_REALTIME',
150           ],
151           'link_settings': {
152             'libraries': [ '-lrt', ],
153           },
154         }],
155         ['OS=="mac"', {
156           'link_settings': {
157             'libraries': [ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', ],
158           },
159           'sources!': [
160             'atomic32_posix.cc',
161           ],
162         }],
163         ['OS=="ios" or OS=="mac"', {
164           'defines': [
165             'WEBRTC_THREAD_RR',
166             'WEBRTC_CLOCK_TYPE_REALTIME',
167           ],
168         }],
169         ['OS=="win"', {
170           'link_settings': {
171             'libraries': [ '-lwinmm.lib', ],
172           },
173         }],
174       ], # conditions
175       'target_conditions': [
176         # We need to do this in a target_conditions block to override the
177         # filename_rules filters.
178         ['OS=="ios"', {
179           # Pull in specific Mac files for iOS (which have been filtered out
180           # by file name rules).
181           'sources/': [
182             ['include', '^atomic32_mac\\.'],
183           ],
184           'sources!': [
185             'atomic32_posix.cc',
186           ],
187         }],
188       ],
189       # Disable warnings to enable Win64 build, issue 1323.
190       'msvs_disabled_warnings': [
191         4267,  # size_t to int truncation.
192         4334,  # Ignore warning on shift operator promotion.
193       ],
194     },
195   ], # targets
196   'conditions': [
197     ['OS=="android"', {
198       'targets': [
199         {
200           'target_name': 'cpu_features_android',
201           'type': 'static_library',
202           'sources': [
203             'cpu_features_android.c',
204           ],
205           'conditions': [
206             ['android_webview_build == 1', {
207               'libraries': [
208                 'cpufeatures.a'
209               ],
210             }, {
211               'dependencies': [
212                 '<(android_ndk_root)/android_tools_ndk.gyp:cpu_features',
213               ],
214             }],
215           ],
216         },
217       ],
218     }],
219   ], # conditions
220 }
221