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

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

Issue 2514883002: Create //webrtc/api:libjingle_peerconnection_api + refactorings. (Closed)
Patch Set: Rebase Created 3 years, 11 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/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/pc/DEPS » ('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/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 = [ "HAVE_SRTP" ] 22 defines = [ "HAVE_SRTP" ]
19 if (rtc_enable_sctp) { 23 if (rtc_enable_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 check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828)
87 cflags = []
88 sources = [
89 "audiotrack.cc",
90 "audiotrack.h",
91 "datachannel.cc",
92 "datachannel.h",
93 "dtmfsender.cc",
94 "dtmfsender.h",
95 "jsepicecandidate.cc",
96 "jsepsessiondescription.cc",
97 "localaudiosource.cc",
98 "localaudiosource.h",
99 "mediacontroller.cc",
100 "mediacontroller.h",
101 "mediastream.cc",
102 "mediastream.h",
103 "mediastreamobserver.cc",
104 "mediastreamobserver.h",
105 "mediastreamtrack.h",
106 "ortcfactory.cc",
107 "ortcfactory.h",
108 "peerconnection.cc",
109 "peerconnection.h",
110 "peerconnectionfactory.cc",
111 "peerconnectionfactory.h",
112 "remoteaudiosource.cc",
113 "remoteaudiosource.h",
114 "rtcstatscollector.cc",
115 "rtcstatscollector.h",
116 "rtpreceiver.cc",
117 "rtpreceiver.h",
118 "rtpsender.cc",
119 "rtpsender.h",
120 "sctputils.cc",
121 "sctputils.h",
122 "statscollector.cc",
123 "statscollector.h",
124 "streamcollection.h",
125 "videocapturertracksource.cc",
126 "videocapturertracksource.h",
127 "videotrack.cc",
128 "videotrack.h",
129 "videotracksource.cc",
130 "videotracksource.h",
131 "webrtcsdp.cc",
132 "webrtcsdp.h",
133 "webrtcsession.cc",
134 "webrtcsession.h",
135 "webrtcsessiondescriptionfactory.cc",
136 "webrtcsessiondescriptionfactory.h",
137 ]
138
139 configs += [ ":libjingle_peerconnection_warnings_config" ]
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 deps = [
147 ":rtc_pc",
148 "../api:call_api",
149 "../api:libjingle_peerconnection_api",
150 "../api:rtc_stats_api",
151 "../call",
152 "../media",
153 "../stats",
154 ]
155
156 if (rtc_use_quic) {
157 sources += [
158 "quicdatachannel.cc",
159 "quicdatachannel.h",
160 "quicdatatransport.cc",
161 "quicdatatransport.h",
162 ]
163 deps += [ "//third_party/libquic" ]
164 public_deps = [
165 "//third_party/libquic",
166 ]
167 }
168 }
169
72 if (rtc_include_tests) { 170 if (rtc_include_tests) {
73 config("rtc_pc_unittests_config") { 171 config("rtc_pc_unittests_config") {
74 # GN orders flags on a target before flags from configs. The default config 172 # 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 173 # 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. 174 # come from a config and can't be on the target directly.
77 if (!is_win && !is_clang) { 175 if (!is_win && !is_clang) {
78 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC. 176 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
79 } 177 }
80 } 178 }
81 179
(...skipping 17 matching lines...) Expand all
99 if (!build_with_chromium && is_clang) { 197 if (!build_with_chromium && is_clang) {
100 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). 198 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
101 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] 199 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
102 } 200 }
103 201
104 if (is_win) { 202 if (is_win) {
105 libs = [ "strmiids.lib" ] 203 libs = [ "strmiids.lib" ]
106 } 204 }
107 205
108 deps = [ 206 deps = [
207 ":libjingle_peerconnection",
109 ":rtc_pc", 208 ":rtc_pc",
110 "../api:libjingle_peerconnection",
111 "../base:rtc_base_tests_utils", 209 "../base:rtc_base_tests_utils",
112 "../media:rtc_unittest_main", 210 "../media:rtc_unittest_main",
113 "../system_wrappers:metrics_default", 211 "../system_wrappers:metrics_default",
114 ] 212 ]
115 213
116 if (rtc_build_libsrtp) { 214 if (rtc_build_libsrtp) {
117 deps += [ "//third_party/libsrtp" ] 215 deps += [ "//third_party/libsrtp" ]
118 } 216 }
119 217
120 if (is_android) { 218 if (is_android) {
121 deps += [ "//testing/android/native_test:native_test_support" ] 219 deps += [ "//testing/android/native_test:native_test_support" ]
122 } 220 }
123 } 221 }
222
223 config("peerconnection_unittests_config") {
224 # The warnings below are enabled by default. Since GN orders compiler flags
225 # for a target before flags from configs, the only way to disable such
226 # warnings is by having them in a separate config, loaded from the target.
227 # TODO(kjellander): Make the code compile without disabling these flags.
228 # See https://bugs.webrtc.org/3307.
229 if (is_clang && is_win) {
230 cflags = [
231 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
232 # for -Wno-sign-compare
233 "-Wno-sign-compare",
234 "-Wno-unused-function",
235 ]
236 }
237
238 if (!is_win) {
239 cflags = [ "-Wno-sign-compare" ]
240 }
241 }
242
243 rtc_test("peerconnection_unittests") {
244 check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828)
245 testonly = true
246 sources = [
247 "datachannel_unittest.cc",
248 "dtmfsender_unittest.cc",
249 "fakemediacontroller.h",
250 "jsepsessiondescription_unittest.cc",
251 "localaudiosource_unittest.cc",
252 "mediaconstraintsinterface_unittest.cc",
253 "mediastream_unittest.cc",
254 "ortcfactory_unittest.cc",
255 "peerconnection_unittest.cc",
256 "peerconnectionendtoend_unittest.cc",
257 "peerconnectionfactory_unittest.cc",
258 "peerconnectioninterface_unittest.cc",
259 "proxy_unittest.cc",
260 "rtcstats_integrationtest.cc",
261 "rtcstatscollector_unittest.cc",
262 "rtpsenderreceiver_unittest.cc",
263 "sctputils_unittest.cc",
264 "statscollector_unittest.cc",
265 "test/fakeaudiocapturemodule.cc",
266 "test/fakeaudiocapturemodule.h",
267 "test/fakeaudiocapturemodule_unittest.cc",
268 "test/fakedatachannelprovider.h",
269 "test/fakeperiodicvideocapturer.h",
270 "test/fakertccertificategenerator.h",
271 "test/fakevideotrackrenderer.h",
272 "test/fakevideotracksource.h",
273 "test/mock_datachannel.h",
274 "test/mock_peerconnection.h",
275 "test/mock_webrtcsession.h",
276 "test/mockpeerconnectionobservers.h",
277 "test/peerconnectiontestwrapper.cc",
278 "test/peerconnectiontestwrapper.h",
279 "test/rtcstatsobtainer.h",
280 "test/testsdpstrings.h",
281 "videocapturertracksource_unittest.cc",
282 "videotrack_unittest.cc",
283 "webrtcsdp_unittest.cc",
284 "webrtcsession_unittest.cc",
285 ]
286
287 if (rtc_enable_sctp) {
288 defines = [ "HAVE_SCTP" ]
289 }
290
291 configs += [ ":peerconnection_unittests_config" ]
292
293 if (!build_with_chromium && is_clang) {
294 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
295 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
296 }
297
298 # TODO(jschuh): Bug 1348: fix this warning.
299 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
300
301 if (is_win) {
302 cflags = [
303 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
304 "/wd4389", # signed/unsigned mismatch.
305 ]
306 }
307
308 if (rtc_use_quic) {
309 public_deps = [
310 "//third_party/libquic",
311 ]
312 sources += [
313 "quicdatachannel_unittest.cc",
314 "quicdatatransport_unittest.cc",
315 ]
316 }
317
318 deps = []
319 if (is_android) {
320 sources += [
321 "test/androidtestinitializer.cc",
322 "test/androidtestinitializer.h",
323 ]
324 deps += [
325 "//testing/android/native_test:native_test_support",
326 "//webrtc/sdk/android:libjingle_peerconnection_java",
327 "//webrtc/sdk/android:libjingle_peerconnection_jni",
328 ]
329 }
330
331 deps += [
332 ":libjingle_peerconnection",
333 "..:webrtc_common",
334 "../api:fakemetricsobserver",
335 "../base:rtc_base_tests_utils",
336 "../media:rtc_unittest_main",
337 "../pc:rtc_pc",
338 "../system_wrappers:metrics_default",
339 "//testing/gmock",
340 ]
341
342 if (is_android) {
343 deps += [ "//testing/android/native_test:native_test_support" ]
344
345 shard_timeout = 900
346 }
347 }
124 } 348 }
OLDNEW
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/pc/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698