blob: b9d93a6b09ed17c3bfe4c5107af53dd798113805 [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",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000035 "interface/scoped_refptr.h",
36 "interface/scoped_vector.h",
37 "interface/sleep.h",
38 "interface/sort.h",
39 "interface/static_instance.h",
40 "interface/stl_util.h",
41 "interface/stringize_macros.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000042 "interface/thread_wrapper.h",
43 "interface/tick_util.h",
44 "interface/timestamp_extrapolator.h",
45 "interface/trace.h",
46 "interface/trace_event.h",
47 "interface/utf_util_win.h",
48 "source/aligned_malloc.cc",
49 "source/atomic32_mac.cc",
50 "source/atomic32_win.cc",
51 "source/clock.cc",
52 "source/condition_variable.cc",
53 "source/condition_variable_posix.cc",
54 "source/condition_variable_posix.h",
55 "source/condition_variable_event_win.cc",
56 "source/condition_variable_event_win.h",
57 "source/condition_variable_native_win.cc",
58 "source/condition_variable_native_win.h",
59 "source/cpu_info.cc",
60 "source/cpu_features.cc",
61 "source/critical_section.cc",
62 "source/critical_section_posix.cc",
63 "source/critical_section_posix.h",
64 "source/critical_section_win.cc",
65 "source/critical_section_win.h",
66 "source/data_log_c.cc",
67 "source/event.cc",
Peter Boström64c03662015-04-08 11:24:19 +020068 "source/event_timer_posix.cc",
69 "source/event_timer_posix.h",
70 "source/event_timer_win.cc",
71 "source/event_timer_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000072 "source/event_tracer.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000073 "source/file_impl.cc",
74 "source/file_impl.h",
75 "source/logging.cc",
76 "source/rtp_to_ntp.cc",
77 "source/rw_lock.cc",
tommi@webrtc.orgfe196992015-02-07 22:35:54 +000078 "source/rw_lock_generic.cc",
79 "source/rw_lock_generic.h",
80 "source/rw_lock_posix.cc",
81 "source/rw_lock_posix.h",
82 "source/rw_lock_win.cc",
83 "source/rw_lock_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000084 "source/sleep.cc",
85 "source/sort.cc",
86 "source/tick_util.cc",
87 "source/thread.cc",
88 "source/thread_posix.cc",
89 "source/thread_posix.h",
90 "source/thread_win.cc",
91 "source/thread_win.h",
92 "source/timestamp_extrapolator.cc",
93 "source/trace_impl.cc",
94 "source/trace_impl.h",
95 "source/trace_posix.cc",
96 "source/trace_posix.h",
97 "source/trace_win.cc",
98 "source/trace_win.h",
99 ]
100
101 configs += [ "..:common_config" ]
102
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000103 public_configs = [
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000104 "..:common_inherited_config",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000105 ]
106
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000107 if (rtc_enable_data_logging) {
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000108 sources += [ "source/data_log.cc" ]
109 } else {
110 sources += [ "source/data_log_no_op.cc" ]
111 }
112
113 defines = []
114 libs = []
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000115 deps = [ "..:webrtc_common" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000116
117 if (is_android) {
118 sources += [
119 "interface/logcat_trace_context.h",
120 "source/logcat_trace_context.cc",
121 ]
122
123 defines += [
124 "WEBRTC_THREAD_RR",
125 # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC
126 # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now,
127 # remove it after I verify that CLOCK_MONOTONIC is fully functional
128 # with condition and event functions in system_wrappers.
129 "WEBRTC_CLOCK_TYPE_REALTIME",
130 ]
131
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000132 deps += [ ":cpu_features_android" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000133
134 libs += [ "log" ]
135 }
136
137 if (is_linux) {
138 defines += [
139 "WEBRTC_THREAD_RR",
140 # TODO(andrew): can we select this automatically?
141 # Define this if the Linux system does not support CLOCK_MONOTONIC.
142 #"WEBRTC_CLOCK_TYPE_REALTIME",
143 ]
144
145 libs += [ "rt" ]
146 }
147
148 if (!is_mac && !is_ios) {
149 sources += [
150 "source/atomic32_posix.cc",
151 ]
152 }
153
154 if (is_ios || is_mac) {
155 defines += [
156 "WEBRTC_THREAD_RR",
157 "WEBRTC_CLOCK_TYPE_REALTIME",
158 ]
159 }
160
161 if (is_ios) {
162 sources += [
163 "source/atomic32_mac.cc",
164 ]
165 }
166
167 if (is_win) {
168 libs += [ "winmm.lib" ]
169
170 cflags = [
171 "/wd4267", # size_t to int truncation.
172 "/wd4334", # Ignore warning on shift operator promotion.
173 ]
174 }
175
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000176 deps += [
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000177 "../base:rtc_base_approved",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000178 ]
179}
180
181source_set("field_trial_default") {
182 sources = [
glaznev@webrtc.org669bc7e2015-02-09 18:17:46 +0000183 "interface/field_trial_default.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000184 "source/field_trial_default.cc",
185 ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000186
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000187 configs += [ "..:common_config" ]
188 public_configs = [ "..:common_inherited_config" ]
189
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000190 deps = [
191 ":system_wrappers",
192 ]
193}
194
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000195source_set("metrics_default") {
196 sources = [
197 "source/metrics_default.cc",
198 ]
199
200 configs += [ "..:common_config" ]
201 public_configs = [ "..:common_inherited_config" ]
202
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000203 deps = [
204 ":system_wrappers",
205 ]
206}
207
208source_set("system_wrappers_default") {
209
210 configs += [ "..:common_config" ]
211 public_configs = [ "..:common_inherited_config" ]
212
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000213 deps = [
214 ":field_trial_default",
215 ":metrics_default",
216 ]
217}
218
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000219if (is_android) {
220 source_set("cpu_features_android") {
221 sources = [
222 "source/cpu_features_android.c",
223 ]
224
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000225 configs += [ "..:common_config" ]
226 public_configs = [ "..:common_inherited_config" ]
Richard Colesd417c932015-04-09 17:36:12 +0200227 deps = [ "//third_party/android_tools:cpu_features" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000228 }
229}