blob: 63aa5f11173998aaed2d7533085ce720b0ed4019 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001#
2# libjingle
3# Copyright 2012, Google Inc.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are met:
7#
8# 1. Redistributions of source code must retain the above copyright notice,
9# this list of conditions and the following disclaimer.
10# 2. Redistributions in binary form must reproduce the above copyright notice,
11# this list of conditions and the following disclaimer in the documentation
12# and/or other materials provided with the distribution.
13# 3. The name of the author may not be used to endorse or promote products
14# derived from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26#
27
28{
29 'includes': [
30 'build/common.gypi',
31 ],
32 'targets': [
33 {
henrike@webrtc.org28e20752013-07-10 00:45:36 +000034 'target_name': 'relayserver',
35 'type': 'executable',
36 'dependencies': [
37 'libjingle.gyp:libjingle',
38 'libjingle.gyp:libjingle_p2p',
39 ],
40 'sources': [
henrike@webrtc.org2ce9a642014-01-16 16:49:53 +000041 'examples/relayserver/relayserver_main.cc',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000042 ],
43 }, # target relayserver
44 {
45 'target_name': 'stunserver',
46 'type': 'executable',
47 'dependencies': [
48 'libjingle.gyp:libjingle',
49 'libjingle.gyp:libjingle_p2p',
50 ],
51 'sources': [
henrike@webrtc.org2ce9a642014-01-16 16:49:53 +000052 'examples/stunserver/stunserver_main.cc',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000053 ],
54 }, # target stunserver
55 {
56 'target_name': 'turnserver',
57 'type': 'executable',
58 'dependencies': [
59 'libjingle.gyp:libjingle',
60 'libjingle.gyp:libjingle_p2p',
61 ],
62 'sources': [
henrike@webrtc.org2ce9a642014-01-16 16:49:53 +000063 'examples/turnserver/turnserver_main.cc',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000064 ],
65 }, # target turnserver
66 {
henrike@webrtc.org28e20752013-07-10 00:45:36 +000067 'target_name': 'peerconnection_server',
68 'type': 'executable',
69 'sources': [
70 'examples/peerconnection/server/data_socket.cc',
71 'examples/peerconnection/server/data_socket.h',
72 'examples/peerconnection/server/main.cc',
73 'examples/peerconnection/server/peer_channel.cc',
74 'examples/peerconnection/server/peer_channel.h',
75 'examples/peerconnection/server/utils.cc',
76 'examples/peerconnection/server/utils.h',
77 ],
78 'dependencies': [
79 'libjingle.gyp:libjingle',
80 ],
81 # TODO(ronghuawu): crbug.com/167187 fix size_t to int truncations.
82 'msvs_disabled_warnings': [ 4309, ],
83 }, # target peerconnection_server
84 ],
85 'conditions': [
henrike@webrtc.org28e20752013-07-10 00:45:36 +000086 ['OS=="linux" or OS=="win"', {
87 'targets': [
88 {
89 'target_name': 'peerconnection_client',
90 'type': 'executable',
91 'sources': [
92 'examples/peerconnection/client/conductor.cc',
93 'examples/peerconnection/client/conductor.h',
94 'examples/peerconnection/client/defaults.cc',
95 'examples/peerconnection/client/defaults.h',
96 'examples/peerconnection/client/peer_connection_client.cc',
97 'examples/peerconnection/client/peer_connection_client.h',
98 ],
99 'dependencies': [
100 '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
101 'libjingle.gyp:libjingle_peerconnection',
buildbot@webrtc.org21b4da82014-07-23 19:07:53 +0000102 '<@(libjingle_tests_additional_deps)',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000103 ],
104 'conditions': [
105 # TODO(ronghuawu): Move these files to a win/ directory then they
106 # can be excluded automatically.
107 ['OS=="win"', {
108 'sources': [
109 'examples/peerconnection/client/flagdefs.h',
110 'examples/peerconnection/client/main.cc',
111 'examples/peerconnection/client/main_wnd.cc',
112 'examples/peerconnection/client/main_wnd.h',
113 ],
114 'msvs_settings': {
115 'VCLinkerTool': {
116 'SubSystem': '2', # Windows
117 },
118 },
119 }], # OS=="win"
120 ['OS=="linux"', {
121 'sources': [
122 'examples/peerconnection/client/linux/main.cc',
123 'examples/peerconnection/client/linux/main_wnd.cc',
124 'examples/peerconnection/client/linux/main_wnd.h',
125 ],
126 'cflags': [
127 '<!@(pkg-config --cflags glib-2.0 gobject-2.0 gtk+-2.0)',
128 ],
129 'link_settings': {
130 'ldflags': [
131 '<!@(pkg-config --libs-only-L --libs-only-other glib-2.0'
132 ' gobject-2.0 gthread-2.0 gtk+-2.0)',
133 ],
134 'libraries': [
135 '<!@(pkg-config --libs-only-l glib-2.0 gobject-2.0'
136 ' gthread-2.0 gtk+-2.0)',
137 '-lX11',
138 '-lXcomposite',
139 '-lXext',
140 '-lXrender',
141 ],
142 },
143 }], # OS=="linux"
144 ], # conditions
145 }, # target peerconnection_client
146 ], # targets
147 }], # OS=="linux" or OS=="win"
148
tkchin@webrtc.org56d11462014-05-30 23:04:39 +0000149 ['OS=="ios" or (OS=="mac" and target_arch!="ia32" and mac_sdk>="10.8")', {
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000150 'targets': [
151 {
152 'target_name': 'AppRTCDemo',
153 'type': 'executable',
154 'product_name': 'AppRTCDemo',
155 'mac_bundle': 1,
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000156 'dependencies': [
157 'libjingle.gyp:libjingle_peerconnection_objc',
tkchin@webrtc.org87776a82014-12-09 19:32:35 +0000158 'socketrocket',
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000159 ],
160 'conditions': [
tkchin@webrtc.orgacca6752014-05-30 22:26:06 +0000161 ['OS=="ios"', {
162 'mac_bundle_resources': [
163 'examples/objc/AppRTCDemo/ios/ResourceRules.plist',
164 'examples/objc/AppRTCDemo/ios/en.lproj/APPRTCViewController.xib',
165 'examples/objc/Icon.png',
166 ],
167 'sources': [
168 'examples/objc/AppRTCDemo/ios/APPRTCAppDelegate.h',
169 'examples/objc/AppRTCDemo/ios/APPRTCAppDelegate.m',
170 'examples/objc/AppRTCDemo/ios/APPRTCViewController.h',
171 'examples/objc/AppRTCDemo/ios/APPRTCViewController.m',
172 'examples/objc/AppRTCDemo/ios/AppRTCDemo-Prefix.pch',
173 'examples/objc/AppRTCDemo/ios/main.m',
174 ],
175 'xcode_settings': {
176 'INFOPLIST_FILE': 'examples/objc/AppRTCDemo/ios/Info.plist',
177 },
178 }],
179 ['OS=="mac"', {
180 'sources': [
181 'examples/objc/AppRTCDemo/mac/APPRTCAppDelegate.h',
182 'examples/objc/AppRTCDemo/mac/APPRTCAppDelegate.m',
183 'examples/objc/AppRTCDemo/mac/APPRTCViewController.h',
184 'examples/objc/AppRTCDemo/mac/APPRTCViewController.m',
185 'examples/objc/AppRTCDemo/mac/main.m',
186 ],
187 'xcode_settings': {
188 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
189 'INFOPLIST_FILE': 'examples/objc/AppRTCDemo/mac/Info.plist',
190 'MACOSX_DEPLOYMENT_TARGET' : '10.8',
191 'OTHER_LDFLAGS': [
192 '-framework AVFoundation',
tkchin@webrtc.orgacca6752014-05-30 22:26:06 +0000193 ],
194 },
195 }],
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000196 ['target_arch=="ia32"', {
197 'dependencies' : [
198 '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host',
199 ],
200 }],
201 ],
tkchin@webrtc.orgacca6752014-05-30 22:26:06 +0000202 'include_dirs': [
203 'examples/objc/APPRTCDemo',
204 ],
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000205 'sources': [
tkchin@webrtc.org87776a82014-12-09 19:32:35 +0000206 'examples/objc/AppRTCDemo/ARDAppClient.h',
207 'examples/objc/AppRTCDemo/ARDAppClient.m',
208 'examples/objc/AppRTCDemo/ARDMessageResponse.h',
209 'examples/objc/AppRTCDemo/ARDMessageResponse.m',
210 'examples/objc/AppRTCDemo/ARDRegisterResponse.h',
211 'examples/objc/AppRTCDemo/ARDRegisterResponse.m',
212 'examples/objc/AppRTCDemo/ARDSignalingMessage.h',
213 'examples/objc/AppRTCDemo/ARDSignalingMessage.m',
tkchin@webrtc.org3e9ad262014-11-27 00:52:38 +0000214 'examples/objc/AppRTCDemo/ARDUtilities.h',
215 'examples/objc/AppRTCDemo/ARDUtilities.m',
tkchin@webrtc.org87776a82014-12-09 19:32:35 +0000216 'examples/objc/AppRTCDemo/ARDWebSocketChannel.h',
217 'examples/objc/AppRTCDemo/ARDWebSocketChannel.m',
tkchin@webrtc.org3e9ad262014-11-27 00:52:38 +0000218 'examples/objc/AppRTCDemo/RTCICECandidate+JSON.h',
219 'examples/objc/AppRTCDemo/RTCICECandidate+JSON.m',
220 'examples/objc/AppRTCDemo/RTCICEServer+JSON.h',
221 'examples/objc/AppRTCDemo/RTCICEServer+JSON.m',
222 'examples/objc/AppRTCDemo/RTCMediaConstraints+JSON.h',
223 'examples/objc/AppRTCDemo/RTCMediaConstraints+JSON.m',
224 'examples/objc/AppRTCDemo/RTCSessionDescription+JSON.h',
225 'examples/objc/AppRTCDemo/RTCSessionDescription+JSON.m',
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000226 ],
227 'xcode_settings': {
228 'CLANG_ENABLE_OBJC_ARC': 'YES',
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000229 },
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000230 }, # target AppRTCDemo
tkchin@webrtc.org87776a82014-12-09 19:32:35 +0000231 {
232 # TODO(tkchin): move this into the real third party location and
233 # have it mirrored on chrome infra.
234 'target_name': 'socketrocket',
235 'type': 'static_library',
236 'sources': [
237 'examples/objc/AppRTCDemo/third_party/SocketRocket/SRWebSocket.h',
238 'examples/objc/AppRTCDemo/third_party/SocketRocket/SRWebSocket.m',
239 ],
240 'conditions': [
241 ['OS=="mac"', {
242 'xcode_settings': {
243 # SocketRocket autosynthesizes some properties. Disable the
244 # warning so we can compile successfully.
245 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
246 'MACOSX_DEPLOYMENT_TARGET' : '10.8',
247 },
248 }],
249 ],
250 'direct_dependent_settings': {
251 'include_dirs': [
252 'examples/objc/AppRTCDemo/third_party/SocketRocket',
253 ],
254 },
255 'xcode_settings': {
256 'CLANG_ENABLE_OBJC_ARC': 'YES',
257 'WARNING_CFLAGS': [
258 '-Wno-deprecated-declarations',
259 ],
260 },
261 'link_settings': {
262 'xcode_settings': {
263 'OTHER_LDFLAGS': [
264 '-framework CFNetwork',
265 ],
266 },
267 'libraries': [
268 '$(SDKROOT)/usr/lib/libicucore.dylib',
269 ],
270 }
271 }, # target socketrocket
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000272 ], # targets
tkchin@webrtc.org56d11462014-05-30 23:04:39 +0000273 }], # OS=="ios" or (OS=="mac" and target_arch!="ia32" and mac_sdk>="10.8")
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000274
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000275 ['OS=="android"', {
276 'targets': [
277 {
278 'target_name': 'AppRTCDemo',
279 'type': 'none',
280 'dependencies': [
281 'libjingle.gyp:libjingle_peerconnection_jar',
282 ],
283 'actions': [
284 {
285 # TODO(fischman): convert from a custom script to a standard gyp
286 # apk build once chromium's apk-building gyp machinery can be used
287 # (http://crbug.com/225101)
288 'action_name': 'build_apprtcdemo_apk',
289 'inputs' : [
henrike@webrtc.org723d6832013-07-12 16:04:50 +0000290 '<(PRODUCT_DIR)/libjingle_peerconnection.jar',
perkj@webrtc.org128faba2014-12-11 12:25:57 +0000291 '<(PRODUCT_DIR)/lib/libjingle_peerconnection_so.so',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000292 'examples/android/AndroidManifest.xml',
293 'examples/android/README',
294 'examples/android/ant.properties',
fischman@webrtc.org147d44a2013-07-29 19:07:33 +0000295 'examples/android/assets/channel.html',
henrik.lundin@webrtc.org6f6ef722014-11-19 13:02:24 +0000296 'examples/android/third_party/autobanh/autobanh.jar',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000297 'examples/android/build.xml',
298 'examples/android/jni/Android.mk',
299 'examples/android/project.properties',
glaznev@webrtc.org7bb4a982014-10-22 17:43:37 +0000300 'examples/android/res/drawable-hdpi/disconnect.png',
glaznev@webrtc.org5f38c8d2014-11-03 22:18:52 +0000301 'examples/android/res/drawable-hdpi/ic_action_full_screen.png',
302 'examples/android/res/drawable-hdpi/ic_action_return_from_full_screen.png',
303 'examples/android/res/drawable-hdpi/ic_loopback_call.png',
304 'examples/android/res/drawable-hdpi/ic_launcher.png',
glaznev@webrtc.org7bb4a982014-10-22 17:43:37 +0000305 'examples/android/res/drawable-ldpi/disconnect.png',
glaznev@webrtc.org5f38c8d2014-11-03 22:18:52 +0000306 'examples/android/res/drawable-ldpi/ic_action_full_screen.png',
307 'examples/android/res/drawable-ldpi/ic_action_return_from_full_screen.png',
308 'examples/android/res/drawable-ldpi/ic_loopback_call.png',
309 'examples/android/res/drawable-ldpi/ic_launcher.png',
glaznev@webrtc.org7bb4a982014-10-22 17:43:37 +0000310 'examples/android/res/drawable-mdpi/disconnect.png',
glaznev@webrtc.org5f38c8d2014-11-03 22:18:52 +0000311 'examples/android/res/drawable-mdpi/ic_action_full_screen.png',
312 'examples/android/res/drawable-mdpi/ic_action_return_from_full_screen.png',
313 'examples/android/res/drawable-mdpi/ic_loopback_call.png',
314 'examples/android/res/drawable-mdpi/ic_launcher.png',
glaznev@webrtc.org7bb4a982014-10-22 17:43:37 +0000315 'examples/android/res/drawable-xhdpi/disconnect.png',
glaznev@webrtc.org5f38c8d2014-11-03 22:18:52 +0000316 'examples/android/res/drawable-xhdpi/ic_action_full_screen.png',
317 'examples/android/res/drawable-xhdpi/ic_action_return_from_full_screen.png',
318 'examples/android/res/drawable-xhdpi/ic_loopback_call.png',
319 'examples/android/res/drawable-xhdpi/ic_launcher.png',
glaznev@webrtc.org7bb4a982014-10-22 17:43:37 +0000320 'examples/android/res/layout/activity_connect.xml',
321 'examples/android/res/layout/activity_fullscreen.xml',
322 'examples/android/res/layout/fragment_menubar.xml',
glaznev@webrtc.org243eb8e2014-10-27 17:22:15 +0000323 'examples/android/res/menu/connect_menu.xml',
324 'examples/android/res/values/arrays.xml',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000325 'examples/android/res/values/strings.xml',
glaznev@webrtc.org243eb8e2014-10-27 17:22:15 +0000326 'examples/android/res/xml/preferences.xml',
henrika@webrtc.org5e160662014-11-06 20:35:13 +0000327 'examples/android/src/org/appspot/apprtc/AppRTCAudioManager.java',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000328 'examples/android/src/org/appspot/apprtc/AppRTCClient.java',
329 'examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java',
glaznev@webrtc.org7bb4a982014-10-22 17:43:37 +0000330 'examples/android/src/org/appspot/apprtc/ConnectActivity.java',
glaznev@webrtc.org58202942014-10-17 17:42:38 +0000331 'examples/android/src/org/appspot/apprtc/PeerConnectionClient.java',
henrik.lundin@webrtc.org6f6ef722014-11-19 13:02:24 +0000332 'examples/android/src/org/appspot/apprtc/RoomParametersFetcher.java',
glaznev@webrtc.org243eb8e2014-10-27 17:22:15 +0000333 'examples/android/src/org/appspot/apprtc/SettingsActivity.java',
334 'examples/android/src/org/appspot/apprtc/SettingsFragment.java',
glaznev@webrtc.org58202942014-10-17 17:42:38 +0000335 'examples/android/src/org/appspot/apprtc/UnhandledExceptionHandler.java',
henrik.lundin@webrtc.org6f6ef722014-11-19 13:02:24 +0000336 'examples/android/src/org/appspot/apprtc/WebSocketChannelClient.java',
337 'examples/android/src/org/appspot/apprtc/WebSocketRTCClient.java',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000338 ],
339 'outputs': [
340 '<(PRODUCT_DIR)/AppRTCDemo-debug.apk',
341 ],
fischman@webrtc.orgdf7b1d62013-12-11 22:36:22 +0000342 'variables': {
fischman@webrtc.org000dde92013-12-20 22:49:35 +0000343 'ant_log': '../../<(INTERMEDIATE_DIR)/ant.log', # ../.. to compensate for the cd examples/android below.
fischman@webrtc.orgdf7b1d62013-12-11 22:36:22 +0000344 },
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000345 'action': [
346 'bash', '-ec',
henrike@webrtc.org723d6832013-07-12 16:04:50 +0000347 'rm -fr <(_outputs) examples/android/{bin,libs} && '
fischman@webrtc.org000dde92013-12-20 22:49:35 +0000348 'mkdir -p <(INTERMEDIATE_DIR) && ' # Must happen _before_ the cd below
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000349 'mkdir -p examples/android/libs/<(android_app_abi) && '
350 'cp <(PRODUCT_DIR)/libjingle_peerconnection.jar examples/android/libs/ &&'
henrik.lundin@webrtc.org6f6ef722014-11-19 13:02:24 +0000351 'cp examples/android/third_party/autobanh/autobanh.jar examples/android/libs/ &&'
perkj@webrtc.org128faba2014-12-11 12:25:57 +0000352 '<(android_strip) -o examples/android/libs/<(android_app_abi)/libjingle_peerconnection_so.so <(PRODUCT_DIR)/lib/libjingle_peerconnection_so.so &&'
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000353 'cd examples/android && '
kjellander@webrtc.org190b72a2014-04-15 08:35:49 +0000354 '{ ANDROID_SDK_ROOT=<(android_sdk_root) '
355 'ant debug > <(ant_log) 2>&1 || '
fischman@webrtc.orgdf7b1d62013-12-11 22:36:22 +0000356 ' { cat <(ant_log) ; exit 1; } } && '
357 'cd - > /dev/null && '
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000358 'cp examples/android/bin/AppRTCDemo-debug.apk <(_outputs)'
359 ],
360 },
361 ],
362 }, # target AppRTCDemo
363 ], # targets
364 }], # OS=="android"
365 ],
366}