From 1fea17dae4ec577897791b2e3f2c36d44885462b Mon Sep 17 00:00:00 2001 From: "sjlee@webrtc.org" Date: Thu, 18 Apr 2013 23:22:02 +0000 Subject: [PATCH] Add the build script of the voice engine for iOS. Review URL: https://webrtc-codereview.appspot.com/1319007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3873 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/build/ios-webrtc.sh | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 webrtc/build/ios-webrtc.sh diff --git a/webrtc/build/ios-webrtc.sh b/webrtc/build/ios-webrtc.sh new file mode 100755 index 0000000000..5dc2b830be --- /dev/null +++ b/webrtc/build/ios-webrtc.sh @@ -0,0 +1,67 @@ +#!/bin/sh + +# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +function build_project() { + # make the target string + if [[ -z "$2" ]]; then + target_string="" + else + declare -a arg_target=("${!2}") + + for item in ${arg_target[*]} + do + temp_string="-target $item " + target_string=$target_string$temp_string + done + fi + + # xcodebuild + xcodebuild -project "$1" -sdk iphoneos \ + -configuration ${CONFIGURATION} \ + -CONFIGURATION_BUILD_DIR=${CONFIGURATION_BUILD_DIR} $target_string + + if [ "$?" != "0" ]; then + echo "[Error] build $1 failed!" 1>&2 + exit 1 + fi +} + +# change the working directory to trunk +cd "$( dirname "${BASH_SOURCE[0]}" )/../.." + +# build setting +CONFIGURATION_BUILD_DIR=./xcodebuild +CONFIGURATION=Debug +GYPDEF="OS=ios target_arch=arm armv7=1 arm_neon=1 enable_video=0 include_opus=1" + +export GYP_DEFINES=$GYPDEF +# update gyp settings +echo '[Updating gyp settings...]' +./build/gyp_chromium --depth=. webrtc.gyp +echo '[Updated]\n' + +# build the xcode projects +echo '[Building xcode projects...]' +array_target_module=( + "bitrate_controller" "media_file" "paced_sender" "remote_bitrate_estimator" + "webrtc_utility" "rtp_rtcp" "CNG" "G711" "G722" "iLBC" "iSACFix" "PCM16B" + "audio_coding_module" "NetEq" "audio_conference_mixer" "audio_device" + "audio_processing" "iSAC" "isac_neon" "audio_processing_neon" "webrtc_opus" +) +array_target_opus=("opus") + +build_project "webrtc/common_audio/common_audio.xcodeproj" +build_project "webrtc/modules/modules.xcodeproj" array_target_module[@] +build_project "webrtc/system_wrappers/source/system_wrappers.xcodeproj" +build_project "webrtc/voice_engine/voice_engine.xcodeproj" +build_project "third_party/opus/opus.xcodeproj" array_target_opus[@] +echo '[Building xcode projects is successful]\n' + +exit 0