blob: 0aa4932a14f411a8dfaba0590abbefc668263444 [file] [log] [blame]
tommi@webrtc.orge84373c2012-04-19 14:28:45 +00001# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
andrew@webrtc.orga3c6d612011-09-13 17:17:49 +00002#
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.
niklase@google.com470e71d2011-07-07 08:21:25 +00008
niklase@google.com470e71d2011-07-07 08:21:25 +00009{
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000010 'includes': [ '../../build/common.gypi', ],
niklase@google.com470e71d2011-07-07 08:21:25 +000011 'targets': [
12 {
13 'target_name': 'system_wrappers',
wjia@webrtc.orga3c82bf2013-01-18 23:42:21 +000014 'type': 'static_library',
niklase@google.com470e71d2011-07-07 08:21:25 +000015 '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',
tommi@webrtc.orge84373c2012-04-19 14:28:45 +000026 '../interface/atomic32.h',
stefan@webrtc.org20ed36d2013-01-17 14:01:20 +000027 '../interface/clock.h',
tommi@webrtc.org98ad0ff2012-04-10 11:53:07 +000028 '../interface/compile_assert.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000029 '../interface/condition_variable_wrapper.h',
henrikg@webrtc.orgc58ef082011-11-08 08:44:17 +000030 '../interface/cpu_info.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000031 '../interface/cpu_features_wrapper.h',
32 '../interface/critical_section_wrapper.h',
stefan@webrtc.orgc9cff242011-08-29 07:39:02 +000033 '../interface/data_log.h',
henrik.lundin@webrtc.orgd855bd42011-10-10 08:06:17 +000034 '../interface/data_log_c.h',
stefan@webrtc.orgc9cff242011-08-29 07:39:02 +000035 '../interface/data_log_impl.h',
hclam@chromium.orgad7efa62012-12-11 21:19:08 +000036 '../interface/event_tracer.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000037 '../interface/event_wrapper.h',
38 '../interface/file_wrapper.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000039 '../interface/fix_interlocked_exchange_pointer_win.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000040 '../interface/list_wrapper.h',
fischman@webrtc.org7e4d0df2013-10-01 02:40:43 +000041 '../interface/logcat_trace_context.h',
andrew@webrtc.org50419b02012-11-14 19:07:54 +000042 '../interface/logging.h',
perkj@google.com88a0da82011-09-02 12:51:35 +000043 '../interface/ref_count.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000044 '../interface/rw_lock_wrapper.h',
stefan@webrtc.orgc9cff242011-08-29 07:39:02 +000045 '../interface/scoped_ptr.h',
andrew@webrtc.orga3c6d612011-09-13 17:17:49 +000046 '../interface/scoped_refptr.h',
hta@webrtc.org41adcdb2012-06-18 11:24:57 +000047 '../interface/sleep.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000048 '../interface/sort.h',
andrew@webrtc.org6d609b52011-12-14 02:36:33 +000049 '../interface/static_instance.h',
andrew@webrtc.org076fc122013-02-15 03:54:22 +000050 '../interface/stringize_macros.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000051 '../interface/thread_wrapper.h',
52 '../interface/tick_util.h',
53 '../interface/trace.h',
hclam@chromium.orgad7efa62012-12-11 21:19:08 +000054 '../interface/trace_event.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000055 'aligned_malloc.cc',
tommi@webrtc.orge84373c2012-04-19 14:28:45 +000056 'atomic32_mac.cc',
tommi@webrtc.org9018c9f2012-04-19 15:38:10 +000057 'atomic32_posix.cc',
tommi@webrtc.orge84373c2012-04-19 14:28:45 +000058 'atomic32_win.cc',
stefan@webrtc.org20ed36d2013-01-17 14:01:20 +000059 'clock.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000060 'condition_variable.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000061 'condition_variable_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +000062 'condition_variable_posix.h',
henrike@webrtc.org686001d2013-03-26 14:16:05 +000063 'condition_variable_event_win.cc',
64 'condition_variable_event_win.h',
65 'condition_variable_native_win.cc',
66 'condition_variable_native_win.h',
henrikg@webrtc.orgc58ef082011-11-08 08:44:17 +000067 'cpu_info.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000068 'cpu_features.cc',
69 'critical_section.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000070 'critical_section_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +000071 'critical_section_posix.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000072 'critical_section_win.cc',
73 'critical_section_win.h',
74 'data_log.cc',
henrik.lundin@webrtc.orgd855bd42011-10-10 08:06:17 +000075 'data_log_c.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000076 'data_log_no_op.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000077 'event.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000078 'event_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +000079 'event_posix.h',
hclam@chromium.orgad7efa62012-12-11 21:19:08 +000080 'event_tracer.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000081 'event_win.cc',
82 'event_win.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000083 'file_impl.cc',
84 'file_impl.h',
85 'list_no_stl.cc',
fischman@webrtc.org7e4d0df2013-10-01 02:40:43 +000086 'logcat_trace_context.cc',
andrew@webrtc.org50419b02012-11-14 19:07:54 +000087 'logging.cc',
andrew@webrtc.orgc3e5d342012-11-23 19:30:59 +000088 'logging_no_op.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000089 'rw_lock.cc',
henrike@webrtc.org9f847232012-09-25 20:27:51 +000090 'rw_lock_generic.cc',
91 'rw_lock_generic.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000092 'rw_lock_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +000093 'rw_lock_posix.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000094 'rw_lock_win.cc',
95 'rw_lock_win.h',
phoglund@webrtc.org4cebe6c2012-11-07 13:37:19 +000096 'set_thread_name_win.h',
hta@webrtc.org41adcdb2012-06-18 11:24:57 +000097 'sleep.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000098 'sort.cc',
phoglund@webrtc.org4cebe6c2012-11-07 13:37:19 +000099 'tick_util.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +0000100 'thread.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000101 'thread_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +0000102 'thread_posix.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000103 'thread_win.cc',
104 'thread_win.h',
niklase@google.com470e71d2011-07-07 08:21:25 +0000105 'trace_impl.cc',
106 'trace_impl.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000107 'trace_impl_no_op.cc',
108 'trace_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +0000109 'trace_posix.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000110 'trace_win.cc',
111 'trace_win.h',
niklase@google.com470e71d2011-07-07 08:21:25 +0000112 ],
113 'conditions': [
stefan@webrtc.orgc9cff242011-08-29 07:39:02 +0000114 ['enable_data_logging==1', {
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000115 'sources!': [ 'data_log_no_op.cc', ],
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000116 }, {
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000117 'sources!': [ 'data_log.cc', ],
stefan@webrtc.orgc9cff242011-08-29 07:39:02 +0000118 },],
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000119 ['enable_tracing==1', {
120 'sources!': [
andrew@webrtc.orgc3e5d342012-11-23 19:30:59 +0000121 'logging_no_op.cc',
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000122 'trace_impl_no_op.cc',
123 ],
124 }, {
125 'sources!': [
andrew@webrtc.orgc3e5d342012-11-23 19:30:59 +0000126 'logging.cc',
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000127 'trace_impl.cc',
128 'trace_impl.h',
129 'trace_posix.cc',
130 'trace_posix.h',
131 'trace_win.cc',
132 'trace_win.h',
133 ],
134 }],
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000135 ['OS=="android"', {
sergeyu@chromium.org23516632013-04-30 22:53:51 +0000136 'defines': [
137 'WEBRTC_THREAD_RR',
138 # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC
139 # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now,
140 # remove it after I verify that CLOCK_MONOTONIC is fully functional
141 # with condition and event functions in system_wrappers.
142 'WEBRTC_CLOCK_TYPE_REALTIME',
143 ],
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000144 'dependencies': [ 'cpu_features_android', ],
fischman@webrtc.org7e4d0df2013-10-01 02:40:43 +0000145 }, { # OS!="android"
146 'sources!': [
147 '../interface/logcat_trace_context.h',
148 'logcat_trace_context.cc',
149 ],
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000150 }],
niklase@google.com470e71d2011-07-07 08:21:25 +0000151 ['OS=="linux"', {
sergeyu@chromium.org23516632013-04-30 22:53:51 +0000152 'defines': [
153 'WEBRTC_THREAD_RR',
154 # TODO(andrew): can we select this automatically?
155 # Define this if the Linux system does not support CLOCK_MONOTONIC.
156 #'WEBRTC_CLOCK_TYPE_REALTIME',
157 ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000158 'link_settings': {
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000159 'libraries': [ '-lrt', ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000160 },
161 }],
162 ['OS=="mac"', {
zakkhoyt@google.com59af6f12011-08-25 20:30:25 +0000163 'link_settings': {
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000164 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', ],
zakkhoyt@google.com59af6f12011-08-25 20:30:25 +0000165 },
tommi@webrtc.org9018c9f2012-04-19 15:38:10 +0000166 'sources!': [
167 'atomic32_posix.cc',
168 ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000169 }],
sergeyu@chromium.org23516632013-04-30 22:53:51 +0000170 ['OS=="ios" or OS=="mac"', {
171 'defines': [
172 'WEBRTC_THREAD_RR',
173 'WEBRTC_CLOCK_TYPE_REALTIME',
174 ],
175 }],
niklase@google.com470e71d2011-07-07 08:21:25 +0000176 ['OS=="win"', {
niklase@google.com470e71d2011-07-07 08:21:25 +0000177 'link_settings': {
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000178 'libraries': [ '-lwinmm.lib', ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000179 },
180 }],
sjlee@webrtc.org4b425082012-09-10 17:58:21 +0000181 ], # conditions
182 'target_conditions': [
183 # We need to do this in a target_conditions block to override the
184 # filename_rules filters.
185 ['OS=="ios"', {
186 # Pull in specific Mac files for iOS (which have been filtered out
187 # by file name rules).
188 'sources/': [
189 ['include', '^atomic32_mac\\.'],
sjlee@webrtc.org4b425082012-09-10 17:58:21 +0000190 ],
191 'sources!': [
192 'atomic32_posix.cc',
193 ],
194 }],
195 ],
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000196 # Disable warnings to enable Win64 build, issue 1323.
197 'msvs_disabled_warnings': [
198 4267, # size_t to int truncation.
199 4334, # Ignore warning on shift operator promotion.
200 ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000201 },
niklase@google.com470e71d2011-07-07 08:21:25 +0000202 ], # targets
kjellander@webrtc.org177bb522011-10-31 17:10:01 +0000203 'conditions': [
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000204 ['OS=="android"', {
205 'targets': [
206 {
207 'variables': {
208 # Treat this as third-party code.
209 'chromium_code': 0,
210 },
211 'target_name': 'cpu_features_android',
wjia@webrtc.orga3c82bf2013-01-18 23:42:21 +0000212 'type': 'static_library',
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000213 'sources': [
leozwang@webrtc.orgd63cf712012-05-08 21:33:04 +0000214 # TODO(leozwang): Ideally we want to audomatically exclude .c files
215 # as with .cc files, gyp currently only excludes .cc files.
216 'cpu_features_android.c',
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000217 ],
wjia@webrtc.org815653b2012-11-19 04:04:10 +0000218 'conditions': [
henrike@webrtc.org42581542013-07-16 16:37:22 +0000219 ['include_ndk_cpu_features==1', {
wjia@webrtc.orgdf943292012-12-05 22:54:52 +0000220 'conditions': [
wjia@webrtc.org95a8ddd2013-03-18 21:41:04 +0000221 ['android_webview_build == 1', {
wjia@webrtc.orgdf943292012-12-05 22:54:52 +0000222 'libraries': [
223 'cpufeatures.a'
224 ],
225 }, {
226 'dependencies': [
227 '<(android_ndk_root)/android_tools_ndk.gyp:cpu_features',
228 ],
229 }],
wjia@webrtc.org815653b2012-11-19 04:04:10 +0000230 ],
231 }, {
232 'sources': [
233 'android/cpu-features.c',
234 'android/cpu-features.h',
235 ],
236 }],
237 ],
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000238 },
239 ],
240 }],
xians@google.com87062562011-08-08 12:08:15 +0000241 ], # conditions
niklase@google.com470e71d2011-07-07 08:21:25 +0000242}
243