Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: webrtc/media/BUILD.gn

Issue 2050313002: GN: Add rtc_media_unittests (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Updated after https://codereview.webrtc.org/2024813004 Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/base/BUILD.gn ('k') | webrtc/media/media.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
2 # 2 #
3 # Use of this source code is governed by a BSD-style license 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 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 5 # tree. An additional intellectual property rights grant can be found
6 # in the file PATENTS. All contributing project authors may 6 # in the file PATENTS. All contributing project authors may
7 # be found in the AUTHORS file in the root of the source tree. 7 # be found in the AUTHORS file in the root of the source tree.
8 8
9 import("//build/config/linux/pkg_config.gni") 9 import("//build/config/linux/pkg_config.gni")
10 import("../build/webrtc.gni") 10 import("../build/webrtc.gni")
11 import("//testing/test.gni")
11 12
12 group("media") { 13 group("media") {
13 deps = [ 14 deps = [
14 ":rtc_media", 15 ":rtc_media",
15 ] 16 ]
16 } 17 }
17 18
18 config("rtc_media_defines_config") { 19 config("rtc_media_defines_config") {
19 defines = [ 20 defines = [
20 "HAVE_WEBRTC_VIDEO", 21 "HAVE_WEBRTC_VIDEO",
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 ] 119 ]
119 120
120 configs += [ 121 configs += [
121 "..:common_config", 122 "..:common_config",
122 ":rtc_media_warnings_config", 123 ":rtc_media_warnings_config",
123 ] 124 ]
124 125
125 public_configs = [ "..:common_inherited_config" ] 126 public_configs = [ "..:common_inherited_config" ]
126 127
127 if (is_clang) { 128 if (is_clang) {
128 # Suppress warnings from Chrome's Clang plugins. 129 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
129 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. 130 configs -= [
130 configs -= [ "//build/config/clang:extra_warnings" ] 131 "//build/config/clang:extra_warnings",
131 configs -= [ "//build/config/clang:find_bad_constructs" ] 132 "//build/config/clang:find_bad_constructs",
133 ]
132 } 134 }
133 135
134 if (is_win) { 136 if (is_win) {
135 cflags = [ 137 cflags = [
136 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. 138 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch.
137 "/wd4267", # conversion from "size_t" to "int", possible loss of data. 139 "/wd4267", # conversion from "size_t" to "int", possible loss of data.
138 "/wd4389", # signed/unsigned mismatch. 140 "/wd4389", # signed/unsigned mismatch.
139 ] 141 ]
140 } 142 }
141 143
(...skipping 12 matching lines...) Expand all
154 # TODO(jiayl): move this into the public_configs of 156 # TODO(jiayl): move this into the public_configs of
155 # //third_party/usrsctp/BUILD.gn. 157 # //third_party/usrsctp/BUILD.gn.
156 "//third_party/usrsctp/usrsctplib", 158 "//third_party/usrsctp/usrsctplib",
157 ] 159 ]
158 deps += [ "//third_party/usrsctp" ] 160 deps += [ "//third_party/usrsctp" ]
159 } 161 }
160 162
161 if (build_with_chromium) { 163 if (build_with_chromium) {
162 deps += [ "../modules/video_capture:video_capture" ] 164 deps += [ "../modules/video_capture:video_capture" ]
163 } else { 165 } else {
164 configs += [ ":rtc_media_defines_config" ]
165 public_configs += [ ":rtc_media_defines_config" ] 166 public_configs += [ ":rtc_media_defines_config" ]
166 deps += [ "../modules/video_capture:video_capture_internal_impl" ] 167 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
167 } 168 }
168 if (is_linux && rtc_use_gtk) { 169 if (is_linux && rtc_use_gtk) {
169 sources += [ 170 sources += [
170 "devices/gtkvideorenderer.cc", 171 "devices/gtkvideorenderer.cc",
171 "devices/gtkvideorenderer.h", 172 "devices/gtkvideorenderer.h",
172 ] 173 ]
173 public_configs += [ ":gtk-lib" ] 174 public_configs += [ ":gtk-lib" ]
174 } 175 }
(...skipping 15 matching lines...) Expand all
190 ] 191 ]
191 libs += [ "Carbon.framework" ] 192 libs += [ "Carbon.framework" ]
192 } 193 }
193 if (is_ios || (is_mac && current_cpu != "x86")) { 194 if (is_ios || (is_mac && current_cpu != "x86")) {
194 defines += [ "CARBON_DEPRECATED=YES" ] 195 defines += [ "CARBON_DEPRECATED=YES" ]
195 } 196 }
196 197
197 deps += [ 198 deps += [
198 "..:webrtc_common", 199 "..:webrtc_common",
199 "../base:rtc_base_approved", 200 "../base:rtc_base_approved",
201 "../call",
200 "../libjingle/xmllite", 202 "../libjingle/xmllite",
201 "../libjingle/xmpp", 203 "../libjingle/xmpp",
204 "../modules/video_coding",
202 "../p2p", 205 "../p2p",
203 "../system_wrappers", 206 "../system_wrappers",
207 "../video",
204 "../voice_engine", 208 "../voice_engine",
205 ] 209 ]
206 } 210 }
211
212 if (rtc_include_tests) {
213 config("rtc_unittest_main_config") {
214 # GN orders flags on a target before flags from configs. The default config
215 # adds -Wall, and this flag have to be after -Wall -- so they need to
216 # come from a config and can"t be on the target directly.
217 if (is_clang && is_ios) {
218 cflags = [ "-Wno-unused-variable" ]
219 }
220 }
221
222 source_set("rtc_unittest_main") {
223 testonly = true
224
225 deps = []
226 sources = [
227 "base/fakemediaengine.h",
228 "base/fakenetworkinterface.h",
229 "base/fakertp.h",
230 "base/fakevideocapturer.h",
231 "base/fakevideorenderer.h",
232 "base/testutils.cc",
233 "base/testutils.h",
234 "engine/fakewebrtccall.cc",
235 "engine/fakewebrtccall.h",
236 "engine/fakewebrtccommon.h",
237 "engine/fakewebrtcdeviceinfo.h",
238 "engine/fakewebrtcvcmfactory.h",
239 "engine/fakewebrtcvideocapturemodule.h",
240 "engine/fakewebrtcvideoengine.h",
241 "engine/fakewebrtcvoiceengine.h",
242 ]
243
244 configs += [
245 "..:common_config",
246 ":rtc_unittest_main_config",
247 ]
248 public_configs = [ "..:common_inherited_config" ]
249
250 if (rtc_build_libyuv) {
251 deps += [ "$rtc_libyuv_dir" ]
252 public_deps = [
253 "$rtc_libyuv_dir",
254 ]
255 } else {
256 # Need to add a directory normally exported by libyuv.
257 include_dirs += [ "$rtc_libyuv_dir/include" ]
258 }
259
260 if (is_clang) {
261 # Suppress warnings from the Chromium Clang plugin.
262 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
263 configs -= [ "//build/config/clang:find_bad_constructs" ]
264 }
265
266 deps += [
267 "../base:rtc_base_tests_utils",
268 "//testing/gtest",
269 ]
270 public_deps += [ "//testing/gmock" ]
271 }
272
273 config("rtc_media_unittests_config") {
274 # GN orders flags on a target before flags from configs. The default config
275 # adds -Wall, and this flag have to be after -Wall -- so they need to
276 # come from a config and can"t be on the target directly.
277 # TODO(kjellander): Make the code compile without disabling these flags.
278 # See https://bugs.webrtc.org/3307.
279 if (is_clang && is_win) {
280 cflags += [ "-Wno-unused-function" ]
281 }
282 if (!is_win) {
283 cflags = [ "-Wno-sign-compare" ]
284 cflags_cc = [ "-Wno-overloaded-virtual" ]
285 }
286 }
287
288 test("rtc_media_unittests") {
289 testonly = true
290
291 deps = []
292 sources = [
293 "base/codec_unittest.cc",
294 "base/rtpdataengine_unittest.cc",
295 "base/rtpdump_unittest.cc",
296 "base/rtputils_unittest.cc",
297 "base/streamparams_unittest.cc",
298 "base/turnutils_unittest.cc",
299 "base/videoadapter_unittest.cc",
300 "base/videobroadcaster_unittest.cc",
301 "base/videocapturer_unittest.cc",
302 "base/videocommon_unittest.cc",
303 "base/videoengine_unittest.h",
304 "base/videoframe_unittest.h",
305 "engine/nullwebrtcvideoengine_unittest.cc",
306 "engine/simulcast_unittest.cc",
307 "engine/webrtcmediaengine_unittest.cc",
308 "engine/webrtcvideocapturer_unittest.cc",
309 "engine/webrtcvideoengine2_unittest.cc",
310 "engine/webrtcvideoframe_unittest.cc",
311 "engine/webrtcvideoframefactory_unittest.cc",
312 "engine/webrtcvoiceengine_unittest.cc",
313 "sctp/sctpdataengine_unittest.cc",
314 ]
315
316 configs += [
317 "..:common_config",
318 ":rtc_media_unittests_config",
319 ]
320 public_configs = [ "..:common_inherited_config" ]
321
322 if (is_win) {
323 cflags = [
324 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
325 "/wd4373", # virtual function override.
326 "/wd4389", # signed/unsigned mismatch.
327 ]
328 }
329
330 if (is_clang) {
331 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
332 configs -= [
333 "//build/config/clang:extra_warnings",
334 "//build/config/clang:find_bad_constructs",
335 ]
336 }
337
338 if (is_android) {
339 deps += [ "//testing/android/native_test:native_test_support" ]
340
341 # This needs to be kept in sync with the rtc_media_unittests.isolate file.
342 # TODO(kjellander); Move this to android_assets targets instead.
343 data = [
344 "//resources/media/captured-320x240-2s-48.frames",
345 "//resources/media/faces.1280x720_P420.yuv",
346 "//resources/media/faces_I420.jpg",
347 "//resources/media/faces_I422.jpg",
348 "//resources/media/faces_I444.jpg",
349 "//resources/media/faces_I411.jpg",
350 "//resources/media/faces_I400.jpg",
351 ]
352 }
353
354 deps += [
355 # TODO(kjellander): Move as part of work in bugs.webrtc.org/4243.
356 ":rtc_media",
357 ":rtc_unittest_main",
358 "../audio",
359 "../base:rtc_base_tests_utils",
360 "../system_wrappers:metrics_default",
361 ]
362 }
363 }
OLDNEW
« no previous file with comments | « webrtc/base/BUILD.gn ('k') | webrtc/media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698