-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·60 lines (41 loc) · 1.26 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
VERSION="1.1.11r2"
CONFIGURATIONS="Release"
IOS_SDKS="iphoneos iphonesimulator"
IOS_VERSION=""
set -e
set -x
BUILD_DIR="$(mktemp -d -t EngineRoom-build)"
[ -z "$BUILD_DIR" ] && echo 1>&2 "$0: could not create temporary build directory" && exit 1
options="BUILD_DIR=$BUILD_DIR"
for conf in $CONFIGURATIONS ; do
output="$BUILD_DIR/EngineRoom-$VERSION-$conf"
mkdir -p "$output"
done
cd EngineRoom-OSX
product=EngineRoom.framework
for conf in $CONFIGURATIONS ; do
output="$BUILD_DIR/EngineRoom-$VERSION-$conf"
xcodebuild $options -configuration $conf clean
xcodebuild $options -configuration $conf build
mv "$BUILD_DIR/$conf/$product" "$output"
done
cd ..
cd EngineRoom-iOS
product=libEngineRoom.a
for conf in $CONFIGURATIONS ; do
output="$BUILD_DIR/EngineRoom-$VERSION-$conf"
lipo_inputs=""
for sdk in $IOS_SDKS ; do
xcodebuild $options -sdk "$sdk$IOS_VERSION" -configuration $conf clean
xcodebuild $options -sdk "$sdk$IOS_VERSION" -configuration $conf build
lipo_inputs="$lipo_inputs $BUILD_DIR/$conf-$sdk/$product"
done
mkdir "$output/lib"
lipo -create $lipo_inputs -output "$output/lib/$product"
cp -r "$BUILD_DIR/$conf-$sdk/include" "$output"
done
cd ..
echo
echo Build results in
echo "$BUILD_DIR"