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

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

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: Replace the rtc_ prefix with webrtc_ to avoid naming conflict. Created 3 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
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("../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 10 matching lines...) Expand all
49 "rtptransport.cc", 49 "rtptransport.cc",
50 "rtptransport.h", 50 "rtptransport.h",
51 "srtpfilter.cc", 51 "srtpfilter.cc",
52 "srtpfilter.h", 52 "srtpfilter.h",
53 "voicechannel.h", 53 "voicechannel.h",
54 ] 54 ]
55 55
56 deps = [ 56 deps = [
57 "../api:call_api", 57 "../api:call_api",
58 "../base:rtc_base", 58 "../base:rtc_base",
59 "../media", 59 "../base:rtc_task_queue",
60 "../media:rtc_data",
60 ] 61 ]
61 62
62 if (rtc_build_libsrtp) { 63 if (rtc_build_libsrtp) {
63 deps += [ "//third_party/libsrtp" ] 64 deps += [ "//third_party/libsrtp" ]
64 } 65 }
65 66
66 public_configs = [ ":rtc_pc_config" ] 67 public_configs = [ ":rtc_pc_config" ]
67 68
68 if (!build_with_chromium && is_clang) { 69 if (!build_with_chromium && is_clang) {
69 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). 70 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
70 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] 71 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
71 } 72 }
72 } 73 }
73 74
75 # TODO(zhihuang): Remove this once the downstream dependencies start using the
76 # modular targets.
77 rtc_source_set("rtc_pc") {
78 public_deps = [
79 ":rtc_pc_base",
80 ]
81
82 deps = [
83 "../media:rtc_audio_video",
84 ]
85 }
86
74 config("libjingle_peerconnection_warnings_config") { 87 config("libjingle_peerconnection_warnings_config") {
75 # GN orders flags on a target before flags from configs. The default config 88 # GN orders flags on a target before flags from configs. The default config
76 # adds these flags so to cancel them out they need to come from a config and 89 # adds these flags so to cancel them out they need to come from a config and
77 # cannot be on the target directly. 90 # cannot be on the target directly.
78 if (!is_win && !is_clang) { 91 if (!is_win && !is_clang) {
79 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC. 92 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
80 } 93 }
81 } 94 }
82 95
83 rtc_static_library("libjingle_peerconnection") { 96 # This target contains the null implementation of the audio module and it is
97 # used to build WebRTC without audio support.
98 rtc_static_library("webrtc_null_audio") {
99 sources = [
100 "nullaudiofactory.cc",
101 ]
102
103 if (!build_with_chromium && is_clang) {
104 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
105 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
106 }
107 }
108
109 # This target contains the real implementation of the audio module and it is
110 # used to build WebRTC with audio support. It should never be used with
111 # "webrtc_null_audio" at the same time and it should always be linked with the
112 # "webrtc_media".
113 rtc_static_library("webrtc_audio") {
114 sources = [
115 "audiofactory.cc",
116 ]
117
118 public_deps = [
119 "../media:rtc_audio_video",
120 ]
121
122 if (!build_with_chromium && is_clang) {
123 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
124 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
125 }
126 }
127
128 # This target contains the null implementation of the audio/video related
129 # objects and it is used to build WebRTC without audio and video support.
130 rtc_source_set("webrtc_null_media") {
131 sources = [
132 "nullmediafactory.cc",
133 ]
134
135 if (!build_with_chromium && is_clang) {
136 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
137 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
138 }
139 }
140
141 # This target contains the real implementation of the audio/video related
142 # objects and it is used to build WebRTC with audio and video support.
143 rtc_source_set("webrtc_media") {
kjellander_webrtc 2017/06/01 05:34:30 Can we call this pc_media instead?
Zhi Huang 2017/06/02 05:16:43 SGTM.
144 deps = [
145 "../call",
146 "../media:rtc_audio_video",
147 ]
148
149 if (!build_with_chromium && is_clang) {
150 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
151 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
152 }
153 }
154
155 # The modular build targets can be used to build WebRTC with different
156 # functionalities. The users can choose either the real implemenation
157 # or the null implementation of the audio/video modules based on their
158 # requirments.
kjellander_webrtc 2017/06/01 05:34:30 requirements.
Zhi Huang 2017/06/02 05:16:43 Done.
159 #
160 # For example, to build WebRTC with datachannel support only, we would need the
161 # the peerconnection and the null implementation of the audio and video modules.
162 #
163 # rtc_source_set("webrtc_datachannel_only") {
164 # deps = [
165 # ":webrtc_null_audio",
166 # ":webrtc_null_media",
167 # ":webrtc_peerconnection",
168 # ]
169 # }
170 #
171 # To build WebRTC with all the audio, video and datachannel support, we would
172 # need the peerconnection and the real implementation of the audio and video
173 # modules.
174 #
175 # rtc_source_set("webrtc_full") {
176 # deps = [
177 # ":webrtc_audio",
178 # ":webrtc_media",
179 # ":webrtc_peerconnection",
180 # ]
181 # }
182 rtc_static_library("webrtc_peerconnection") {
84 cflags = [] 183 cflags = []
85 sources = [ 184 sources = [
86 "audiotrack.cc", 185 "audiotrack.cc",
87 "audiotrack.h", 186 "audiotrack.h",
88 "datachannel.cc", 187 "datachannel.cc",
89 "datachannel.h", 188 "datachannel.h",
90 "dtmfsender.cc", 189 "dtmfsender.cc",
91 "dtmfsender.h", 190 "dtmfsender.h",
92 "iceserverparsing.cc", 191 "iceserverparsing.cc",
93 "iceserverparsing.h", 192 "iceserverparsing.h",
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 ] 233 ]
135 234
136 configs += [ ":libjingle_peerconnection_warnings_config" ] 235 configs += [ ":libjingle_peerconnection_warnings_config" ]
137 236
138 if (!build_with_chromium && is_clang) { 237 if (!build_with_chromium && is_clang) {
139 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). 238 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
140 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] 239 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
141 } 240 }
142 241
143 deps = [ 242 deps = [
144 ":rtc_pc", 243 ":rtc_pc_base",
145 "../api:call_api", 244 "../api:call_api",
146 "../api:rtc_stats_api", 245 "../api:rtc_stats_api",
147 "../api/video_codecs:video_codecs_api", 246 "../api/video_codecs:video_codecs_api",
148 "../call", 247 "../logging:rtc_event_log_api",
149 "../media",
150 "../stats", 248 "../stats",
151 ] 249 ]
152 250
153 public_deps = [ 251 public_deps = [
154 "../api:libjingle_peerconnection_api", 252 "../api:libjingle_peerconnection_api",
155 ] 253 ]
254 }
255
256 # TODO(zhihuang): Remove this once the downstream dependencies start using the
257 # modular targets.
258 rtc_source_set("libjingle_peerconnection") {
259 public_deps = [
260 ":webrtc_audio",
261 ":webrtc_media",
262 ":webrtc_peerconnection",
263 "../api:libjingle_peerconnection_api",
264 ]
156 265
157 if (rtc_use_quic) { 266 if (rtc_use_quic) {
158 sources += [ 267 sources += [
159 "quicdatachannel.cc", 268 "quicdatachannel.cc",
160 "quicdatachannel.h", 269 "quicdatachannel.h",
161 "quicdatatransport.cc", 270 "quicdatatransport.cc",
162 "quicdatatransport.h", 271 "quicdatatransport.h",
163 ] 272 ]
164 deps += [ "//third_party/libquic" ] 273 deps += [ "//third_party/libquic" ]
165 public_deps = [ 274 public_deps = [
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 "test/mock_peerconnection.h", 346 "test/mock_peerconnection.h",
238 "test/mock_webrtcsession.h", 347 "test/mock_webrtcsession.h",
239 "test/mockpeerconnectionobservers.h", 348 "test/mockpeerconnectionobservers.h",
240 "test/peerconnectiontestwrapper.cc", 349 "test/peerconnectiontestwrapper.cc",
241 "test/peerconnectiontestwrapper.h", 350 "test/peerconnectiontestwrapper.h",
242 "test/rtcstatsobtainer.h", 351 "test/rtcstatsobtainer.h",
243 "test/testsdpstrings.h", 352 "test/testsdpstrings.h",
244 ] 353 ]
245 354
246 deps = [ 355 deps = [
247 ":libjingle_peerconnection",
248 "../base:rtc_base_tests_utils", 356 "../base:rtc_base_tests_utils",
249 "//testing/gmock", 357 "//testing/gmock",
250 ] 358 ]
251 359
252 if (!build_with_chromium && is_clang) { 360 if (!build_with_chromium && is_clang) {
253 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). 361 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
254 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] 362 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
255 } 363 }
256 } 364 }
257 365
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 "../system_wrappers:metrics_default", 469 "../system_wrappers:metrics_default",
362 "//testing/gmock", 470 "//testing/gmock",
363 ] 471 ]
364 472
365 if (is_android) { 473 if (is_android) {
366 deps += [ "//testing/android/native_test:native_test_support" ] 474 deps += [ "//testing/android/native_test:native_test_support" ]
367 475
368 shard_timeout = 900 476 shard_timeout = 900
369 } 477 }
370 } 478 }
479
480 rtc_test("peerconnection_datachannelonly_unittests") {
481 testonly = true
482 sources = [
483 "peerconnection_datachannelonly_unittest.cc",
484 ]
485
486 defines = [ "HAVE_SCTP" ]
kjellander_webrtc 2017/06/01 05:34:30 You shouldn't need to define this since you depend
Zhi Huang 2017/06/02 05:16:43 Done.
487
488 configs += [ ":peerconnection_unittests_config" ]
489
490 if (!build_with_chromium && is_clang) {
491 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
492 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
493 }
494
495 # TODO(jschuh): Bug 1348: fix this warning.
496 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
497
498 if (is_win) {
499 cflags = [
500 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
501 "/wd4389", # signed/unsigned mismatch.
502 ]
503 }
504
505 deps = []
506 if (is_android) {
507 sources += [
508 "test/androidtestinitializer.cc",
509 "test/androidtestinitializer.h",
510 ]
511 deps += [
512 "//testing/android/native_test:native_test_support",
513 "//webrtc/sdk/android:base_jni",
514 "//webrtc/sdk/android:libjingle_peerconnection_java",
515 "//webrtc/sdk/android:null_audio_jni",
516 "//webrtc/sdk/android:null_video_jni",
517 ]
518 }
519
520 deps += [
521 ":pc_test_utils",
522 ":webrtc_null_audio",
523 ":webrtc_null_media",
524 ":webrtc_peerconnection",
525 "..:webrtc_common",
526 "../api:fakemetricsobserver",
527 "../base:rtc_base_tests_main",
528 "../base:rtc_base_tests_utils",
529 "../modules/utility",
530 "../pc:rtc_pc_base",
531 "../system_wrappers:metrics_default",
532 "//testing/gmock",
533 ]
534
535 if (is_android) {
536 deps += [ "//testing/android/native_test:native_test_support" ]
537 shard_timeout = 900
538 }
539 }
371 } 540 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698