sjlee@webrtc.org | 1fea17d | 2013-04-18 23:22:02 +0000 | [diff] [blame] | 1 | #!/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 | |
| 11 | function 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 |
| 37 | cd "$( dirname "${BASH_SOURCE[0]}" )/../.." |
| 38 | |
| 39 | # build setting |
| 40 | CONFIGURATION_BUILD_DIR=./xcodebuild |
| 41 | CONFIGURATION=Debug |
| 42 | GYPDEF="OS=ios target_arch=arm armv7=1 arm_neon=1 enable_video=0 include_opus=1" |
| 43 | |
| 44 | export GYP_DEFINES=$GYPDEF |
| 45 | # update gyp settings |
| 46 | echo '[Updating gyp settings...]' |
| 47 | ./build/gyp_chromium --depth=. webrtc.gyp |
| 48 | echo '[Updated]\n' |
| 49 | |
| 50 | # build the xcode projects |
| 51 | echo '[Building xcode projects...]' |
| 52 | array_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 | ) |
| 58 | array_target_opus=("opus") |
| 59 | |
| 60 | build_project "webrtc/common_audio/common_audio.xcodeproj" |
| 61 | build_project "webrtc/modules/modules.xcodeproj" array_target_module[@] |
| 62 | build_project "webrtc/system_wrappers/source/system_wrappers.xcodeproj" |
| 63 | build_project "webrtc/voice_engine/voice_engine.xcodeproj" |
| 64 | build_project "third_party/opus/opus.xcodeproj" array_target_opus[@] |
| 65 | echo '[Building xcode projects is successful]\n' |
| 66 | |
| 67 | exit 0 |