blob: 5dc2b830be098c84595c348a2e184be8914c7c2e [file] [log] [blame]
sjlee@webrtc.org1fea17d2013-04-18 23:22:02 +00001#!/bin/sh
2
3# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
4#
5# Use of this source code is governed by a BSD-style license
6# that can be found in the LICENSE file in the root of the source
7# tree. An additional intellectual property rights grant can be found
8# in the file PATENTS. All contributing project authors may
9# be found in the AUTHORS file in the root of the source tree.
10
11function build_project() {
12 # make the target string
13 if [[ -z "$2" ]]; then
14 target_string=""
15 else
16 declare -a arg_target=("${!2}")
17
18 for item in ${arg_target[*]}
19 do
20 temp_string="-target $item "
21 target_string=$target_string$temp_string
22 done
23 fi
24
25 # xcodebuild
26 xcodebuild -project "$1" -sdk iphoneos \
27 -configuration ${CONFIGURATION} \
28 -CONFIGURATION_BUILD_DIR=${CONFIGURATION_BUILD_DIR} $target_string
29
30 if [ "$?" != "0" ]; then
31 echo "[Error] build $1 failed!" 1>&2
32 exit 1
33 fi
34}
35
36# change the working directory to trunk
37cd "$( dirname "${BASH_SOURCE[0]}" )/../.."
38
39# build setting
40CONFIGURATION_BUILD_DIR=./xcodebuild
41CONFIGURATION=Debug
42GYPDEF="OS=ios target_arch=arm armv7=1 arm_neon=1 enable_video=0 include_opus=1"
43
44export GYP_DEFINES=$GYPDEF
45# update gyp settings
46echo '[Updating gyp settings...]'
47./build/gyp_chromium --depth=. webrtc.gyp
48echo '[Updated]\n'
49
50# build the xcode projects
51echo '[Building xcode projects...]'
52array_target_module=(
53 "bitrate_controller" "media_file" "paced_sender" "remote_bitrate_estimator"
54 "webrtc_utility" "rtp_rtcp" "CNG" "G711" "G722" "iLBC" "iSACFix" "PCM16B"
55 "audio_coding_module" "NetEq" "audio_conference_mixer" "audio_device"
56 "audio_processing" "iSAC" "isac_neon" "audio_processing_neon" "webrtc_opus"
57)
58array_target_opus=("opus")
59
60build_project "webrtc/common_audio/common_audio.xcodeproj"
61build_project "webrtc/modules/modules.xcodeproj" array_target_module[@]
62build_project "webrtc/system_wrappers/source/system_wrappers.xcodeproj"
63build_project "webrtc/voice_engine/voice_engine.xcodeproj"
64build_project "third_party/opus/opus.xcodeproj" array_target_opus[@]
65echo '[Building xcode projects is successful]\n'
66
67exit 0