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

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

Issue 2514883002: Create //webrtc/api:libjingle_peerconnection_api + refactorings. (Closed)
Patch Set: Big move! Created 4 years 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
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/webrtc.gni") 9 import("../build/webrtc.gni")
10 if (is_android) {
11 import("//build/config/android/config.gni")
12 import("//build/config/android/rules.gni")
13 }
10 14
11 group("pc") { 15 group("pc") {
12 public_deps = [ 16 public_deps = [
13 ":rtc_pc", 17 ":rtc_pc",
14 ] 18 ]
15 } 19 }
16 20
17 config("rtc_pc_config") { 21 config("rtc_pc_config") {
18 defines = [ 22 defines = [
19 "HAVE_SCTP", 23 "HAVE_SCTP",
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 66 }
63 67
64 public_configs = [ ":rtc_pc_config" ] 68 public_configs = [ ":rtc_pc_config" ]
65 69
66 if (!build_with_chromium && is_clang) { 70 if (!build_with_chromium && is_clang) {
67 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). 71 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
68 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] 72 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
69 } 73 }
70 } 74 }
71 75
76 config("libjingle_peerconnection_warnings_config") {
77 # GN orders flags on a target before flags from configs. The default config
78 # adds these flags so to cancel them out they need to come from a config and
79 # cannot be on the target directly.
80 if (!is_win && !is_clang) {
81 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
82 }
83 }
84
85 rtc_static_library("libjingle_peerconnection") {
86 cflags = []
87 sources = [
88 "audiotrack.cc",
89 "audiotrack.h",
90 "datachannel.cc",
91 "datachannel.h",
92 "dtmfsender.cc",
93 "dtmfsender.h",
94 "jsepicecandidate.cc",
95 "jsepicecandidate.h",
96 "jsepsessiondescription.cc",
97 "jsepsessiondescription.h",
98 "localaudiosource.cc",
99 "localaudiosource.h",
100 "mediacontroller.cc",
101 "mediacontroller.h",
102 "mediastream.cc",
103 "mediastream.h",
104 "mediastreamobserver.cc",
105 "mediastreamobserver.h",
106 "mediastreamtrack.h",
107 "peerconnection.cc",
108 "peerconnection.h",
109 "peerconnectionfactory.cc",
110 "peerconnectionfactory.h",
111 "remoteaudiosource.cc",
112 "remoteaudiosource.h",
113 "rtcstatscollector.cc",
114 "rtcstatscollector.h",
115 "rtpreceiver.cc",
116 "rtpreceiver.h",
117 "rtpsender.cc",
118 "rtpsender.h",
119 "sctputils.cc",
120 "sctputils.h",
121 "statscollector.cc",
122 "statscollector.h",
123 "streamcollection.h",
124 "videocapturertracksource.cc",
125 "videocapturertracksource.h",
126 "videotrack.cc",
127 "videotrack.h",
128 "videotracksource.cc",
129 "videotracksource.h",
130 "webrtcsdp.cc",
131 "webrtcsdp.h",
132 "webrtcsession.cc",
133 "webrtcsession.h",
134 "webrtcsessiondescriptionfactory.cc",
135 "webrtcsessiondescriptionfactory.h",
136 ]
137
138 configs += [ ":libjingle_peerconnection_warnings_config" ]
139
140 if (!build_with_chromium && is_clang) {
141 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
142 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
143 }
144
145 deps = [
146 ":rtc_pc",
147 "../api:call_api",
148 "../api:libjingle_peerconnection_api",
149 "../api:rtc_stats_api",
150 "../call",
151 "../media",
152 "../stats",
153 ]
154
155 if (rtc_use_quic) {
156 sources += [
157 "quicdatachannel.cc",
158 "quicdatachannel.h",
159 "quicdatatransport.cc",
160 "quicdatatransport.h",
161 ]
162 deps += [ "//third_party/libquic" ]
163 public_deps = [
164 "//third_party/libquic",
165 ]
166 }
167 }
168
72 if (rtc_include_tests) { 169 if (rtc_include_tests) {
73 config("rtc_pc_unittests_config") { 170 config("rtc_pc_unittests_config") {
74 # GN orders flags on a target before flags from configs. The default config 171 # GN orders flags on a target before flags from configs. The default config
75 # adds -Wall, and this flag have to be after -Wall -- so they need to 172 # adds -Wall, and this flag have to be after -Wall -- so they need to
76 # come from a config and can't be on the target directly. 173 # come from a config and can't be on the target directly.
77 if (!is_win && !is_clang) { 174 if (!is_win && !is_clang) {
78 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC. 175 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
79 } 176 }
80 } 177 }
81 178
(...skipping 17 matching lines...) Expand all
99 if (!build_with_chromium && is_clang) { 196 if (!build_with_chromium && is_clang) {
100 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). 197 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
101 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] 198 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
102 } 199 }
103 200
104 if (is_win) { 201 if (is_win) {
105 libs = [ "strmiids.lib" ] 202 libs = [ "strmiids.lib" ]
106 } 203 }
107 204
108 deps = [ 205 deps = [
206 ":libjingle_peerconnection",
109 ":rtc_pc", 207 ":rtc_pc",
110 "../api:libjingle_peerconnection",
111 "../base:rtc_base_tests_utils", 208 "../base:rtc_base_tests_utils",
112 "../media:rtc_unittest_main", 209 "../media:rtc_unittest_main",
113 "../system_wrappers:metrics_default", 210 "../system_wrappers:metrics_default",
114 ] 211 ]
115 212
116 if (rtc_build_libsrtp) { 213 if (rtc_build_libsrtp) {
117 deps += [ "//third_party/libsrtp" ] 214 deps += [ "//third_party/libsrtp" ]
118 } 215 }
119 216
120 if (is_android) { 217 if (is_android) {
121 deps += [ "//testing/android/native_test:native_test_support" ] 218 deps += [ "//testing/android/native_test:native_test_support" ]
122 } 219 }
123 } 220 }
221
222 config("peerconnection_unittests_config") {
223 # The warnings below are enabled by default. Since GN orders compiler flags
224 # for a target before flags from configs, the only way to disable such
225 # warnings is by having them in a separate config, loaded from the target.
226 # TODO(kjellander): Make the code compile without disabling these flags.
227 # See https://bugs.webrtc.org/3307.
228 if (is_clang && is_win) {
229 cflags = [
230 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
231 # for -Wno-sign-compare
232 "-Wno-sign-compare",
233 "-Wno-unused-function",
234 ]
235 }
236
237 if (!is_win) {
238 cflags = [ "-Wno-sign-compare" ]
239 }
240 }
241
242 rtc_test("peerconnection_unittests") {
243 testonly = true
244 sources = [
245 "datachannel_unittest.cc",
246 "dtmfsender_unittest.cc",
247 "fakemediacontroller.h",
248 "jsepsessiondescription_unittest.cc",
249 "localaudiosource_unittest.cc",
250 "mediaconstraintsinterface_unittest.cc",
251 "mediastream_unittest.cc",
252 "peerconnection_unittest.cc",
253 "peerconnectionendtoend_unittest.cc",
254 "peerconnectionfactory_unittest.cc",
255 "peerconnectioninterface_unittest.cc",
256 "proxy_unittest.cc",
257 "rtcstatscollector_unittest.cc",
258 "rtpsenderreceiver_unittest.cc",
259 "sctputils_unittest.cc",
260 "statscollector_unittest.cc",
261 "test/fakeaudiocapturemodule.cc",
262 "test/fakeaudiocapturemodule.h",
263 "test/fakeaudiocapturemodule_unittest.cc",
264 "test/fakeconstraints.h",
265 "test/fakedatachannelprovider.h",
266 "test/fakeperiodicvideocapturer.h",
267 "test/fakertccertificategenerator.h",
268 "test/fakevideotrackrenderer.h",
269 "test/fakevideotracksource.h",
270 "test/mock_datachannel.h",
271 "test/mock_peerconnection.h",
272 "test/mock_webrtcsession.h",
273 "test/mockpeerconnectionobservers.h",
274 "test/peerconnectiontestwrapper.cc",
275 "test/peerconnectiontestwrapper.h",
276 "test/testsdpstrings.h",
277 "videocapturertracksource_unittest.cc",
278 "videotrack_unittest.cc",
279 "webrtcsdp_unittest.cc",
280 "webrtcsession_unittest.cc",
281 ]
282
283 defines = [ "HAVE_SCTP" ]
284
285 configs += [ ":peerconnection_unittests_config" ]
286
287 if (!build_with_chromium && is_clang) {
288 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
289 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
290 }
291
292 # TODO(jschuh): Bug 1348: fix this warning.
293 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
294
295 if (is_win) {
296 cflags = [
297 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
298 "/wd4389", # signed/unsigned mismatch.
299 ]
300 }
301
302 if (rtc_use_quic) {
303 public_deps = [
304 "//third_party/libquic",
305 ]
306 sources += [
307 "quicdatachannel_unittest.cc",
308 "quicdatatransport_unittest.cc",
309 ]
310 }
311
312 deps = []
313 if (is_android) {
314 sources += [
315 "test/androidtestinitializer.cc",
316 "test/androidtestinitializer.h",
317 ]
318 deps += [
319 "../api:libjingle_peerconnection_java",
320 "../api:libjingle_peerconnection_jni",
321 "//testing/android/native_test:native_test_support",
322 ]
323 }
324
325 deps += [
326 ":libjingle_peerconnection",
327 "..:webrtc_common",
328 "../base:rtc_base_tests_utils",
329 "../media:rtc_unittest_main",
330 "../pc:rtc_pc",
331 "../system_wrappers:metrics_default",
332 "//testing/gmock",
333 ]
334
335 if (is_android) {
336 deps += [ "//testing/android/native_test:native_test_support" ]
337
338 shard_timeout = 900
339 }
340 }
341
342 if (is_android) {
343 instrumentation_test_apk("libjingle_peerconnection_android_unittest") {
344 apk_name = "libjingle_peerconnection_android_unittest"
345 android_manifest = "androidtests/AndroidManifest.xml"
346
347 java_files = [
348 "androidtests/src/org/webrtc/Camera1CapturerUsingByteBufferTest.java",
349 "androidtests/src/org/webrtc/Camera1CapturerUsingTextureTest.java",
350 "androidtests/src/org/webrtc/Camera2CapturerTest.java",
351 "androidtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java",
352 "androidtests/src/org/webrtc/EglRendererTest.java",
353 "androidtests/src/org/webrtc/GlRectDrawerTest.java",
354 "androidtests/src/org/webrtc/MediaCodecVideoEncoderTest.java",
355 "androidtests/src/org/webrtc/NetworkMonitorTest.java",
356 "androidtests/src/org/webrtc/PeerConnectionTest.java",
357 "androidtests/src/org/webrtc/RendererCommonTest.java",
358 "androidtests/src/org/webrtc/SurfaceTextureHelperTest.java",
359 "androidtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java",
360 "androidtests/src/org/webrtc/WebRtcJniBootTest.java",
361 ]
362
363 deps = [
364 "../api:libjingle_peerconnection_java",
365 "../base:base_java",
366 "//base:base_java",
367 ]
368
369 shared_libraries = [ "../api:libjingle_peerconnection_so" ]
370 }
371 }
124 } 372 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698