1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/crypto.gni")
6 import("//build/config/features.gni")
8 # From third_party/libjingle/libjingle.gyp's target_defaults.
9 config("jingle_unexported_configs") {
11 "EXPAT_RELATIVE_PATH",
13 "GTEST_RELATIVE_PATH",
17 "LOGGING_INSIDE_WEBRTC",
18 "NO_MAIN_THREAD_WRAPPING",
21 "USE_WEBRTC_DEV_BRANCH",
22 "ENABLE_EXTERNAL_AUTH",
23 "WEBRTC_CHROMIUM_BUILD",
28 "../../third_party/webrtc/overrides",
30 "../../testing/gtest/include",
32 "../../third_party/libyuv/include",
33 "../../third_party/usrsctp",
36 # Assumes libpeer is linked statically.
37 defines += [ "LIBPEERCONNECTION_LIB=1" ]
39 if (is_win && current_cpu == "x86") {
40 defines += [ "_USE_32BIT_TIME_T" ]
57 # From third_party/libjingle/libjingle.gyp's target_defaults.
58 config("jingle_public_configs") {
60 "../../third_party/webrtc/overrides",
63 "../../testing/gtest/include",
68 "FEATURE_ENABLE_VOICEMAIL",
69 "EXPAT_RELATIVE_PATH",
70 "GTEST_RELATIVE_PATH",
71 "NO_MAIN_THREAD_WRAPPING",
75 # TODO(GYP): Port is_win blocks.
96 defines += [ "WEBRTC_WIN" ]
99 defines += [ "ANDROID" ]
102 defines += [ "WEBRTC_POSIX" ]
105 # TODO(GYP): Support these in GN.
107 # defines += [ "BSD" ]
110 # defines += [ "OPENBSD" ]
113 # defines += [ "FREEBSD" ]
116 defines += [ "CHROMEOS" ]
120 # From third_party/libjingle/libjingle.gyp's target_defaults.
121 config("jingle_all_dependent_configs") {
123 # TODO(sergeyu): Fix libjingle to use NDEBUG instead of
124 # _DEBUG and remove this define. See GYP file as well.
125 defines = [ "_DEBUG" ]
129 # From third_party/libjingle/libjingle.gyp's target_defaults.
130 group("jingle_deps") {
132 "//third_party/expat",
141 # GYP version: third_party/libjingle.gyp:libjingle
142 static_library("libjingle") {
143 p2p_dir = "../webrtc/p2p"
144 xmllite_dir = "../webrtc/libjingle/xmllite"
145 xmpp_dir = "../webrtc/libjingle/xmpp"
147 # List from third_party/libjingle/libjingle_common.gypi
148 "$p2p_dir/base/asyncstuntcpsocket.cc",
149 "$p2p_dir/base/asyncstuntcpsocket.h",
150 "$p2p_dir/base/basicpacketsocketfactory.cc",
151 "$p2p_dir/base/basicpacketsocketfactory.h",
152 "$p2p_dir/base/candidate.h",
153 "$p2p_dir/base/common.h",
154 "$p2p_dir/base/constants.cc",
155 "$p2p_dir/base/constants.h",
156 "$p2p_dir/base/dtlstransport.h",
157 "$p2p_dir/base/dtlstransportchannel.cc",
158 "$p2p_dir/base/dtlstransportchannel.h",
159 "$p2p_dir/base/p2ptransport.cc",
160 "$p2p_dir/base/p2ptransport.h",
161 "$p2p_dir/base/p2ptransportchannel.cc",
162 "$p2p_dir/base/p2ptransportchannel.h",
163 "$p2p_dir/base/port.cc",
164 "$p2p_dir/base/port.h",
165 "$p2p_dir/base/portallocator.cc",
166 "$p2p_dir/base/portallocator.h",
167 "$p2p_dir/base/pseudotcp.cc",
168 "$p2p_dir/base/pseudotcp.h",
169 "$p2p_dir/base/rawtransport.cc",
170 "$p2p_dir/base/rawtransport.h",
171 "$p2p_dir/base/rawtransportchannel.cc",
172 "$p2p_dir/base/rawtransportchannel.h",
173 "$p2p_dir/base/relayport.cc",
174 "$p2p_dir/base/relayport.h",
175 "$p2p_dir/base/session.cc",
176 "$p2p_dir/base/session.h",
177 "$p2p_dir/base/sessiondescription.cc",
178 "$p2p_dir/base/sessiondescription.h",
179 "$p2p_dir/base/sessionid.h",
180 "$p2p_dir/base/stun.cc",
181 "$p2p_dir/base/stun.h",
182 "$p2p_dir/base/stunport.cc",
183 "$p2p_dir/base/stunport.h",
184 "$p2p_dir/base/stunrequest.cc",
185 "$p2p_dir/base/stunrequest.h",
186 "$p2p_dir/base/tcpport.cc",
187 "$p2p_dir/base/tcpport.h",
188 "$p2p_dir/base/transport.cc",
189 "$p2p_dir/base/transport.h",
190 "$p2p_dir/base/transportchannel.cc",
191 "$p2p_dir/base/transportchannel.h",
192 "$p2p_dir/base/transportchannelimpl.h",
193 "$p2p_dir/base/transportchannelproxy.cc",
194 "$p2p_dir/base/transportchannelproxy.h",
195 "$p2p_dir/base/transportdescription.cc",
196 "$p2p_dir/base/transportdescription.h",
197 "$p2p_dir/base/transportdescriptionfactory.cc",
198 "$p2p_dir/base/transportdescriptionfactory.h",
199 "$p2p_dir/base/turnport.cc",
200 "$p2p_dir/base/turnport.h",
201 "$p2p_dir/client/basicportallocator.cc",
202 "$p2p_dir/client/basicportallocator.h",
203 "$p2p_dir/client/httpportallocator.cc",
204 "$p2p_dir/client/httpportallocator.h",
205 "$p2p_dir/client/socketmonitor.cc",
206 "$p2p_dir/client/socketmonitor.h",
207 "$xmllite_dir/qname.cc",
208 "$xmllite_dir/qname.h",
209 "$xmllite_dir/xmlbuilder.cc",
210 "$xmllite_dir/xmlbuilder.h",
211 "$xmllite_dir/xmlconstants.cc",
212 "$xmllite_dir/xmlconstants.h",
213 "$xmllite_dir/xmlelement.cc",
214 "$xmllite_dir/xmlelement.h",
215 "$xmllite_dir/xmlnsstack.cc",
216 "$xmllite_dir/xmlnsstack.h",
217 "$xmllite_dir/xmlparser.cc",
218 "$xmllite_dir/xmlparser.h",
219 "$xmllite_dir/xmlprinter.cc",
220 "$xmllite_dir/xmlprinter.h",
221 "$xmpp_dir/asyncsocket.h",
222 "$xmpp_dir/constants.cc",
223 "$xmpp_dir/constants.h",
226 "$xmpp_dir/plainsaslhandler.h",
227 "$xmpp_dir/prexmppauth.h",
228 "$xmpp_dir/saslcookiemechanism.h",
229 "$xmpp_dir/saslhandler.h",
230 "$xmpp_dir/saslmechanism.cc",
231 "$xmpp_dir/saslmechanism.h",
232 "$xmpp_dir/saslplainmechanism.h",
233 "$xmpp_dir/xmppclient.cc",
234 "$xmpp_dir/xmppclient.h",
235 "$xmpp_dir/xmppclientsettings.h",
236 "$xmpp_dir/xmppengine.h",
237 "$xmpp_dir/xmppengineimpl.cc",
238 "$xmpp_dir/xmppengineimpl.h",
239 "$xmpp_dir/xmppengineimpl_iq.cc",
240 "$xmpp_dir/xmpplogintask.cc",
241 "$xmpp_dir/xmpplogintask.h",
242 "$xmpp_dir/xmppstanzaparser.cc",
243 "$xmpp_dir/xmppstanzaparser.h",
244 "$xmpp_dir/xmpptask.cc",
245 "$xmpp_dir/xmpptask.h",
248 # Compiled as part of libjingle_p2p_constants.
249 "$p2p_dir/base/constants.cc",
250 "$p2p_dir/base/constants.h",
253 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
254 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
260 "//third_party/webrtc/base:rtc_base",
261 ":libjingle_p2p_constants",
264 # From libjingle_common.gypi's conditions list.
266 cflags = [ "/wd4005" ]
269 configs += [ ":jingle_unexported_configs" ]
270 public_configs = [ ":jingle_public_configs" ]
271 all_dependent_configs = [ ":jingle_all_dependent_configs" ]
274 # This has to be is a separate project due to a bug in MSVS 2008 and the
275 # current toolset on android. The problem is that we have two files named
276 # "constants.cc" and MSVS/android doesn't handle this properly.
277 # GYP currently has guards to catch this, so if you want to remove it,
278 # run GYP and if GYP has removed the validation check, then we can assume
279 # that the toolchains have been fixed (we currently use VS2010 and later,
280 # so VS2008 isn't a concern anymore).
282 # GYP version: third_party/libjingle.gyp:libjingle_p2p_constants
283 static_library("libjingle_p2p_constants") {
284 p2p_dir = "../webrtc/p2p"
286 "$p2p_dir/base/constants.cc",
287 "$p2p_dir/base/constants.h",
292 configs += [ ":jingle_unexported_configs" ]
293 public_configs = [ ":jingle_public_configs" ]
294 all_dependent_configs = [ ":jingle_all_dependent_configs" ]
297 # GYP version: third_party/libjingle.gyp:peerconnnection_server
298 #TODO(GYP): Switch to executable when WebRTC dependency is resolved.
299 source_set("peerconnnection_server") {
301 "source/talk/examples/peerconnection/server/data_socket.cc",
302 "source/talk/examples/peerconnection/server/data_socket.h",
303 "source/talk/examples/peerconnection/server/main.cc",
304 "source/talk/examples/peerconnection/server/peer_channel.cc",
305 "source/talk/examples/peerconnection/server/peer_channel.h",
306 "source/talk/examples/peerconnection/server/utils.cc",
307 "source/talk/examples/peerconnection/server/utils.h",
309 include_dirs = [ "source" ]
317 configs += [ ":jingle_unexported_configs" ]
318 public_configs = [ ":jingle_public_configs" ]
319 all_dependent_configs = [ ":jingle_all_dependent_configs" ]
321 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
322 cflags = [ "/wd4309" ]
327 source_set("libjingle_webrtc") {
329 "overrides/init_webrtc.cc",
330 "overrides/init_webrtc.h",
332 configs += [ ":jingle_unexported_configs" ]
333 public_configs = [ ":jingle_public_configs" ]
335 ":libjingle_webrtc_common",
339 # Note: this does not support the shared library build of libpeerconnection
340 # as is supported in the GYP build. It's not clear what this is used for.
341 source_set("libjingle_webrtc_common") {
343 "overrides/talk/media/webrtc/webrtcexport.h",
344 "source/talk/app/webrtc/audiotrack.cc",
345 "source/talk/app/webrtc/audiotrack.h",
346 "source/talk/app/webrtc/audiotrackrenderer.cc",
347 "source/talk/app/webrtc/audiotrackrenderer.h",
348 "source/talk/app/webrtc/datachannel.cc",
349 "source/talk/app/webrtc/datachannel.h",
350 "source/talk/app/webrtc/dtlsidentityservice.cc",
351 "source/talk/app/webrtc/dtlsidentityservice.h",
352 "source/talk/app/webrtc/dtlsidentitystore.cc",
353 "source/talk/app/webrtc/dtlsidentitystore.h",
354 "source/talk/app/webrtc/dtmfsender.cc",
355 "source/talk/app/webrtc/dtmfsender.h",
356 "source/talk/app/webrtc/jsep.h",
357 "source/talk/app/webrtc/jsepicecandidate.cc",
358 "source/talk/app/webrtc/jsepicecandidate.h",
359 "source/talk/app/webrtc/jsepsessiondescription.cc",
360 "source/talk/app/webrtc/jsepsessiondescription.h",
361 "source/talk/app/webrtc/localaudiosource.cc",
362 "source/talk/app/webrtc/localaudiosource.h",
363 "source/talk/app/webrtc/mediaconstraintsinterface.cc",
364 "source/talk/app/webrtc/mediaconstraintsinterface.h",
365 "source/talk/app/webrtc/mediastream.cc",
366 "source/talk/app/webrtc/mediastream.h",
367 "source/talk/app/webrtc/mediastreamhandler.cc",
368 "source/talk/app/webrtc/mediastreamhandler.h",
369 "source/talk/app/webrtc/mediastreaminterface.h",
370 "source/talk/app/webrtc/mediastreamprovider.h",
371 "source/talk/app/webrtc/mediastreamproxy.h",
372 "source/talk/app/webrtc/mediastreamsignaling.cc",
373 "source/talk/app/webrtc/mediastreamsignaling.h",
374 "source/talk/app/webrtc/mediastreamtrack.h",
375 "source/talk/app/webrtc/mediastreamtrackproxy.h",
376 "source/talk/app/webrtc/notifier.h",
377 "source/talk/app/webrtc/peerconnection.cc",
378 "source/talk/app/webrtc/peerconnection.h",
379 "source/talk/app/webrtc/peerconnectionfactory.cc",
380 "source/talk/app/webrtc/peerconnectionfactory.h",
381 "source/talk/app/webrtc/peerconnectioninterface.h",
382 "source/talk/app/webrtc/portallocatorfactory.cc",
383 "source/talk/app/webrtc/portallocatorfactory.h",
384 "source/talk/app/webrtc/remoteaudiosource.cc",
385 "source/talk/app/webrtc/remoteaudiosource.h",
386 "source/talk/app/webrtc/remotevideocapturer.cc",
387 "source/talk/app/webrtc/remotevideocapturer.h",
388 "source/talk/app/webrtc/sctputils.cc",
389 "source/talk/app/webrtc/sctputils.h",
390 "source/talk/app/webrtc/statscollector.cc",
391 "source/talk/app/webrtc/statscollector.h",
392 "source/talk/app/webrtc/statstypes.cc",
393 "source/talk/app/webrtc/statstypes.h",
394 "source/talk/app/webrtc/streamcollection.h",
395 "source/talk/app/webrtc/umametrics.h",
396 "source/talk/app/webrtc/videosource.cc",
397 "source/talk/app/webrtc/videosource.h",
398 "source/talk/app/webrtc/videosourceinterface.h",
399 "source/talk/app/webrtc/videosourceproxy.h",
400 "source/talk/app/webrtc/videotrack.cc",
401 "source/talk/app/webrtc/videotrack.h",
402 "source/talk/app/webrtc/videotrackrenderers.cc",
403 "source/talk/app/webrtc/videotrackrenderers.h",
404 "source/talk/app/webrtc/webrtcsdp.cc",
405 "source/talk/app/webrtc/webrtcsdp.h",
406 "source/talk/app/webrtc/webrtcsession.cc",
407 "source/talk/app/webrtc/webrtcsession.h",
408 "source/talk/app/webrtc/webrtcsessiondescriptionfactory.cc",
409 "source/talk/app/webrtc/webrtcsessiondescriptionfactory.h",
410 "source/talk/media/base/audiorenderer.h",
411 "source/talk/media/base/capturemanager.cc",
412 "source/talk/media/base/capturemanager.h",
413 "source/talk/media/base/capturerenderadapter.cc",
414 "source/talk/media/base/capturerenderadapter.h",
415 "source/talk/media/base/codec.cc",
416 "source/talk/media/base/codec.h",
417 "source/talk/media/base/constants.cc",
418 "source/talk/media/base/constants.h",
419 "source/talk/media/base/cryptoparams.h",
420 "source/talk/media/base/hybriddataengine.h",
421 "source/talk/media/base/mediachannel.h",
422 "source/talk/media/base/mediaengine.cc",
423 "source/talk/media/base/mediaengine.h",
424 "source/talk/media/base/rtpdataengine.cc",
425 "source/talk/media/base/rtpdataengine.h",
426 "source/talk/media/base/rtpdump.cc",
427 "source/talk/media/base/rtpdump.h",
428 "source/talk/media/base/rtputils.cc",
429 "source/talk/media/base/rtputils.h",
430 "source/talk/media/base/streamparams.cc",
431 "source/talk/media/base/streamparams.h",
432 "source/talk/media/base/videoadapter.cc",
433 "source/talk/media/base/videoadapter.h",
434 "source/talk/media/base/videocapturer.cc",
435 "source/talk/media/base/videocapturer.h",
436 "source/talk/media/base/videocommon.cc",
437 "source/talk/media/base/videocommon.h",
438 "source/talk/media/base/videoframe.cc",
439 "source/talk/media/base/videoframe.h",
440 "source/talk/media/base/videoframefactory.cc",
441 "source/talk/media/base/videoframefactory.h",
442 "source/talk/media/devices/dummydevicemanager.cc",
443 "source/talk/media/devices/dummydevicemanager.h",
444 "source/talk/media/devices/filevideocapturer.cc",
445 "source/talk/media/devices/filevideocapturer.h",
446 "source/talk/media/webrtc/webrtccommon.h",
447 "source/talk/media/webrtc/webrtcpassthroughrender.cc",
448 "source/talk/media/webrtc/webrtcpassthroughrender.h",
449 "source/talk/media/webrtc/webrtcvideoframe.cc",
450 "source/talk/media/webrtc/webrtcvideoframe.h",
451 "source/talk/media/webrtc/webrtcvideoframefactory.cc",
452 "source/talk/media/webrtc/webrtcvideoframefactory.h",
453 "source/talk/media/webrtc/webrtcvoe.h",
454 "source/talk/session/media/audiomonitor.cc",
455 "source/talk/session/media/audiomonitor.h",
456 "source/talk/session/media/bundlefilter.cc",
457 "source/talk/session/media/bundlefilter.h",
458 "source/talk/session/media/channel.cc",
459 "source/talk/session/media/channel.h",
460 "source/talk/session/media/channelmanager.cc",
461 "source/talk/session/media/channelmanager.h",
462 "source/talk/session/media/currentspeakermonitor.cc",
463 "source/talk/session/media/currentspeakermonitor.h",
464 "source/talk/session/media/externalhmac.cc",
465 "source/talk/session/media/externalhmac.h",
466 "source/talk/session/media/mediamonitor.cc",
467 "source/talk/session/media/mediamonitor.h",
468 "source/talk/session/media/mediasession.cc",
469 "source/talk/session/media/mediasession.h",
470 "source/talk/session/media/mediasink.h",
471 "source/talk/session/media/rtcpmuxfilter.cc",
472 "source/talk/session/media/rtcpmuxfilter.h",
473 "source/talk/session/media/soundclip.cc",
474 "source/talk/session/media/soundclip.h",
475 "source/talk/session/media/srtpfilter.cc",
476 "source/talk/session/media/srtpfilter.h",
477 "source/talk/session/media/typingmonitor.cc",
478 "source/talk/session/media/typingmonitor.h",
479 "source/talk/session/media/voicechannel.h",
482 configs -= [ "//build/config/compiler:chromium_code" ]
483 configs += [ "//build/config/compiler:no_chromium_code" ]
485 configs += [ ":jingle_unexported_configs" ]
486 public_configs = [ ":jingle_public_configs" ]
490 "//third_party/libsrtp",
491 "//third_party/webrtc/modules/media_file",
492 "//third_party/webrtc/modules/video_capture",
493 "//third_party/webrtc/modules/video_render",
497 # TODO(mallinath) - Enable SCTP for iOS.
499 "source/talk/media/sctp/sctpdataengine.cc",
500 "source/talk/media/sctp/sctpdataengine.h",
502 defines = [ "HAVE_SCTP" ]
503 deps += [ "//third_party/usrsctp" ]
507 # Note: this does not support the shared library build of libpeerconnection
508 # as is supported in the GYP build. It's not clear what this is used for.
509 source_set("libpeerconnection") {
511 "source/talk/media/webrtc/simulcast.cc",
512 "source/talk/media/webrtc/simulcast.h",
513 "source/talk/media/webrtc/webrtcmediaengine.cc",
514 "source/talk/media/webrtc/webrtcmediaengine.h",
515 "source/talk/media/webrtc/webrtcvideoengine2.cc",
516 "source/talk/media/webrtc/webrtcvideoengine2.h",
517 "source/talk/media/webrtc/webrtcvoiceengine.cc",
518 "source/talk/media/webrtc/webrtcvoiceengine.h",
521 configs += [ ":jingle_unexported_configs" ]
522 public_configs = [ ":jingle_public_configs" ]
523 configs -= [ "//build/config/compiler:chromium_code" ]
524 configs += [ "//build/config/compiler:no_chromium_code" ]
527 # TODO(GYP): crbug.com/481633. Consider depending on :libjingle_webrtc
529 ":libjingle_webrtc_common",
530 "//third_party/webrtc",
531 "//third_party/webrtc/system_wrappers",
532 "//third_party/webrtc/voice_engine",
536 source_set("libstunprober") {
537 p2p_dir = "../webrtc/p2p"
539 "$p2p_dir/stunprober/stunprober.cc",
543 "//third_party/webrtc/base:rtc_base",
544 ":libjingle_webrtc_common",
548 # TODO(GYP): Port libjingle.gyp's enable_webrtc condition block.