OLD | NEW |
---|---|
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("../webrtc.gni") | 9 import("../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("pc") { | 15 group("pc") { |
16 public_deps = [ | 16 public_deps = [ |
17 ":rtc_pc", | 17 ":rtc_pc", |
18 ] | 18 ] |
19 } | 19 } |
20 | 20 |
21 config("rtc_pc_config") { | 21 config("rtc_pc_config") { |
22 defines = [] | 22 defines = [] |
23 if (rtc_enable_sctp) { | 23 if (rtc_enable_sctp) { |
24 defines += [ "HAVE_SCTP" ] | 24 defines += [ "HAVE_SCTP" ] |
25 } | 25 } |
26 } | 26 } |
27 | 27 |
28 rtc_static_library("rtc_pc") { | 28 rtc_static_library("rtc_pc_base") { |
29 defines = [] | 29 defines = [] |
30 sources = [ | 30 sources = [ |
31 "audiomonitor.cc", | 31 "audiomonitor.cc", |
32 "audiomonitor.h", | 32 "audiomonitor.h", |
33 "bundlefilter.cc", | 33 "bundlefilter.cc", |
34 "bundlefilter.h", | 34 "bundlefilter.h", |
35 "channel.cc", | 35 "channel.cc", |
36 "channel.h", | 36 "channel.h", |
37 "channelmanager.cc", | 37 "channelmanager.cc", |
38 "channelmanager.h", | 38 "channelmanager.h", |
(...skipping 13 matching lines...) Expand all Loading... | |
52 "srtpfilter.h", | 52 "srtpfilter.h", |
53 "voicechannel.h", | 53 "voicechannel.h", |
54 ] | 54 ] |
55 | 55 |
56 deps = [ | 56 deps = [ |
57 "..:webrtc_common", | 57 "..:webrtc_common", |
58 "../api:call_api", | 58 "../api:call_api", |
59 "../api:libjingle_peerconnection_api", | 59 "../api:libjingle_peerconnection_api", |
60 "../api:ortc_api", | 60 "../api:ortc_api", |
61 "../base:rtc_base", | 61 "../base:rtc_base", |
62 "../common_video:common_video", | 62 "../base:rtc_task_queue", |
63 "../media", | 63 "../media:rtc_data", |
64 "../media:rtc_media_base_data", | |
64 "../p2p:rtc_p2p", | 65 "../p2p:rtc_p2p", |
65 ] | 66 ] |
66 | 67 |
67 if (rtc_build_libsrtp) { | 68 if (rtc_build_libsrtp) { |
68 deps += [ "//third_party/libsrtp" ] | 69 deps += [ "//third_party/libsrtp" ] |
69 } | 70 } |
70 | 71 |
71 public_configs = [ ":rtc_pc_config" ] | 72 public_configs = [ ":rtc_pc_config" ] |
72 | 73 |
73 if (!build_with_chromium && is_clang) { | 74 if (!build_with_chromium && is_clang) { |
74 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 75 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
75 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 76 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
76 } | 77 } |
77 } | 78 } |
78 | 79 |
80 # TODO(zhihuang): Remove this once the downstream dependencies start using the | |
81 # modular targets. | |
82 rtc_source_set("rtc_pc") { | |
83 public_deps = [ | |
84 ":rtc_pc_base", | |
85 ] | |
86 | |
87 deps = [ | |
88 "../media:rtc_audio_video", | |
89 ] | |
90 } | |
91 | |
79 config("libjingle_peerconnection_warnings_config") { | 92 config("libjingle_peerconnection_warnings_config") { |
80 # GN orders flags on a target before flags from configs. The default config | 93 # GN orders flags on a target before flags from configs. The default config |
81 # adds these flags so to cancel them out they need to come from a config and | 94 # adds these flags so to cancel them out they need to come from a config and |
82 # cannot be on the target directly. | 95 # cannot be on the target directly. |
83 if (!is_win && !is_clang) { | 96 if (!is_win && !is_clang) { |
84 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC. | 97 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC. |
85 } | 98 } |
86 } | 99 } |
87 | 100 |
88 rtc_static_library("libjingle_peerconnection") { | 101 # This target contains the null implementation of the audio module and it is |
102 # used to build WebRTC without audio support. | |
103 rtc_static_library("pc_null_audio") { | |
the sun
2017/06/05 14:27:15
This is much better, but there's still a little to
Zhi Huang
2017/06/06 03:09:51
Sorry that I didn't understand your previous sugge
the sun
2017/06/06 19:30:33
The point I'd like us to get to is to *not* mainta
| |
104 sources = [ | |
105 "nullaudiofactory.cc", | |
106 ] | |
107 | |
108 if (!build_with_chromium && is_clang) { | |
109 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
110 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
111 } | |
112 | |
113 deps = [ | |
114 "../api:libjingle_peerconnection_api", | |
115 "../base:rtc_base", | |
116 "../base:rtc_base_approved", | |
117 ] | |
118 } | |
119 | |
120 # This target contains the real implementation of the audio module and it is | |
121 # used to build WebRTC with audio support. It should never be used with | |
122 # "pc_null_audio" at the same time and it should always be linked with the | |
123 # "pc_media". | |
124 rtc_static_library("pc_audio") { | |
125 sources = [ | |
126 "audiofactory.cc", | |
127 ] | |
128 | |
129 deps = [ | |
130 "../api:audio_mixer_api", | |
131 "../api:libjingle_peerconnection_api", | |
132 "../api/audio_codecs:audio_codecs_api", | |
133 "../api/audio_codecs:builtin_audio_decoder_factory", | |
134 "../api/audio_codecs:builtin_audio_encoder_factory", | |
135 "../base:rtc_base", | |
136 "../base:rtc_base_approved", | |
137 "../media:rtc_audio_video", | |
138 "../modules/audio_device:audio_device", | |
139 ] | |
140 | |
141 if (!build_with_chromium && is_clang) { | |
142 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
143 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
144 } | |
145 } | |
146 | |
147 # This target contains the null implementation of the audio/video related | |
148 # objects and it is used to build WebRTC without audio and video support. | |
149 rtc_source_set("pc_null_media") { | |
150 sources = [ | |
151 "nullmediafactory.cc", | |
152 ] | |
153 | |
154 if (!build_with_chromium && is_clang) { | |
155 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
156 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
157 } | |
158 | |
159 deps = [ | |
160 "../logging:rtc_event_log_api", | |
161 ] | |
162 } | |
163 | |
164 # This target contains the real implementation of the audio/video related | |
165 # objects and it is used to build WebRTC with audio and video support. | |
166 rtc_source_set("pc_media") { | |
167 deps = [ | |
168 "../call", | |
169 "../media:rtc_audio_video", | |
170 ] | |
171 | |
172 if (!build_with_chromium && is_clang) { | |
173 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
174 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
175 } | |
176 } | |
177 | |
178 # The modular build targets can be used to build WebRTC with different | |
179 # functionalities. The users can choose either the real implemenation | |
180 # or the null implementation of the audio/video modules based on their | |
181 # requirements. | |
182 # | |
183 # For example, to build WebRTC with datachannel support only, we would need the | |
184 # the peerconnection and the null implementation of the audio and video modules. | |
185 # | |
186 # rtc_source_set("datachannel_only") { | |
187 # deps = [ | |
188 # ":pc_null_audio", | |
189 # ":pc_null_media", | |
190 # ":peerconnection", | |
191 # ] | |
192 # } | |
193 # | |
194 # To build WebRTC with all the audio, video and datachannel support, we would | |
195 # need the peerconnection and the real implementation of the audio and video | |
196 # modules. | |
197 # | |
198 # rtc_source_set("full") { | |
199 # deps = [ | |
200 # ":pc_audio", | |
201 # ":pc_media", | |
202 # ":peerconnection", | |
203 # ] | |
204 # } | |
205 rtc_static_library("peerconnection") { | |
89 cflags = [] | 206 cflags = [] |
90 sources = [ | 207 sources = [ |
91 "audiotrack.cc", | 208 "audiotrack.cc", |
92 "audiotrack.h", | 209 "audiotrack.h", |
93 "datachannel.cc", | 210 "datachannel.cc", |
94 "datachannel.h", | 211 "datachannel.h", |
95 "dtmfsender.cc", | 212 "dtmfsender.cc", |
96 "dtmfsender.h", | 213 "dtmfsender.h", |
97 "iceserverparsing.cc", | 214 "iceserverparsing.cc", |
98 "iceserverparsing.h", | 215 "iceserverparsing.h", |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 ] | 256 ] |
140 | 257 |
141 configs += [ ":libjingle_peerconnection_warnings_config" ] | 258 configs += [ ":libjingle_peerconnection_warnings_config" ] |
142 | 259 |
143 if (!build_with_chromium && is_clang) { | 260 if (!build_with_chromium && is_clang) { |
144 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 261 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
145 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 262 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
146 } | 263 } |
147 | 264 |
148 deps = [ | 265 deps = [ |
149 ":rtc_pc", | 266 ":rtc_pc_base", |
150 "..:webrtc_common", | 267 "..:webrtc_common", |
151 "../api:call_api", | 268 "../api:call_api", |
152 "../api:rtc_stats_api", | 269 "../api:rtc_stats_api", |
153 "../api/audio_codecs:builtin_audio_decoder_factory", | |
154 "../api/audio_codecs:builtin_audio_encoder_factory", | |
155 "../api/video_codecs:video_codecs_api", | 270 "../api/video_codecs:video_codecs_api", |
156 "../base:rtc_base", | 271 "../base:rtc_base", |
157 "../base:rtc_base_approved", | 272 "../base:rtc_base_approved", |
158 "../call", | 273 "../call:call_interfaces", |
159 "../logging:rtc_event_log_api", | 274 "../logging:rtc_event_log_api", |
160 "../media", | 275 "../media:rtc_data", |
161 "../modules/audio_device:audio_device", | 276 "../media:rtc_media_base_data", |
162 "../p2p:rtc_p2p", | 277 "../p2p:rtc_p2p", |
163 "../stats", | 278 "../stats", |
164 "../system_wrappers:system_wrappers", | 279 "../system_wrappers:system_wrappers", |
165 ] | 280 ] |
166 | 281 |
167 public_deps = [ | 282 public_deps = [ |
168 "../api:libjingle_peerconnection_api", | 283 "../api:libjingle_peerconnection_api", |
169 ] | 284 ] |
285 } | |
286 | |
287 # TODO(zhihuang): Remove this once the downstream dependencies start using the | |
288 # modular targets. | |
289 rtc_source_set("libjingle_peerconnection") { | |
290 public_deps = [ | |
291 ":pc_audio", | |
292 ":pc_media", | |
293 ":peerconnection", | |
294 "../api:libjingle_peerconnection_api", | |
295 ] | |
170 | 296 |
171 if (rtc_use_quic) { | 297 if (rtc_use_quic) { |
172 sources += [ | 298 sources += [ |
173 "quicdatachannel.cc", | 299 "quicdatachannel.cc", |
174 "quicdatachannel.h", | 300 "quicdatachannel.h", |
175 "quicdatatransport.cc", | 301 "quicdatatransport.cc", |
176 "quicdatatransport.h", | 302 "quicdatatransport.h", |
177 ] | 303 ] |
178 deps += [ "//third_party/libquic" ] | 304 deps += [ "//third_party/libquic" ] |
179 public_deps = [ | 305 public_deps = [ |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 if (rtc_build_libsrtp) { | 363 if (rtc_build_libsrtp) { |
238 deps += [ "//third_party/libsrtp" ] | 364 deps += [ "//third_party/libsrtp" ] |
239 } | 365 } |
240 | 366 |
241 if (is_android) { | 367 if (is_android) { |
242 deps += [ "//testing/android/native_test:native_test_support" ] | 368 deps += [ "//testing/android/native_test:native_test_support" ] |
243 } | 369 } |
244 } | 370 } |
245 | 371 |
246 rtc_source_set("pc_test_utils") { | 372 rtc_source_set("pc_test_utils") { |
373 # Cannot have GN check enabled because this target would also be used in the | |
374 # "peerconnection_datachannelonly_unittests" and we don't want to depend on | |
375 # the target "media:rtc_media_tests_utils" indrectly since it contains all | |
376 # the audio and video related classes. | |
377 # TODO(zhihuang): Enable the check once the "media:rtc_media_tests_utils" is | |
378 # broken down to modular sub-targets. | |
379 check_includes = false | |
247 testonly = true | 380 testonly = true |
248 sources = [ | 381 sources = [ |
249 "test/fakeaudiocapturemodule.cc", | 382 "test/fakeaudiocapturemodule.cc", |
250 "test/fakeaudiocapturemodule.h", | 383 "test/fakeaudiocapturemodule.h", |
251 "test/fakedatachannelprovider.h", | 384 "test/fakedatachannelprovider.h", |
252 "test/fakeperiodicvideocapturer.h", | 385 "test/fakeperiodicvideocapturer.h", |
253 "test/fakertccertificategenerator.h", | 386 "test/fakertccertificategenerator.h", |
254 "test/fakevideotrackrenderer.h", | 387 "test/fakevideotrackrenderer.h", |
255 "test/fakevideotracksource.h", | 388 "test/fakevideotracksource.h", |
256 "test/mock_datachannel.h", | 389 "test/mock_datachannel.h", |
257 "test/mock_peerconnection.h", | 390 "test/mock_peerconnection.h", |
258 "test/mock_webrtcsession.h", | 391 "test/mock_webrtcsession.h", |
259 "test/mockpeerconnectionobservers.h", | 392 "test/mockpeerconnectionobservers.h", |
260 "test/peerconnectiontestwrapper.cc", | 393 "test/peerconnectiontestwrapper.cc", |
261 "test/peerconnectiontestwrapper.h", | 394 "test/peerconnectiontestwrapper.h", |
262 "test/rtcstatsobtainer.h", | 395 "test/rtcstatsobtainer.h", |
263 "test/testsdpstrings.h", | 396 "test/testsdpstrings.h", |
264 ] | 397 ] |
265 | 398 |
266 deps = [ | 399 deps = [ |
267 ":libjingle_peerconnection", | 400 ":peerconnection", |
268 "..:webrtc_common", | 401 "..:webrtc_common", |
269 "../api:libjingle_peerconnection_test_api", | 402 "../api:libjingle_peerconnection_test_api", |
270 "../api:rtc_stats_api", | 403 "../api:rtc_stats_api", |
271 "../base:rtc_base", | 404 "../base:rtc_base", |
272 "../base:rtc_base_approved", | 405 "../base:rtc_base_approved", |
273 "../base:rtc_base_tests_utils", | 406 "../base:rtc_base_tests_utils", |
274 "../media:rtc_media", | |
275 "../media:rtc_media_tests_utils", | |
276 "../modules/audio_device:audio_device", | 407 "../modules/audio_device:audio_device", |
277 "../p2p:p2p_test_utils", | 408 "../p2p:p2p_test_utils", |
278 "../test:test_support", | 409 "../test:test_support", |
279 "//testing/gmock", | 410 "//testing/gmock", |
280 ] | 411 ] |
281 | 412 |
282 if (!build_with_chromium && is_clang) { | 413 if (!build_with_chromium && is_clang) { |
283 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 414 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
284 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 415 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
285 } | 416 } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
391 "../system_wrappers:metrics_default", | 522 "../system_wrappers:metrics_default", |
392 "//testing/gmock", | 523 "//testing/gmock", |
393 ] | 524 ] |
394 | 525 |
395 if (is_android) { | 526 if (is_android) { |
396 deps += [ "//testing/android/native_test:native_test_support" ] | 527 deps += [ "//testing/android/native_test:native_test_support" ] |
397 | 528 |
398 shard_timeout = 900 | 529 shard_timeout = 900 |
399 } | 530 } |
400 } | 531 } |
532 | |
533 rtc_test("peerconnection_datachannelonly_unittests") { | |
534 check_includes = false # TODO(zhihuang): Remove (bugs.webrtc.org/6828) | |
535 testonly = true | |
536 sources = [ | |
537 "peerconnection_datachannelonly_unittest.cc", | |
538 ] | |
539 | |
540 configs += [ ":peerconnection_unittests_config" ] | |
541 | |
542 if (!build_with_chromium && is_clang) { | |
543 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
544 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
545 } | |
546 | |
547 # TODO(jschuh): Bug 1348: fix this warning. | |
548 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | |
549 | |
550 if (is_win) { | |
551 cflags = [ | |
552 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch. | |
553 "/wd4389", # signed/unsigned mismatch. | |
554 ] | |
555 } | |
556 | |
557 deps = [] | |
558 if (is_android) { | |
559 sources += [ | |
560 "test/androidtestinitializer.cc", | |
561 "test/androidtestinitializer.h", | |
562 ] | |
563 deps += [ | |
564 "//testing/android/native_test:native_test_support", | |
565 "//webrtc/sdk/android:base_jni", | |
566 "//webrtc/sdk/android:libjingle_peerconnection_java", | |
567 "//webrtc/sdk/android:null_audio_jni", | |
568 "//webrtc/sdk/android:null_video_jni", | |
569 ] | |
570 } | |
571 | |
572 deps += [ | |
573 ":pc_null_audio", | |
574 ":pc_null_media", | |
575 ":pc_test_utils", | |
576 ":peerconnection", | |
577 "..:webrtc_common", | |
578 "../api:fakemetricsobserver", | |
579 "../base:rtc_base_approved", | |
580 "../base:rtc_base_tests_main", | |
581 "../base:rtc_base_tests_utils", | |
582 "../modules/utility", | |
583 "../pc:rtc_pc_base", | |
584 "../system_wrappers:metrics_default", | |
585 "//testing/gmock", | |
586 ] | |
587 | |
588 if (is_android) { | |
589 deps += [ "//testing/android/native_test:native_test_support" ] | |
590 shard_timeout = 900 | |
591 } | |
592 } | |
401 } | 593 } |
OLD | NEW |