blob: cc79f0bcc73ff14af58da2f3aa29de1a1ef8b0d3 [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',
fischman@webrtc.org7e4d0df2013-10-01 02:40:43 +000040 '../interface/logcat_trace_context.h',
andrew@webrtc.org50419b02012-11-14 19:07:54 +000041 '../interface/logging.h',
perkj@google.com88a0da82011-09-02 12:51:35 +000042 '../interface/ref_count.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000043 '../interface/rw_lock_wrapper.h',
stefan@webrtc.orgc9cff242011-08-29 07:39:02 +000044 '../interface/scoped_ptr.h',
andrew@webrtc.orga3c6d612011-09-13 17:17:49 +000045 '../interface/scoped_refptr.h',
hta@webrtc.org41adcdb2012-06-18 11:24:57 +000046 '../interface/sleep.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000047 '../interface/sort.h',
andrew@webrtc.org6d609b52011-12-14 02:36:33 +000048 '../interface/static_instance.h',
andrew@webrtc.org076fc122013-02-15 03:54:22 +000049 '../interface/stringize_macros.h',
andresp@webrtc.org7fb75ec2013-12-20 20:20:50 +000050 '../interface/thread_annotations.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',
kjellander@webrtc.org7de47bc2014-04-16 08:04:26 +000055 '../interface/utf_util_win.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000056 'aligned_malloc.cc',
tommi@webrtc.orge84373c2012-04-19 14:28:45 +000057 'atomic32_mac.cc',
tommi@webrtc.org9018c9f2012-04-19 15:38:10 +000058 'atomic32_posix.cc',
tommi@webrtc.orge84373c2012-04-19 14:28:45 +000059 'atomic32_win.cc',
stefan@webrtc.org20ed36d2013-01-17 14:01:20 +000060 'clock.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000061 'condition_variable.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000062 'condition_variable_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +000063 'condition_variable_posix.h',
henrike@webrtc.org686001d2013-03-26 14:16:05 +000064 'condition_variable_event_win.cc',
65 'condition_variable_event_win.h',
66 'condition_variable_native_win.cc',
67 'condition_variable_native_win.h',
henrikg@webrtc.orgc58ef082011-11-08 08:44:17 +000068 'cpu_info.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000069 'cpu_features.cc',
70 'critical_section.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000071 'critical_section_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +000072 'critical_section_posix.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000073 'critical_section_win.cc',
74 'critical_section_win.h',
75 'data_log.cc',
henrik.lundin@webrtc.orgd855bd42011-10-10 08:06:17 +000076 'data_log_c.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000077 'data_log_no_op.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000078 'event.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000079 'event_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +000080 'event_posix.h',
hclam@chromium.orgad7efa62012-12-11 21:19:08 +000081 'event_tracer.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000082 'event_win.cc',
83 'event_win.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000084 'file_impl.cc',
85 'file_impl.h',
fischman@webrtc.org7e4d0df2013-10-01 02:40:43 +000086 'logcat_trace_context.cc',
andrew@webrtc.org50419b02012-11-14 19:07:54 +000087 'logging.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000088 'rw_lock.cc',
henrike@webrtc.org9f847232012-09-25 20:27:51 +000089 'rw_lock_generic.cc',
90 'rw_lock_generic.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000091 'rw_lock_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +000092 'rw_lock_posix.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +000093 'rw_lock_win.cc',
94 'rw_lock_win.h',
phoglund@webrtc.org4cebe6c2012-11-07 13:37:19 +000095 'set_thread_name_win.h',
hta@webrtc.org41adcdb2012-06-18 11:24:57 +000096 'sleep.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000097 'sort.cc',
phoglund@webrtc.org4cebe6c2012-11-07 13:37:19 +000098 'tick_util.cc',
niklase@google.com470e71d2011-07-07 08:21:25 +000099 'thread.cc',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000100 'thread_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +0000101 'thread_posix.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000102 'thread_win.cc',
103 'thread_win.h',
niklase@google.com470e71d2011-07-07 08:21:25 +0000104 'trace_impl.cc',
105 'trace_impl.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000106 'trace_posix.cc',
ajm@google.comb5c49ff2011-08-01 17:04:04 +0000107 'trace_posix.h',
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000108 'trace_win.cc',
109 'trace_win.h',
niklase@google.com470e71d2011-07-07 08:21:25 +0000110 ],
111 'conditions': [
stefan@webrtc.orgc9cff242011-08-29 07:39:02 +0000112 ['enable_data_logging==1', {
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000113 'sources!': [ 'data_log_no_op.cc', ],
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000114 }, {
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000115 'sources!': [ 'data_log.cc', ],
stefan@webrtc.orgc9cff242011-08-29 07:39:02 +0000116 },],
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000117 ['OS=="android"', {
sergeyu@chromium.org23516632013-04-30 22:53:51 +0000118 'defines': [
119 'WEBRTC_THREAD_RR',
120 # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC
121 # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now,
122 # remove it after I verify that CLOCK_MONOTONIC is fully functional
123 # with condition and event functions in system_wrappers.
124 'WEBRTC_CLOCK_TYPE_REALTIME',
125 ],
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000126 'dependencies': [ 'cpu_features_android', ],
fischman@webrtc.org4e65e072013-10-03 18:23:13 +0000127 'link_settings': {
128 'libraries': [
129 '-llog',
130 ],
131 },
fischman@webrtc.org7e4d0df2013-10-01 02:40:43 +0000132 }, { # OS!="android"
133 'sources!': [
134 '../interface/logcat_trace_context.h',
135 'logcat_trace_context.cc',
136 ],
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000137 }],
niklase@google.com470e71d2011-07-07 08:21:25 +0000138 ['OS=="linux"', {
sergeyu@chromium.org23516632013-04-30 22:53:51 +0000139 'defines': [
140 'WEBRTC_THREAD_RR',
141 # TODO(andrew): can we select this automatically?
142 # Define this if the Linux system does not support CLOCK_MONOTONIC.
143 #'WEBRTC_CLOCK_TYPE_REALTIME',
144 ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000145 'link_settings': {
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000146 'libraries': [ '-lrt', ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000147 },
148 }],
149 ['OS=="mac"', {
zakkhoyt@google.com59af6f12011-08-25 20:30:25 +0000150 'link_settings': {
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000151 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', ],
zakkhoyt@google.com59af6f12011-08-25 20:30:25 +0000152 },
tommi@webrtc.org9018c9f2012-04-19 15:38:10 +0000153 'sources!': [
154 'atomic32_posix.cc',
155 ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000156 }],
sergeyu@chromium.org23516632013-04-30 22:53:51 +0000157 ['OS=="ios" or OS=="mac"', {
158 'defines': [
159 'WEBRTC_THREAD_RR',
160 'WEBRTC_CLOCK_TYPE_REALTIME',
161 ],
162 }],
niklase@google.com470e71d2011-07-07 08:21:25 +0000163 ['OS=="win"', {
niklase@google.com470e71d2011-07-07 08:21:25 +0000164 'link_settings': {
andrew@webrtc.org59ccd5c2011-12-15 00:17:43 +0000165 'libraries': [ '-lwinmm.lib', ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000166 },
167 }],
sjlee@webrtc.org4b425082012-09-10 17:58:21 +0000168 ], # conditions
169 'target_conditions': [
170 # We need to do this in a target_conditions block to override the
171 # filename_rules filters.
172 ['OS=="ios"', {
173 # Pull in specific Mac files for iOS (which have been filtered out
174 # by file name rules).
175 'sources/': [
176 ['include', '^atomic32_mac\\.'],
sjlee@webrtc.org4b425082012-09-10 17:58:21 +0000177 ],
178 'sources!': [
179 'atomic32_posix.cc',
180 ],
181 }],
182 ],
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000183 # Disable warnings to enable Win64 build, issue 1323.
184 'msvs_disabled_warnings': [
185 4267, # size_t to int truncation.
186 4334, # Ignore warning on shift operator promotion.
187 ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000188 },
niklase@google.com470e71d2011-07-07 08:21:25 +0000189 ], # targets
kjellander@webrtc.org177bb522011-10-31 17:10:01 +0000190 'conditions': [
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000191 ['OS=="android"', {
192 'targets': [
193 {
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000194 'target_name': 'cpu_features_android',
wjia@webrtc.orga3c82bf2013-01-18 23:42:21 +0000195 'type': 'static_library',
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000196 'sources': [
leozwang@webrtc.orgd63cf712012-05-08 21:33:04 +0000197 'cpu_features_android.c',
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000198 ],
wjia@webrtc.org815653b2012-11-19 04:04:10 +0000199 'conditions': [
michaelbai@google.comf928f5c2014-02-05 18:43:46 +0000200 ['android_webview_build == 1', {
201 'libraries': [
202 'cpufeatures.a'
wjia@webrtc.org815653b2012-11-19 04:04:10 +0000203 ],
204 }, {
michaelbai@google.comf928f5c2014-02-05 18:43:46 +0000205 'dependencies': [
206 '<(android_ndk_root)/android_tools_ndk.gyp:cpu_features',
wjia@webrtc.org815653b2012-11-19 04:04:10 +0000207 ],
208 }],
209 ],
leozwang@webrtc.orgf5fe1002012-05-08 15:20:02 +0000210 },
211 ],
212 }],
xians@google.com87062562011-08-08 12:08:15 +0000213 ], # conditions
niklase@google.com470e71d2011-07-07 08:21:25 +0000214}
215