sjlee@webrtc.org | d690eab | 2013-08-14 22:07:04 +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 | set -e |
| 11 | |
| 12 | # TODO(sjlee): remove this whole script file. |
| 13 | # (https://code.google.com/p/webrtc/issues/detail?id=2028) |
| 14 | function build_project() { |
| 15 | # make the target string |
| 16 | local target_string="" |
| 17 | if [[ -n "$2" ]]; then |
| 18 | target_string="-target $2" |
| 19 | fi |
| 20 | |
| 21 | xcodebuild -project "$1" -sdk iphoneos -arch armv7 \ |
| 22 | -configuration ${CONFIGURATION} \ |
| 23 | -CONFIGURATION_BUILD_DIR=${CONFIGURATION_BUILD_DIR} $target_string |
| 24 | } |
| 25 | |
| 26 | # change the working directory to trunk |
| 27 | cd "$( dirname "$0" )/../.." |
| 28 | |
| 29 | # build setting |
| 30 | CONFIGURATION_BUILD_DIR=./xcodebuild |
| 31 | CONFIGURATION=Debug |
| 32 | export GYP_DEFINES="OS=ios target_arch=arm armv7=1 arm_neon=1" |
| 33 | # TODO(sjlee): remove this script. |
| 34 | # (https://webrtc-codereview.appspot.com/1874005) |
| 35 | |
| 36 | # update gyp settings |
| 37 | echo '[Updating gyp settings...]' |
| 38 | gclient runhooks |
| 39 | ./build/gyp_chromium --depth=. \ |
| 40 | webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_components.gyp |
| 41 | ./build/gyp_chromium --depth=. \ |
| 42 | webrtc/modules/video_coding/utility/video_coding_utility.gyp |
| 43 | ./build/gyp_chromium --depth=. third_party/opus/opus.gyp |
| 44 | ./build/gyp_chromium --depth=. third_party/libyuv/libyuv.gyp |
| 45 | ./build/gyp_chromium --depth=. third_party/libjpeg/libjpeg.gyp |
| 46 | |
| 47 | # build the xcode projects |
| 48 | echo '[Building xcode projects...]' |
| 49 | |
| 50 | build_project "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_components.xcodeproj" |
| 51 | build_project "webrtc/modules/video_coding/utility/video_coding_utility.xcodeproj" |
| 52 | build_project "third_party/opus/opus.xcodeproj" "opus" |
| 53 | build_project "third_party/libjpeg/libjpeg.xcodeproj" |
| 54 | build_project "third_party/libyuv/libyuv.xcodeproj" |
| 55 | |
| 56 | # build the libvpx |
| 57 | cd third_party/libvpx/source/libvpx |
| 58 | |
| 59 | ./configure --target=armv7-darwin-gcc --disable-vp9 \ |
| 60 | --libc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk |
| 61 | |
| 62 | make |
| 63 | |
| 64 | cd - |
| 65 | |
| 66 | cp third_party/libvpx/source/libvpx/libvpx.a \ |
| 67 | ${CONFIGURATION_BUILD_DIR}/${CONFIGURATION}-iphoneos |
| 68 | |
| 69 | echo "[Building xcode projects is success...]\n" |