blob: 7cb6ac90aadd033a435d40a384fa1715fe1b0cad [file] [log] [blame]
kjellander@webrtc.org006acc42013-04-20 13:04:05 +00001#!/bin/bash
sjlee@webrtc.org1fea17d2013-04-18 23:22:02 +00002
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
kjellander@webrtc.org006acc42013-04-20 13:04:05 +000032 echo "@@@STEP_FAILURE@@@"
sjlee@webrtc.org1fea17d2013-04-18 23:22:02 +000033 exit 1
34 fi
35}
36
37# change the working directory to trunk
38cd "$( dirname "${BASH_SOURCE[0]}" )/../.."
39
40# build setting
41CONFIGURATION_BUILD_DIR=./xcodebuild
42CONFIGURATION=Debug
43GYPDEF="OS=ios target_arch=arm armv7=1 arm_neon=1 enable_video=0 include_opus=1"
44
45export GYP_DEFINES=$GYPDEF
kjellander@webrtc.org006acc42013-04-20 13:04:05 +000046echo "[Running gclient runhooks...]"
47echo "@@@BUILD_STEP runhooks@@@"
48gclient runhooks
49if [ "$?" != "0" ]; then
50 echo "[Error] gclient runhooks failed!" 1>&2
51 echo "@@@STEP_FAILURE@@@"
52 exit 2
53fi
54echo "[Projects updated]\n"
sjlee@webrtc.org1fea17d2013-04-18 23:22:02 +000055
kjellander@webrtc.org006acc42013-04-20 13:04:05 +000056echo "@@@BUILD_STEP compile@@@"
57echo "[Building XCode projects...]"
sjlee@webrtc.org1fea17d2013-04-18 23:22:02 +000058array_target_module=(
59 "bitrate_controller" "media_file" "paced_sender" "remote_bitrate_estimator"
60 "webrtc_utility" "rtp_rtcp" "CNG" "G711" "G722" "iLBC" "iSACFix" "PCM16B"
61 "audio_coding_module" "NetEq" "audio_conference_mixer" "audio_device"
62 "audio_processing" "iSAC" "isac_neon" "audio_processing_neon" "webrtc_opus"
63)
64array_target_opus=("opus")
65
66build_project "webrtc/common_audio/common_audio.xcodeproj"
67build_project "webrtc/modules/modules.xcodeproj" array_target_module[@]
68build_project "webrtc/system_wrappers/source/system_wrappers.xcodeproj"
69build_project "webrtc/voice_engine/voice_engine.xcodeproj"
70build_project "third_party/opus/opus.xcodeproj" array_target_opus[@]
kjellander@webrtc.org006acc42013-04-20 13:04:05 +000071echo "[Building XCode projects is successful]\n"
sjlee@webrtc.org1fea17d2013-04-18 23:22:02 +000072
73exit 0