Skip to content

Instantly share code, notes, and snippets.

@dant3
Forked from max-potapov/makeall-ios.sh
Last active December 31, 2015 22:09
Show Gist options
  • Save dant3/8051955 to your computer and use it in GitHub Desktop.
Save dant3/8051955 to your computer and use it in GitHub Desktop.
#!/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 = ['android']" >> .gclient
gclient sync
sed -i "" '$d' .gclient
echo "target_os = ['android']" >> .gclient
gclient sync
echo "-- webrtc has been sucessfully fetched"
}
function wrbase() {
export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0"
export GYP_GENERATORS="ninja"
}
function wrarmv7() {
wrbase
export GYP_DEFINES="$GYP_DEFINES OS=android target_arch=armv7"
export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_armv7"
export GYP_CROSSCOMPILE=1
}
function wrx86() {
wrbase
export GYP_DEFINES="$GYP_DEFINES OS=android target_arch=ia32"
export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_x86"
export GYP_CROSSCOMPILE=1
}
function wrlinux() {
wrbase
export GYP_DEFINES="$GYP_DEFINES OS=linux target_arch=x64"
export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_linux"
}
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
wrx86 || fail
wrarmv7 || fail
build || fail
run || fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment