Skip to content

Instantly share code, notes, and snippets.

@max-potapov
Created August 30, 2013 11:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save max-potapov/6389020 to your computer and use it in GitHub Desktop.
Save max-potapov/6389020 to your computer and use it in GitHub Desktop.
makeall script for fetch, build and run webrtc for ios
#!/bin/sh
# gclient can be found here:
# git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
# don't forget modify .bashrc:
# export PATH="$PATH":`pwd`/depot_tools
function fetch() {
echo "-- fetching webrtc"
gclient config http://webrtc.googlecode.com/svn/trunk/
echo "target_os = ['mac']" >> .gclient
gclient sync
sed -i "" '$d' .gclient
echo "target_os = ['ios', 'mac']" >> .gclient
gclient sync
echo "-- webrtc has been sucessfully fetched"
}
function wrbase() {
export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_objc=1"
export GYP_GENERATORS="ninja"
}
function wrios() {
wrbase
export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=armv7"
export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_ios"
export GYP_CROSSCOMPILE=1
}
function wrsim() {
wrbase
export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=ia32"
export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_sim"
export GYP_CROSSCOMPILE=1
}
function wrmac() {
wrbase
export GYP_DEFINES="$GYP_DEFINES OS=mac target_arch=x64"
export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_mac"
}
function build() {
echo "-- building webrtc"
pushd trunk
gclient runhooks
ninja -C out_sim/Debug iossim AppRTCDemo
popd
echo "-- webrtc has been sucessfully built"
}
function run() {
echo "-- running webrtc appdemo"
pushd trunk
./out_sim/Debug/iossim out_sim/Debug/AppRTCDemo.app
popd
}
function fail() {
echo "*** webrtc build failed"
exit 1
}
fetch || fail
wrsim || fail
build || fail
run || fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment