1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
}
import("../webrtc.gni")
rtc_static_library("system_wrappers") {
sources = [
"include/aligned_array.h",
"include/aligned_malloc.h",
"include/atomic32.h",
"include/clock.h",
"include/cpu_info.h",
"include/event_wrapper.h",
"include/file_wrapper.h",
"include/ntp_time.h",
"include/rtp_to_ntp_estimator.h",
"include/rw_lock_wrapper.h",
"include/sleep.h",
"include/timestamp_extrapolator.h",
"source/aligned_malloc.cc",
"source/atomic32.cc",
"source/clock.cc",
"source/cpu_features.cc",
"source/cpu_info.cc",
"source/event.cc",
"source/event_timer_posix.cc",
"source/event_timer_posix.h",
"source/event_timer_win.cc",
"source/event_timer_win.h",
"source/file_impl.cc",
"source/rtp_to_ntp_estimator.cc",
"source/rw_lock.cc",
"source/rw_lock_posix.cc",
"source/rw_lock_posix.h",
"source/rw_lock_win.cc",
"source/rw_lock_win.h",
"source/sleep.cc",
"source/timestamp_extrapolator.cc",
]
defines = []
libs = []
deps = [
"..:webrtc_common",
"../api:optional",
"../modules:module_api_public",
]
public_deps = [
":cpu_features_api",
":field_trial_api",
":metrics_api",
]
if (is_android) {
defines += [ "WEBRTC_THREAD_RR" ]
if (build_with_mozilla) {
include_dirs = [
"/config/external/nspr",
"/nsprpub/lib/ds",
"/nsprpub/pr/include",
]
} else {
deps += [ ":cpu_features_android" ]
}
libs += [ "log" ]
}
if (is_linux) {
defines += [ "WEBRTC_THREAD_RR" ]
if (!build_with_chromium) {
deps += [ ":cpu_features_linux" ]
}
libs += [ "rt" ]
}
if (is_ios || is_mac || is_bsd) {
defines += [ "WEBRTC_THREAD_RR" ]
}
# TODO(jschuh): Bug 1348: fix this warning.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
if (is_win) {
libs += [ "winmm.lib" ]
cflags = [ "/wd4334" ] # Ignore warning on shift operator promotion.
# Windows needs ../rtc_base:rtc_base due to include of
# webrtc/rtc_base/win32.h in source/clock.cc.
# TODO(kjellander): Remove (bugs.webrtc.org/6828)
deps += [ "../rtc_base:rtc_base" ]
}
if (is_win && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
deps += [
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_numerics",
]
}
rtc_source_set("cpu_features_api") {
sources = [
"include/cpu_features_wrapper.h",
]
deps = [
"..:webrtc_common",
]
}
rtc_source_set("asm_defines") {
sources = [
"include/asm_defines.h",
]
}
rtc_source_set("field_trial_api") {
sources = [
"include/field_trial.h",
]
}
rtc_source_set("metrics_api") {
sources = [
"include/metrics.h",
]
deps = [
"..:webrtc_common",
"../rtc_base:rtc_base_approved",
]
}
rtc_source_set("field_trial_default") {
sources = [
"include/field_trial_default.h",
"source/field_trial_default.cc",
]
deps = [
":field_trial_api",
]
}
rtc_source_set("metrics_default") {
sources = [
"include/metrics_default.h",
"source/metrics_default.cc",
]
deps = [
":metrics_api",
"../rtc_base:rtc_base_approved",
]
}
group("system_wrappers_default") {
deps = [
":field_trial_default",
":metrics_default",
":system_wrappers",
]
}
if (is_android && !build_with_mozilla) {
rtc_static_library("cpu_features_android") {
sources = [
"source/cpu_features_android.c",
]
deps = [
"//third_party/android_tools:cpu_features",
]
}
}
if (is_linux) {
rtc_static_library("cpu_features_linux") {
sources = [
"source/cpu_features_linux.c",
]
deps = [
":cpu_features_api",
]
}
}
if (rtc_include_tests) {
rtc_test("system_wrappers_unittests") {
testonly = true
sources = [
"source/aligned_array_unittest.cc",
"source/aligned_malloc_unittest.cc",
"source/clock_unittest.cc",
"source/event_timer_posix_unittest.cc",
"source/metrics_default_unittest.cc",
"source/metrics_unittest.cc",
"source/ntp_time_unittest.cc",
"source/rtp_to_ntp_estimator_unittest.cc",
]
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
deps = [
":metrics_default",
":system_wrappers",
"..:webrtc_common",
"../rtc_base:rtc_base_approved",
"../test:test_main",
"//testing/gtest",
]
if (is_android) {
deps += [ "//testing/android/native_test:native_test_support" ]
shard_timeout = 900
}
}
}
|