Commit e7d8819b authored by Felix Paul Kühne's avatar Felix Paul Kühne

ios compilation script: add support for future Xcode releases

(cherry picked from commit c8803e34fe597809dd5b558e0cdcc811c0cc41fd)
parent ab5b0c5b
...@@ -5,6 +5,7 @@ PLATFORM=OS ...@@ -5,6 +5,7 @@ PLATFORM=OS
VERBOSE=no VERBOSE=no
SDK_VERSION=7.0 SDK_VERSION=7.0
SDK_MIN=5.1 SDK_MIN=5.1
64BIT_SDK_MIN=7.0
ARCH=armv7 ARCH=armv7
usage() usage()
...@@ -130,15 +131,22 @@ export STRIP="xcrun strip" ...@@ -130,15 +131,22 @@ export STRIP="xcrun strip"
export PLATFORM=$PLATFORM export PLATFORM=$PLATFORM
export SDK_VERSION=$SDK_VERSION export SDK_VERSION=$SDK_VERSION
export CFLAGS="-isysroot ${SDKROOT} -arch ${ARCH} ${OPTIM}"
if [ "$PLATFORM" = "OS" ]; then if [ "$PLATFORM" = "OS" ]; then
export CFLAGS="-isysroot ${SDKROOT} -arch ${ARCH} -miphoneos-version-min=${SDK_MIN} ${OPTIM}"
if [ "$ARCH" != "arm64" ]; then if [ "$ARCH" != "arm64" ]; then
export CFLAGS="${CFLAGS} -mcpu=cortex-a8" export CFLAGS="${CFLAGS} -mcpu=cortex-a8 -miphoneos-version-min=${SDK_MIN}"
else
export CFLAGS="${CFLAGS} -miphoneos-version-min=${64BIT_SDK_MIN}"
fi fi
else else
export CFLAGS="-isysroot ${SDKROOT} -arch ${ARCH} -miphoneos-version-min=${SDK_MIN} ${OPTIM}" if [ "$ARCH" != "x86_64" ]; then
export CFLAGS="${CFLAGS} -miphoneos-version-min=${SDK_MIN}"
else
export CFLAGS="${CFLAGS} -miphoneos-version-min=${64BIT_SDK_MIN}"
fi fi
export CXXFLAGS="${CFLAGS} -stdlib=libstdc++"
export CPPFLAGS="${CFLAGS}" export CPPFLAGS="${CFLAGS}"
export CPP="xcrun cc -E" export CPP="xcrun cc -E"
...@@ -151,21 +159,35 @@ if [ "$PLATFORM" = "Simulator" ]; then ...@@ -151,21 +159,35 @@ if [ "$PLATFORM" = "Simulator" ]; then
export OBJCFLAGS="-fobjc-abi-version=2 -fobjc-legacy-dispatch ${OBJCFLAGS}" export OBJCFLAGS="-fobjc-abi-version=2 -fobjc-legacy-dispatch ${OBJCFLAGS}"
fi fi
export LDFLAGS="-L${SDKROOT}/usr/lib -arch ${ARCH} -isysroot ${SDKROOT} -miphoneos-version-min=${SDK_MIN}" export LDFLAGS="-L${SDKROOT}/usr/lib -arch ${ARCH} -isysroot ${SDKROOT}"
if [ "$PLATFORM" = "OS" ]; then if [ "$PLATFORM" = "OS" ]; then
EXTRA_CFLAGS="-arch ${ARCH}" EXTRA_CFLAGS="-arch ${ARCH}"
if [ "$ARCH" != "arm64" ]; then if [ "$ARCH" != "arm64" ]; then
EXTRA_CFLAGS+=" -mcpu=cortex-a8" EXTRA_CFLAGS+=" -mcpu=cortex-a8"
EXTRA_CFLAGS+=" -miphoneos-version-min=${SDK_MIN}"
EXTRA_LDFLAGS+=" -miphoneos-version-min=${SDK_MIN}"
export LDFLAGS="${LDFLAGS} -miphoneos-version-min=${SDK_MIN}"
else
EXTRA_CFLAGS+=" -miphoneos-version-min=${64BIT_SDK_MIN}"
EXTRA_LDFLAGS+=" -miphoneos-version-min=${64BIT_SDK_MIN}"
export LDFLAGS="${LDFLAGS} -miphoneos-version-min=${64BIT_SDK_MIN}"
fi fi
EXTRA_LDFLAGS="-arch ${ARCH}" EXTRA_LDFLAGS="-arch ${ARCH}"
else else
EXTRA_CFLAGS="-arch ${ARCH}" EXTRA_CFLAGS="-arch ${ARCH}"
EXTRA_LDFLAGS="-arch ${ARCH}" EXTRA_LDFLAGS="-arch ${ARCH}"
if [ "$ARCH" != "x86_64" ]; then
EXTRA_CFLAGS+=" -miphoneos-version-min=${SDK_MIN}"
EXTRA_LDFLAGS+=" -miphoneos-version-min=${SDK_MIN}"
export LDFLAGS="${LDFLAGS} -miphoneos-version-min=${SDK_MIN}"
else
EXTRA_CFLAGS+=" -miphoneos-version-min=${64BIT_SDK_MIN}"
EXTRA_LDFLAGS+=" -miphoneos-version-min=${64BIT_SDK_MIN}"
export LDFLAGS="${LDFLAGS} -miphoneos-version-min=${64BIT_SDK_MIN}"
fi
fi fi
EXTRA_CFLAGS+=" -miphoneos-version-min=${SDK_MIN}"
EXTRA_LDFLAGS+=" -miphoneos-version-min=${SDK_MIN}"
info "LD FLAGS SELECTED = '${LDFLAGS}'" info "LD FLAGS SELECTED = '${LDFLAGS}'"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment