OLD | NEW |
---|---|
1 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2015 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) { | 10 if (is_android) { |
11 import("//build/config/android/config.gni") | 11 import("//build/config/android/config.gni") |
12 import("//build/config/android/rules.gni") | 12 import("//build/config/android/rules.gni") |
13 } | 13 } |
14 | 14 |
15 group("api") { | 15 group("api") { |
16 public_deps = [ | 16 public_deps = [ |
17 ":libjingle_peerconnection", | 17 ":libjingle_peerconnection_api", |
18 ] | 18 ] |
19 if (is_android && !build_with_chromium) { | 19 if (is_android && !build_with_chromium) { |
20 public_deps += [ | 20 public_deps += [ |
21 ":libjingle_peerconnection_java", | 21 ":libjingle_peerconnection_java", |
22 ":libjingle_peerconnection_so", | 22 ":libjingle_peerconnection_so", |
23 ] | 23 ] |
24 } | 24 } |
25 } | 25 } |
26 | 26 |
27 rtc_source_set("call_api") { | 27 rtc_source_set("call_api") { |
28 sources = [ | 28 sources = [ |
29 "call/audio_receive_stream.h", | 29 "call/audio_receive_stream.h", |
30 "call/audio_send_stream.cc", | 30 "call/audio_send_stream.cc", |
31 "call/audio_send_stream.h", | 31 "call/audio_send_stream.h", |
32 "call/audio_sink.h", | 32 "call/audio_sink.h", |
33 "call/audio_state.h", | 33 "call/audio_state.h", |
34 "call/flexfec_receive_stream.h", | 34 "call/flexfec_receive_stream.h", |
35 ] | 35 ] |
36 | 36 |
37 deps = [ | 37 deps = [ |
38 # TODO(kjellander): Add remaining dependencies when webrtc:4243 is done. | 38 # TODO(kjellander): Add remaining dependencies when webrtc:4243 is done. |
39 ":audio_mixer_api", | 39 ":audio_mixer_api", |
40 "..:webrtc_common", | 40 "..:webrtc_common", |
41 "../base:rtc_base_approved", | 41 "../base:rtc_base_approved", |
42 "../modules/audio_coding:audio_encoder_interface", | 42 "../modules/audio_coding:audio_encoder_interface", |
43 ] | 43 ] |
44 } | 44 } |
45 | 45 |
46 config("libjingle_peerconnection_warnings_config") { | 46 rtc_static_library("libjingle_peerconnection_api") { |
Taylor Brandstetter
2016/12/02 04:15:29
Do we need to keep around an api:libjingle_peercon
ossu
2016/12/08 19:16:39
Yes, you're right! I've added this back in just de
| |
47 # GN orders flags on a target before flags from configs. The default config | |
48 # adds these flags so to cancel them out they need to come from a config and | |
49 # cannot be on the target directly. | |
50 if (!is_win && !is_clang) { | |
51 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC. | |
52 } | |
53 } | |
54 | |
55 rtc_static_library("libjingle_peerconnection") { | |
56 cflags = [] | 47 cflags = [] |
57 sources = [ | 48 sources = [ |
58 "audiotrack.cc", | |
59 "audiotrack.h", | |
60 "datachannel.cc", | |
61 "datachannel.h", | |
62 "datachannelinterface.h", | 49 "datachannelinterface.h", |
63 "dtmfsender.cc", | |
64 "dtmfsender.h", | |
65 "dtmfsenderinterface.h", | 50 "dtmfsenderinterface.h", |
51 "fakemetricsobserver.cc", | |
52 "fakemetricsobserver.h", | |
Taylor Brandstetter
2016/12/02 04:15:29
Does this need to be in the API target?
ossu
2016/12/08 19:16:39
I'm not sure. Having mocks and possibly fakes for
Taylor Brandstetter
2016/12/08 20:14:35
Ah yes, I forgot about that. Though ideally it sho
| |
66 "jsep.h", | 53 "jsep.h", |
67 "jsepicecandidate.cc", | |
68 "jsepicecandidate.h", | |
69 "jsepsessiondescription.cc", | |
70 "jsepsessiondescription.h", | |
71 "localaudiosource.cc", | |
72 "localaudiosource.h", | |
73 "mediaconstraintsinterface.cc", | 54 "mediaconstraintsinterface.cc", |
74 "mediaconstraintsinterface.h", | 55 "mediaconstraintsinterface.h", |
75 "mediacontroller.cc", | |
76 "mediacontroller.h", | |
77 "mediastream.cc", | |
78 "mediastream.h", | |
79 "mediastreaminterface.h", | 56 "mediastreaminterface.h", |
80 "mediastreamobserver.cc", | |
81 "mediastreamobserver.h", | |
82 "mediastreamproxy.h", | 57 "mediastreamproxy.h", |
83 "mediastreamtrack.h", | |
84 "mediastreamtrackproxy.h", | 58 "mediastreamtrackproxy.h", |
59 "mediatypes.cc", | |
60 "mediatypes.h", | |
85 "notifier.h", | 61 "notifier.h", |
86 "peerconnection.cc", | |
87 "peerconnection.h", | |
88 "peerconnectionfactory.cc", | |
89 "peerconnectionfactory.h", | |
90 "peerconnectionfactoryproxy.h", | 62 "peerconnectionfactoryproxy.h", |
91 "peerconnectioninterface.h", | 63 "peerconnectioninterface.h", |
92 "peerconnectionproxy.h", | 64 "peerconnectionproxy.h", |
93 "proxy.h", | 65 "proxy.h", |
94 "remoteaudiosource.cc", | |
95 "remoteaudiosource.h", | |
96 "rtcstatscollector.cc", | |
97 "rtcstatscollector.h", | |
98 "rtpparameters.h", | 66 "rtpparameters.h", |
99 "rtpreceiver.cc", | |
100 "rtpreceiver.h", | |
101 "rtpreceiverinterface.h", | 67 "rtpreceiverinterface.h", |
102 "rtpsender.cc", | |
103 "rtpsender.h", | |
104 "rtpsenderinterface.h", | 68 "rtpsenderinterface.h", |
105 "sctputils.cc", | |
106 "sctputils.h", | |
107 "statscollector.cc", | |
108 "statscollector.h", | |
109 "statstypes.cc", | 69 "statstypes.cc", |
110 "statstypes.h", | 70 "statstypes.h", |
111 "streamcollection.h", | 71 "umametrics.h", |
112 "videocapturertracksource.cc", | |
113 "videocapturertracksource.h", | |
114 "videosourceproxy.h", | 72 "videosourceproxy.h", |
115 "videotrack.cc", | |
116 "videotrack.h", | |
117 "videotracksource.cc", | |
118 "videotracksource.h", | |
119 "webrtcsdp.cc", | |
120 "webrtcsdp.h", | |
121 "webrtcsession.cc", | |
122 "webrtcsession.h", | |
123 "webrtcsessiondescriptionfactory.cc", | |
124 "webrtcsessiondescriptionfactory.h", | |
125 ] | 73 ] |
126 | 74 |
127 configs += [ ":libjingle_peerconnection_warnings_config" ] | |
128 | |
129 if (!build_with_chromium && is_clang) { | 75 if (!build_with_chromium && is_clang) { |
130 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 76 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
131 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 77 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
132 } | 78 } |
133 | 79 |
134 deps = [ | 80 deps = [ |
135 ":call_api", | |
136 ":rtc_stats_api", | 81 ":rtc_stats_api", |
137 "../call", | |
138 "../media", | |
139 "../pc", | |
140 "../stats", | |
141 ] | 82 ] |
142 | |
143 if (rtc_use_quic) { | |
144 sources += [ | |
145 "quicdatachannel.cc", | |
146 "quicdatachannel.h", | |
147 "quicdatatransport.cc", | |
148 "quicdatatransport.h", | |
149 ] | |
150 deps += [ "//third_party/libquic" ] | |
151 public_deps = [ | |
152 "//third_party/libquic", | |
153 ] | |
154 } | |
155 } | 83 } |
156 | 84 |
157 # Exclude the targets below from the Chromium build since they cannot be built | 85 # Exclude the targets below from the Chromium build since they cannot be built |
158 # due to incompability with Chromium's logging implementation. | 86 # due to incompability with Chromium's logging implementation. |
159 if (is_android && !build_with_chromium) { | 87 if (is_android && !build_with_chromium) { |
160 config("libjingle_peerconnection_jni_warnings_config") { | 88 config("libjingle_peerconnection_jni_warnings_config") { |
161 # The warnings below are enabled by default. Since GN orders compiler flags | 89 # The warnings below are enabled by default. Since GN orders compiler flags |
162 # for a target before flags from configs, the only way to disable such | 90 # for a target before flags from configs, the only way to disable such |
163 # warnings is by having them in a separate config, loaded from the target. | 91 # warnings is by having them in a separate config, loaded from the target. |
164 if (!is_win) { | 92 if (!is_win) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | 135 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
208 | 136 |
209 if (is_win) { | 137 if (is_win) { |
210 cflags += [ | 138 cflags += [ |
211 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatc h. | 139 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatc h. |
212 "/wd4389", # signed/unsigned mismatch. | 140 "/wd4389", # signed/unsigned mismatch. |
213 ] | 141 ] |
214 } | 142 } |
215 | 143 |
216 deps = [ | 144 deps = [ |
217 ":libjingle_peerconnection", | 145 "../pc:libjingle_peerconnection", |
218 "../system_wrappers:field_trial_default", | 146 "../system_wrappers:field_trial_default", |
219 "../system_wrappers:metrics_default", | 147 "../system_wrappers:metrics_default", |
220 ] | 148 ] |
221 | 149 |
222 if (rtc_build_libyuv) { | 150 if (rtc_build_libyuv) { |
223 deps += [ "$rtc_libyuv_dir" ] | 151 deps += [ "$rtc_libyuv_dir" ] |
224 public_deps = [ | 152 public_deps = [ |
225 "$rtc_libyuv_dir", | 153 "$rtc_libyuv_dir", |
226 ] | 154 ] |
227 } else { | 155 } else { |
228 # Need to add a directory normally exported by libyuv. | 156 # Need to add a directory normally exported by libyuv. |
229 include_dirs = [ "$rtc_libyuv_dir/include" ] | 157 include_dirs = [ "$rtc_libyuv_dir/include" ] |
230 } | 158 } |
231 } | 159 } |
232 | 160 |
233 rtc_shared_library("libjingle_peerconnection_so") { | 161 rtc_shared_library("libjingle_peerconnection_so") { |
234 sources = [ | 162 sources = [ |
235 "android/jni/jni_onload.cc", | 163 "android/jni/jni_onload.cc", |
236 ] | 164 ] |
237 | 165 |
238 suppressed_configs += [ "//build/config/android:hide_native_jni_exports" ] | 166 suppressed_configs += [ "//build/config/android:hide_native_jni_exports" ] |
239 | 167 |
240 deps = [ | 168 deps = [ |
241 ":libjingle_peerconnection", | |
242 ":libjingle_peerconnection_jni", | 169 ":libjingle_peerconnection_jni", |
170 "../pc:libjingle_peerconnection", | |
243 ] | 171 ] |
244 output_extension = "so" | 172 output_extension = "so" |
245 } | 173 } |
246 } | 174 } |
247 | 175 |
248 # Classes that don't require jni can be used in Chromium. | 176 # Classes that don't require jni can be used in Chromium. |
249 if (is_android) { | 177 if (is_android) { |
250 android_library("libjingle_peerconnection_java") { | 178 android_library("libjingle_peerconnection_java") { |
251 java_files = [ | 179 java_files = [ |
252 "../modules/audio_device/android/java/src/org/webrtc/voiceengine/BuildInfo .java", | 180 "../modules/audio_device/android/java/src/org/webrtc/voiceengine/BuildInfo .java", |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
316 "../base:base_java", | 244 "../base:base_java", |
317 ] | 245 ] |
318 } | 246 } |
319 } | 247 } |
320 | 248 |
321 rtc_source_set("rtc_stats_api") { | 249 rtc_source_set("rtc_stats_api") { |
322 cflags = [] | 250 cflags = [] |
323 sources = [ | 251 sources = [ |
324 "stats/rtcstats.h", | 252 "stats/rtcstats.h", |
325 "stats/rtcstats_objects.h", | 253 "stats/rtcstats_objects.h", |
254 "stats/rtcstatscollectorcallback.h", | |
326 "stats/rtcstatsreport.h", | 255 "stats/rtcstatsreport.h", |
327 ] | 256 ] |
328 | 257 |
329 deps = [ | 258 deps = [ |
330 "../base:rtc_base_approved", | 259 "../base:rtc_base_approved", |
331 ] | 260 ] |
332 } | 261 } |
333 | 262 |
334 rtc_source_set("audio_mixer_api") { | 263 rtc_source_set("audio_mixer_api") { |
335 sources = [ | 264 sources = [ |
336 "audio/audio_mixer.h", | 265 "audio/audio_mixer.h", |
337 ] | 266 ] |
338 | 267 |
339 deps = [ | 268 deps = [ |
340 "../base:rtc_base_approved", | 269 "../base:rtc_base_approved", |
341 ] | 270 ] |
342 } | 271 } |
343 | 272 |
344 if (rtc_include_tests) { | 273 if (rtc_include_tests) { |
345 config("peerconnection_unittests_config") { | |
346 # The warnings below are enabled by default. Since GN orders compiler flags | |
347 # for a target before flags from configs, the only way to disable such | |
348 # warnings is by having them in a separate config, loaded from the target. | |
349 # TODO(kjellander): Make the code compile without disabling these flags. | |
350 # See https://bugs.webrtc.org/3307. | |
351 if (is_clang && is_win) { | |
352 cflags = [ | |
353 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267 | |
354 # for -Wno-sign-compare | |
355 "-Wno-sign-compare", | |
356 "-Wno-unused-function", | |
357 ] | |
358 } | |
359 | |
360 if (!is_win) { | |
361 cflags = [ "-Wno-sign-compare" ] | |
362 } | |
363 } | |
364 | |
365 rtc_test("peerconnection_unittests") { | |
366 testonly = true | |
367 sources = [ | |
368 "datachannel_unittest.cc", | |
369 "dtmfsender_unittest.cc", | |
370 "fakemetricsobserver.cc", | |
371 "fakemetricsobserver.h", | |
372 "jsepsessiondescription_unittest.cc", | |
373 "localaudiosource_unittest.cc", | |
374 "mediaconstraintsinterface_unittest.cc", | |
375 "mediastream_unittest.cc", | |
376 "peerconnection_unittest.cc", | |
377 "peerconnectionendtoend_unittest.cc", | |
378 "peerconnectionfactory_unittest.cc", | |
379 "peerconnectioninterface_unittest.cc", | |
380 "proxy_unittest.cc", | |
381 "rtcstatscollector_unittest.cc", | |
382 "rtpsenderreceiver_unittest.cc", | |
383 "sctputils_unittest.cc", | |
384 "statscollector_unittest.cc", | |
385 "test/fakeaudiocapturemodule.cc", | |
386 "test/fakeaudiocapturemodule.h", | |
387 "test/fakeaudiocapturemodule_unittest.cc", | |
388 "test/fakeconstraints.h", | |
389 "test/fakedatachannelprovider.h", | |
390 "test/fakeperiodicvideocapturer.h", | |
391 "test/fakertccertificategenerator.h", | |
392 "test/fakevideotrackrenderer.h", | |
393 "test/mock_datachannel.h", | |
394 "test/mock_peerconnection.h", | |
395 "test/mock_webrtcsession.h", | |
396 "test/mockpeerconnectionobservers.h", | |
397 "test/peerconnectiontestwrapper.cc", | |
398 "test/peerconnectiontestwrapper.h", | |
399 "test/testsdpstrings.h", | |
400 "videocapturertracksource_unittest.cc", | |
401 "videotrack_unittest.cc", | |
402 "webrtcsdp_unittest.cc", | |
403 "webrtcsession_unittest.cc", | |
404 ] | |
405 | |
406 defines = [ "HAVE_SCTP" ] | |
407 | |
408 configs += [ ":peerconnection_unittests_config" ] | |
409 | |
410 if (!build_with_chromium && is_clang) { | |
411 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
412 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
413 } | |
414 | |
415 # TODO(jschuh): Bug 1348: fix this warning. | |
416 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | |
417 | |
418 if (is_win) { | |
419 cflags = [ | |
420 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch. | |
421 "/wd4389", # signed/unsigned mismatch. | |
422 ] | |
423 } | |
424 | |
425 if (rtc_use_quic) { | |
426 public_deps = [ | |
427 "//third_party/libquic", | |
428 ] | |
429 sources += [ | |
430 "quicdatachannel_unittest.cc", | |
431 "quicdatatransport_unittest.cc", | |
432 ] | |
433 } | |
434 | |
435 deps = [] | |
436 if (is_android) { | |
437 sources += [ | |
438 "test/androidtestinitializer.cc", | |
439 "test/androidtestinitializer.h", | |
440 ] | |
441 deps += [ | |
442 ":libjingle_peerconnection_java", | |
443 ":libjingle_peerconnection_jni", | |
444 "//testing/android/native_test:native_test_support", | |
445 ] | |
446 } | |
447 | |
448 deps += [ | |
449 ":libjingle_peerconnection", | |
450 "..:webrtc_common", | |
451 "../base:rtc_base_tests_utils", | |
452 "../media:rtc_unittest_main", | |
453 "../pc:rtc_pc", | |
454 "../system_wrappers:metrics_default", | |
455 "//testing/gmock", | |
456 ] | |
457 | |
458 if (is_android) { | |
459 deps += [ "//testing/android/native_test:native_test_support" ] | |
460 | |
461 shard_timeout = 900 | |
462 } | |
463 } | |
464 | |
465 if (is_android) { | |
466 instrumentation_test_apk("libjingle_peerconnection_android_unittest") { | |
467 apk_name = "libjingle_peerconnection_android_unittest" | |
468 android_manifest = "androidtests/AndroidManifest.xml" | |
469 | |
470 java_files = [ | |
471 "androidtests/src/org/webrtc/Camera1CapturerUsingByteBufferTest.java", | |
472 "androidtests/src/org/webrtc/Camera1CapturerUsingTextureTest.java", | |
473 "androidtests/src/org/webrtc/Camera2CapturerTest.java", | |
474 "androidtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java", | |
475 "androidtests/src/org/webrtc/EglRendererTest.java", | |
476 "androidtests/src/org/webrtc/GlRectDrawerTest.java", | |
477 "androidtests/src/org/webrtc/MediaCodecVideoEncoderTest.java", | |
478 "androidtests/src/org/webrtc/NetworkMonitorTest.java", | |
479 "androidtests/src/org/webrtc/PeerConnectionTest.java", | |
480 "androidtests/src/org/webrtc/RendererCommonTest.java", | |
481 "androidtests/src/org/webrtc/SurfaceTextureHelperTest.java", | |
482 "androidtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java", | |
483 "androidtests/src/org/webrtc/WebRtcJniBootTest.java", | |
484 ] | |
485 | |
486 deps = [ | |
487 ":libjingle_peerconnection_java", | |
488 "../base:base_java", | |
489 "//base:base_java", | |
490 ] | |
491 | |
492 shared_libraries = [ ":libjingle_peerconnection_so" ] | |
493 } | |
494 } | |
495 } | 274 } |
OLD | NEW |