blob: 1efd53145625eb28b992811e765dc905f9df09dd [file] [log] [blame]
hjonaa32c3e2015-12-13 19:58:11 -08001# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
2#
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
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9{
10 'includes': [ '../build/common.gypi', ],
11 'conditions': [
Henrik Kjellander15583c12016-02-10 10:53:12 +010012 ['os_posix == 1 and OS != "mac" and OS != "ios"', {
13 'conditions': [
14 ['sysroot!=""', {
15 'variables': {
16 'pkg-config': '../../../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
17 },
18 }, {
19 'variables': {
20 'pkg-config': 'pkg-config'
21 },
22 }],
23 ],
24 }],
25 ['OS=="android"', {
26 'targets': [
27 {
28 'target_name': 'libjingle_peerconnection_jni',
29 'type': 'static_library',
30 'dependencies': [
31 '<(webrtc_root)/system_wrappers/system_wrappers.gyp:field_trial_default',
32 'libjingle_peerconnection',
33 ],
34 'sources': [
35 'androidvideocapturer.cc',
36 'androidvideocapturer.h',
37 'java/jni/androidmediacodeccommon.h',
38 'java/jni/androidmediadecoder_jni.cc',
39 'java/jni/androidmediadecoder_jni.h',
40 'java/jni/androidmediaencoder_jni.cc',
41 'java/jni/androidmediaencoder_jni.h',
42 'java/jni/androidnetworkmonitor_jni.cc',
43 'java/jni/androidnetworkmonitor_jni.h',
44 'java/jni/androidvideocapturer_jni.cc',
45 'java/jni/androidvideocapturer_jni.h',
46 'java/jni/eglbase_jni.cc',
47 'java/jni/eglbase_jni.h',
48 'java/jni/surfacetexturehelper_jni.cc',
49 'java/jni/surfacetexturehelper_jni.h',
50 'java/jni/classreferenceholder.cc',
51 'java/jni/classreferenceholder.h',
52 'java/jni/jni_helpers.cc',
53 'java/jni/jni_helpers.h',
54 'java/jni/native_handle_impl.cc',
55 'java/jni/native_handle_impl.h',
56 'java/jni/peerconnection_jni.cc',
57 ],
58 'include_dirs': [
59 '<(libyuv_dir)/include',
60 ],
61 # TODO(kjellander): Make the code compile without disabling these flags.
62 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
63 'cflags': [
64 '-Wno-sign-compare',
65 '-Wno-unused-variable',
66 ],
67 'cflags!': [
68 '-Wextra',
69 ],
70 'cflags_cc!': [
71 '-Wnon-virtual-dtor',
72 '-Woverloaded-virtual',
73 ],
74 'msvs_disabled_warnings': [
75 4245, # conversion from 'int' to 'size_t', signed/unsigned mismatch.
76 4267, # conversion from 'size_t' to 'int', possible loss of data.
77 4389, # signed/unsigned mismatch.
78 ],
79 'conditions': [
80 ['build_json==1', {
81 'dependencies': [
82 '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
83 ],
84 'export_dependent_settings': [
85 '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
86 ],
87 }],
88 ],
89 },
90 {
91 'target_name': 'libjingle_peerconnection_so',
92 'type': 'shared_library',
93 'dependencies': [
94 'libjingle_peerconnection',
95 'libjingle_peerconnection_jni',
96 ],
97 'sources': [
98 'java/jni/jni_onload.cc',
99 ],
100 'variables': {
101 # This library uses native JNI exports; tell GYP so that the
102 # required symbols will be kept.
103 'use_native_jni_exports': 1,
104 },
105 },
106 {
107 # |libjingle_peerconnection_java| builds a jar file with name
108 # libjingle_peerconnection_java.jar using Chrome's build system.
109 # It includes all Java files needed to setup a PeeerConnection call
110 # from Android.
111 'target_name': 'libjingle_peerconnection_java',
112 'type': 'none',
113 'dependencies': [
114 'libjingle_peerconnection_so',
115 ],
116 'variables': {
117 # Designate as Chromium code and point to our lint settings to
118 # enable linting of the WebRTC code (this is the only way to make
119 # lint_action invoke the Android linter).
120 'android_manifest_path': '<(webrtc_root)/build/android/AndroidManifest.xml',
121 'suppressions_file': '<(webrtc_root)/build/android/suppressions.xml',
122 'chromium_code': 1,
123 'java_in_dir': 'java',
124 'webrtc_base_dir': '<(webrtc_root)/base',
125 'webrtc_modules_dir': '<(webrtc_root)/modules',
126 'additional_src_dirs' : [
127 'java/android',
128 '<(webrtc_base_dir)/java/src',
129 '<(webrtc_modules_dir)/audio_device/android/java/src',
130 '<(webrtc_modules_dir)/video_render/android/java/src',
131 ],
132 },
133 'includes': ['../../build/java.gypi'],
134 }, # libjingle_peerconnection_java
135 ]
136 }],
hjonaa32c3e2015-12-13 19:58:11 -0800137 ['OS=="ios"', {
138 'targets': [
139 {
140 'target_name': 'rtc_api_objc',
141 'type': 'static_library',
142 'dependencies': [
143 '<(webrtc_root)/base/base.gyp:rtc_base_objc',
Henrik Kjellander15583c12016-02-10 10:53:12 +0100144 'libjingle_peerconnection',
hjonaa32c3e2015-12-13 19:58:11 -0800145 ],
146 'sources': [
Jon Hjelle7ac8bab2016-01-21 11:44:55 -0800147 'objc/RTCAVFoundationVideoSource+Private.h',
148 'objc/RTCAVFoundationVideoSource.h',
149 'objc/RTCAVFoundationVideoSource.mm',
Jon Hjelle2bf9a5f2016-01-21 16:14:11 -0800150 'objc/RTCAudioTrack+Private.h',
151 'objc/RTCAudioTrack.h',
152 'objc/RTCAudioTrack.mm',
hjon6d49a8e2016-01-26 13:06:42 -0800153 'objc/RTCConfiguration+Private.h',
154 'objc/RTCConfiguration.h',
155 'objc/RTCConfiguration.mm',
hjone373dc22016-01-22 14:04:27 -0800156 'objc/RTCDataChannel+Private.h',
157 'objc/RTCDataChannel.h',
158 'objc/RTCDataChannel.mm',
hjonda2183c2016-01-27 13:42:28 -0800159 'objc/RTCDataChannelConfiguration+Private.h',
160 'objc/RTCDataChannelConfiguration.h',
161 'objc/RTCDataChannelConfiguration.mm',
Jon Hjelle29d5e572016-01-06 11:49:11 -0800162 'objc/RTCIceCandidate+Private.h',
163 'objc/RTCIceCandidate.h',
164 'objc/RTCIceCandidate.mm',
hjonaa32c3e2015-12-13 19:58:11 -0800165 'objc/RTCIceServer+Private.h',
166 'objc/RTCIceServer.h',
167 'objc/RTCIceServer.mm',
hjon6f5ca082016-01-07 09:29:29 -0800168 'objc/RTCMediaConstraints+Private.h',
169 'objc/RTCMediaConstraints.h',
170 'objc/RTCMediaConstraints.mm',
Jon Hjelle2bf9a5f2016-01-21 16:14:11 -0800171 'objc/RTCMediaStream+Private.h',
172 'objc/RTCMediaStream.h',
173 'objc/RTCMediaStream.mm',
Jon Hjelle81028792016-01-11 13:16:13 -0800174 'objc/RTCMediaStreamTrack+Private.h',
175 'objc/RTCMediaStreamTrack.h',
176 'objc/RTCMediaStreamTrack.mm',
Jon Hjellee799bad2016-01-11 13:47:11 -0800177 'objc/RTCOpenGLVideoRenderer.h',
178 'objc/RTCOpenGLVideoRenderer.mm',
hjonf396f602016-02-11 16:19:06 -0800179 'objc/RTCPeerConnection+DataChannel.mm',
180 'objc/RTCPeerConnection+Private.h',
181 'objc/RTCPeerConnection+Stats.mm',
182 'objc/RTCPeerConnection.h',
183 'objc/RTCPeerConnection.mm',
Jon Hjelleda99da82016-01-20 13:40:30 -0800184 'objc/RTCPeerConnectionFactory+Private.h',
185 'objc/RTCPeerConnectionFactory.h',
186 'objc/RTCPeerConnectionFactory.mm',
Jon Hjelle67e83d62016-01-06 12:05:22 -0800187 'objc/RTCSessionDescription+Private.h',
188 'objc/RTCSessionDescription.h',
189 'objc/RTCSessionDescription.mm',
Jon Hjellea2c353f2016-01-11 13:11:38 -0800190 'objc/RTCStatsReport+Private.h',
191 'objc/RTCStatsReport.h',
192 'objc/RTCStatsReport.mm',
Jon Hjelle78234952016-01-11 09:47:07 -0800193 'objc/RTCVideoFrame+Private.h',
194 'objc/RTCVideoFrame.h',
195 'objc/RTCVideoFrame.mm',
Jon Hjellee799bad2016-01-11 13:47:11 -0800196 'objc/RTCVideoRenderer.h',
Jon Hjelle891a4462016-01-21 11:42:05 -0800197 'objc/RTCVideoRendererAdapter+Private.h',
198 'objc/RTCVideoRendererAdapter.h',
199 'objc/RTCVideoRendererAdapter.mm',
Jon Hjelle065aacc2016-01-20 13:25:44 -0800200 'objc/RTCVideoSource+Private.h',
201 'objc/RTCVideoSource.h',
202 'objc/RTCVideoSource.mm',
Jon Hjelleca91e382016-01-21 15:36:47 -0800203 'objc/RTCVideoTrack+Private.h',
204 'objc/RTCVideoTrack.h',
205 'objc/RTCVideoTrack.mm',
Jon Hjelle7ac8bab2016-01-21 11:44:55 -0800206 'objc/avfoundationvideocapturer.h',
207 'objc/avfoundationvideocapturer.mm',
Jon Hjellee799bad2016-01-11 13:47:11 -0800208 ],
209 'conditions': [
210 ['OS=="ios"', {
211 'sources': [
212 'objc/RTCEAGLVideoView.h',
213 'objc/RTCEAGLVideoView.m',
214 ],
215 'all_dependent_settings': {
216 'xcode_settings': {
217 'OTHER_LDFLAGS': [
218 '-framework CoreGraphics',
219 '-framework GLKit',
220 '-framework OpenGLES',
221 '-framework QuartzCore',
222 ]
223 }
kjellandera96e2d72016-02-04 23:52:28 -0800224 },
225 # TODO(kjellander): Make the code compile without disabling these.
226 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
227 'cflags': [
228 '-Wno-return-type',
229 ],
230 'xcode_settings': {
231 'WARNING_CFLAGS': [
232 '-Wno-return-type',
233 ],
234 },
Jon Hjellee799bad2016-01-11 13:47:11 -0800235 }],
236 ['OS=="mac"', {
237 'sources': [
238 'objc/RTCNSGLVideoView.h',
239 'objc/RTCNSGLVideoView.m',
240 ],
241 }],
hjonaa32c3e2015-12-13 19:58:11 -0800242 ],
243 'xcode_settings': {
244 'CLANG_ENABLE_OBJC_ARC': 'YES',
245 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
246 'GCC_PREFIX_HEADER': 'objc/WebRTC-Prefix.pch',
247 },
248 }
249 ],
Henrik Kjellander15583c12016-02-10 10:53:12 +0100250 }], # OS=="ios"
251 ], # conditions
252 'targets': [
253 {
254 'target_name': 'libjingle_peerconnection',
255 'type': 'static_library',
256 'dependencies': [
257 '<(webrtc_root)/media/media.gyp:rtc_media',
258 '../../talk/libjingle.gyp:libjingle_p2p',
259 ],
260 'sources': [
261 'audiotrack.cc',
262 'audiotrack.h',
263 'datachannel.cc',
264 'datachannel.h',
265 'datachannelinterface.h',
266 'dtlsidentitystore.cc',
267 'dtlsidentitystore.h',
268 'dtmfsender.cc',
269 'dtmfsender.h',
270 'dtmfsenderinterface.h',
271 'jsep.h',
272 'jsepicecandidate.cc',
273 'jsepicecandidate.h',
274 'jsepsessiondescription.cc',
275 'jsepsessiondescription.h',
276 'localaudiosource.cc',
277 'localaudiosource.h',
278 'mediaconstraintsinterface.cc',
279 'mediaconstraintsinterface.h',
280 'mediacontroller.cc',
281 'mediacontroller.h',
282 'mediastream.cc',
283 'mediastream.h',
284 'mediastreaminterface.h',
285 'mediastreamobserver.cc',
286 'mediastreamobserver.h',
287 'mediastreamprovider.h',
288 'mediastreamproxy.h',
289 'mediastreamtrack.h',
290 'mediastreamtrackproxy.h',
291 'notifier.h',
292 'peerconnection.cc',
293 'peerconnection.h',
294 'peerconnectionfactory.cc',
295 'peerconnectionfactory.h',
296 'peerconnectionfactoryproxy.h',
297 'peerconnectioninterface.h',
298 'peerconnectionproxy.h',
299 'proxy.h',
300 'remoteaudiosource.cc',
301 'remoteaudiosource.h',
302 'remotevideocapturer.cc',
303 'remotevideocapturer.h',
304 'rtpreceiver.cc',
305 'rtpreceiver.h',
306 'rtpreceiverinterface.h',
307 'rtpsender.cc',
308 'rtpsender.h',
309 'rtpsenderinterface.h',
310 'sctputils.cc',
311 'sctputils.h',
312 'statscollector.cc',
313 'statscollector.h',
314 'statstypes.cc',
315 'statstypes.h',
316 'streamcollection.h',
317 'videosource.cc',
318 'videosource.h',
319 'videosourceinterface.h',
320 'videosourceproxy.h',
321 'videotrack.cc',
322 'videotrack.h',
323 'videotrackrenderers.cc',
324 'videotrackrenderers.h',
325 'webrtcsdp.cc',
326 'webrtcsdp.h',
327 'webrtcsession.cc',
328 'webrtcsession.h',
329 'webrtcsessiondescriptionfactory.cc',
330 'webrtcsessiondescriptionfactory.h',
331 ],
332 # TODO(kjellander): Make the code compile without disabling these flags.
333 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
334 'cflags': [
335 '-Wno-sign-compare',
336 ],
337 'cflags_cc!': [
338 '-Wnon-virtual-dtor',
339 '-Woverloaded-virtual',
340 ],
341 'conditions': [
342 ['clang==1', {
343 'cflags!': [
344 '-Wextra',
345 ],
346 'xcode_settings': {
347 'WARNING_CFLAGS!': ['-Wextra'],
348 },
349 }, {
350 'cflags': [
351 '-Wno-maybe-uninitialized', # Only exists for GCC.
352 ],
353 }],
354 ['OS=="win"', {
355 # Disable warning for signed/unsigned mismatch.
356 'msvs_settings': {
357 'VCCLCompilerTool': {
358 'AdditionalOptions!': ['/we4389'],
359 },
360 },
361 }],
362 ['OS=="win" and clang==1', {
363 'msvs_settings': {
364 'VCCLCompilerTool': {
365 'AdditionalOptions': [
366 '-Wno-sign-compare',
367 ],
368 },
369 },
370 }],
371 ],
372 }, # target libjingle_peerconnection
373 ], # targets
hjonaa32c3e2015-12-13 19:58:11 -0800374}