blob: d87ae0a7d086c6e6f67e4053f0800bd9a90c182f [file] [log] [blame]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +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
kjellander@webrtc.org62711f82014-06-29 13:37:08 +00009import("//build/config/android/config.gni")
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000010import("../build/webrtc.gni")
11
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000012static_library("system_wrappers") {
13 sources = [
andrew@webrtc.org325cff02014-10-01 17:42:18 +000014 "interface/aligned_array.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000015 "interface/aligned_malloc.h",
16 "interface/atomic32.h",
17 "interface/clock.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000018 "interface/condition_variable_wrapper.h",
19 "interface/cpu_info.h",
20 "interface/cpu_features_wrapper.h",
21 "interface/critical_section_wrapper.h",
22 "interface/data_log.h",
23 "interface/data_log_c.h",
24 "interface/data_log_impl.h",
25 "interface/event_tracer.h",
26 "interface/event_wrapper.h",
27 "interface/field_trial.h",
28 "interface/file_wrapper.h",
29 "interface/fix_interlocked_exchange_pointer_win.h",
30 "interface/logging.h",
asapersson@webrtc.org580d3672014-10-23 12:57:56 +000031 "interface/metrics.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000032 "interface/ref_count.h",
33 "interface/rtp_to_ntp.h",
34 "interface/rw_lock_wrapper.h",
35 "interface/scoped_ptr.h",
36 "interface/scoped_refptr.h",
37 "interface/scoped_vector.h",
38 "interface/sleep.h",
39 "interface/sort.h",
40 "interface/static_instance.h",
41 "interface/stl_util.h",
42 "interface/stringize_macros.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000043 "interface/thread_wrapper.h",
44 "interface/tick_util.h",
45 "interface/timestamp_extrapolator.h",
46 "interface/trace.h",
47 "interface/trace_event.h",
48 "interface/utf_util_win.h",
49 "source/aligned_malloc.cc",
50 "source/atomic32_mac.cc",
51 "source/atomic32_win.cc",
52 "source/clock.cc",
53 "source/condition_variable.cc",
54 "source/condition_variable_posix.cc",
55 "source/condition_variable_posix.h",
56 "source/condition_variable_event_win.cc",
57 "source/condition_variable_event_win.h",
58 "source/condition_variable_native_win.cc",
59 "source/condition_variable_native_win.h",
60 "source/cpu_info.cc",
61 "source/cpu_features.cc",
62 "source/critical_section.cc",
63 "source/critical_section_posix.cc",
64 "source/critical_section_posix.h",
65 "source/critical_section_win.cc",
66 "source/critical_section_win.h",
67 "source/data_log_c.cc",
68 "source/event.cc",
69 "source/event_posix.cc",
70 "source/event_posix.h",
71 "source/event_tracer.cc",
72 "source/event_win.cc",
73 "source/event_win.h",
74 "source/file_impl.cc",
75 "source/file_impl.h",
76 "source/logging.cc",
77 "source/rtp_to_ntp.cc",
78 "source/rw_lock.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000079 "source/set_thread_name_win.h",
80 "source/sleep.cc",
81 "source/sort.cc",
82 "source/tick_util.cc",
83 "source/thread.cc",
84 "source/thread_posix.cc",
85 "source/thread_posix.h",
86 "source/thread_win.cc",
87 "source/thread_win.h",
88 "source/timestamp_extrapolator.cc",
89 "source/trace_impl.cc",
90 "source/trace_impl.h",
91 "source/trace_posix.cc",
92 "source/trace_posix.h",
93 "source/trace_win.cc",
94 "source/trace_win.h",
95 ]
96
97 configs += [ "..:common_config" ]
98
andrew@webrtc.org325cff02014-10-01 17:42:18 +000099 if (is_clang) {
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000100 # Suppress warnings from Chrome's Clang plugins.
101 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
102 configs -= [ "//build/config/clang:find_bad_constructs" ]
103 }
104
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000105 public_configs = [
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000106 "..:common_inherited_config",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000107 ]
108
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000109 if (rtc_enable_data_logging) {
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000110 sources += [ "source/data_log.cc" ]
111 } else {
112 sources += [ "source/data_log_no_op.cc" ]
113 }
114
115 defines = []
116 libs = []
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000117 deps = []
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000118
119 if (is_android) {
120 sources += [
121 "interface/logcat_trace_context.h",
122 "source/logcat_trace_context.cc",
123 ]
124
125 defines += [
126 "WEBRTC_THREAD_RR",
127 # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC
128 # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now,
129 # remove it after I verify that CLOCK_MONOTONIC is fully functional
130 # with condition and event functions in system_wrappers.
131 "WEBRTC_CLOCK_TYPE_REALTIME",
132 ]
133
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000134 deps += [ ":cpu_features_android" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000135
136 libs += [ "log" ]
137 }
138
139 if (is_linux) {
140 defines += [
141 "WEBRTC_THREAD_RR",
142 # TODO(andrew): can we select this automatically?
143 # Define this if the Linux system does not support CLOCK_MONOTONIC.
144 #"WEBRTC_CLOCK_TYPE_REALTIME",
145 ]
146
147 libs += [ "rt" ]
148 }
149
150 if (!is_mac && !is_ios) {
151 sources += [
152 "source/atomic32_posix.cc",
153 ]
154 }
155
156 if (is_ios || is_mac) {
157 defines += [
158 "WEBRTC_THREAD_RR",
159 "WEBRTC_CLOCK_TYPE_REALTIME",
160 ]
161 }
162
163 if (is_ios) {
164 sources += [
165 "source/atomic32_mac.cc",
166 ]
167 }
168
169 if (is_win) {
170 libs += [ "winmm.lib" ]
171
172 cflags = [
173 "/wd4267", # size_t to int truncation.
174 "/wd4334", # Ignore warning on shift operator promotion.
175 ]
176 }
177
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000178 deps += [
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000179 "../base:rtc_base_approved",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000180 ]
181}
182
183source_set("field_trial_default") {
184 sources = [
185 "source/field_trial_default.cc",
186 ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000187
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000188 configs += [ "..:common_config" ]
189 public_configs = [ "..:common_inherited_config" ]
190
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000191 if (is_clang) {
192 # Suppress warnings from Chrome's Clang plugins.
193 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
194 configs -= [ "//build/config/clang:find_bad_constructs" ]
195 }
196
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000197 deps = [
198 ":system_wrappers",
199 ]
200}
201
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000202source_set("metrics_default") {
203 sources = [
204 "source/metrics_default.cc",
205 ]
206
207 configs += [ "..:common_config" ]
208 public_configs = [ "..:common_inherited_config" ]
209
210 if (is_clang) {
211 # Suppress warnings from Chrome's Clang plugins.
212 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
213 configs -= [ "//build/config/clang:find_bad_constructs" ]
214 }
215
216 deps = [
217 ":system_wrappers",
218 ]
219}
220
221source_set("system_wrappers_default") {
222
223 configs += [ "..:common_config" ]
224 public_configs = [ "..:common_inherited_config" ]
225
226 if (is_clang) {
227 # Suppress warnings from Chrome's Clang plugins.
228 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
229 configs -= [ "//build/config/clang:find_bad_constructs" ]
230 }
231
232 deps = [
233 ":field_trial_default",
234 ":metrics_default",
235 ]
236}
237
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000238if (is_android) {
239 source_set("cpu_features_android") {
240 sources = [
241 "source/cpu_features_android.c",
242 ]
243
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000244 configs += [ "..:common_config" ]
245 public_configs = [ "..:common_inherited_config" ]
246
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000247 if (is_android_webview_build) {
248 libs += [ "cpufeatures.a" ]
249 } else {
250 deps = [ "//third_party/android_tools:cpu_features" ]
251 }
252 }
253}