• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1This directory contains the ObjectiveC implementation of the
2webrtc::PeerConnection API.  This can be built for Mac or iOS.  This
3file describes building the API, unit test, and AppRTCDemo sample app.
4
5Prerequisites:
6- Make sure gclient is checking out tools necessary to target iOS: your
7  .gclient file should contain a line like:
8  target_os = ['ios', 'mac']
9  Make sure to re-run gclient sync after adding this to download the tools.
10
11- Set up webrtc-related $GYP_DEFINES; example shell functions that set
12  up for building for iOS-device, iOS-simulator, and Mac (resp) are:
13function wrbase() {
14  cd /path/to/webrtc/trunk
15  export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0"
16  export GYP_GENERATORS="ninja"
17}
18
19function wrios() {
20  wrbase
21  export GYP_DEFINES="$GYP_DEFINES OS=ios"
22  export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_ios"
23  export GYP_CROSSCOMPILE=1
24}
25
26function wrios32() {
27  wrios
28  export GYP_DEFINES="$GYP_DEFINES target_arch=arm"
29}
30
31function wrios64() {
32  wrios
33  export GYP_DEFINES="$GYP_DEFINES target_arch=arm64"
34}
35
36function wrsim() {
37  wrbase
38  export GYP_DEFINES="$GYP_DEFINES OS=ios target_subarch=arm32 target_arch=ia32"
39  export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_sim"
40  export GYP_CROSSCOMPILE=1
41}
42
43function wrmac() {
44  wrbase
45  export GYP_DEFINES="$GYP_DEFINES OS=mac target_subarch=arm64 target_arch=x64"
46  export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_mac"
47}
48
49- Finally, run "webrtc/build/gyp_webrtc" to generate ninja files.
50
51Example of building & using the unittest & app:
52
53- To build & run the unittest (must target mac):
54  wrmac && ./webrtc/build/gyp_webrtc && \
55      ninja -C out_mac/Debug libjingle_peerconnection_objc_test && \
56      ./out_mac/Debug/libjingle_peerconnection_objc_test.app/Contents/MacOS/libjingle_peerconnection_objc_test
57
58- To build & launch the sample app on OSX:
59  wrmac && ./webrtc/build/gyp_webrtc && ninja -C out_mac/Debug AppRTCDemo && \
60      ./out_mac/Debug/AppRTCDemo.app/Contents/MacOS/AppRTCDemo
61
62- To build & launch the sample app on the iOS simulator:
63  wrsim && ./webrtc/build/gyp_webrtc && ninja -C out_sim/Debug iossim AppRTCDemo && \
64      ./out_sim/Debug/iossim out_sim/Debug/AppRTCDemo.app
65
66- To build & sign the sample app for an iOS device (32 bit):
67  wrios32 && ./webrtc/build/gyp_webrtc && ninja -C out_ios/Debug-iphoneos AppRTCDemo
68
69- To build & sign the sample app for an iOS device (64 bit):
70  wrios64 && ./webrtc/build/gyp_webrtc && ninja -C out_ios/Debug-iphoneos AppRTCDemo
71