-
Notifications
You must be signed in to change notification settings - Fork 23
/
configure-iphone
executable file
·27 lines (23 loc) · 981 Bytes
/
configure-iphone
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
#! /bin/bash
unset CPATH
unset C_INCLUDE_PATH
unset CPLUS_INCLUDE_PATH
unset OBJC_INCLUDE_PATH
unset LIBS
unset DYLD_FALLBACK_LIBRARY_PATH
unset DYLD_FALLBACK_FRAMEWORK_PATH
if [ $# -lt 1 ]; then
echo "Usage: $0 sdk_version"
exit 1
fi
export SDKVER=$1
shift
export DEVROOT="/Developer/Platforms/iPhoneOS.platform/Developer"
export SDKROOT="$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk"
export PKG_CONFIG_PATH="$SDKROOT/usr/lib/pkgconfig":"$SDKROOT/opt/iphone-$SDKVER/lib/pkgconfig":"$SDKROOT/usr/local/iphone-$SDKVER/lib/pkgconfig"
export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH"
# OK, this is really weird... running CMake can fail the first few times. It looks like you need to run it a few times to get
# the values that you SET to propagate around, because if you don't the linker flags etc that get used are outdated
for i in 1 2 3; do
cmake . -DSDKVER=$SDKVER -DCMAKE_TOOLCHAIN_FILE="cmake-toolchains/iphone.toolchain" -DCMAKE_INSTALL_PREFIX="/opt/iphone-$SDKVER" "$@"
done