File: BuildUniversal.sh

package info (click to toggle)
zbar 0.23.93-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,324 kB
  • sloc: ansic: 33,723; objc: 5,735; cpp: 3,289; python: 1,144; java: 818; sh: 720; xml: 716; perl: 491; makefile: 362
file content (23 lines) | stat: -rwxr-xr-x 902 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
set -ux
SUBTARGET=${1:?}
OUTDIR=${2:-$TARGET_BUILD_DIR}

# build library for device and simulator
xcodebuild -target $SUBTARGET -configuration $CONFIGURATION -sdk iphoneos BUILD_DIR=$BUILD_DIR BUILD_ROOT=$BUILD_ROOT\
    || exit 1
xcodebuild -target $SUBTARGET -configuration $CONFIGURATION -sdk iphonesimulator BUILD_DIR=$BUILD_DIR BUILD_ROOT=$BUILD_ROOT\
    || exit 1

mkdir -p $OUTDIR

# combine device and simulator libs into single fat lib.
# others have indicated that this approach is "wrong", but for us
# the ease of including the universal lib in a project without complicated
# changes to build settings outweighs any lack of purity in the approach
# ...we can always fix things later, if necessary
lipo -create \
    $BUILD_ROOT/$CONFIGURATION-iphoneos/$SUBTARGET.a \
    $BUILD_ROOT/$CONFIGURATION-iphonesimulator/$SUBTARGET.a \
    -output $OUTDIR/$SUBTARGET.a \
    || exit 1