Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MediaArea/ZenLib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Gervais <gervais.maxime@gmail.com>2021-01-21 14:59:11 +0300
committerMaxime Gervais <gervais.maxime@gmail.com>2021-01-21 14:59:11 +0300
commite788a04d83afdab40d3eb33757a269b28b2a405c (patch)
tree0060b90fe88754e7ce6d57395800416cce97b463 /Project
parent2f0c1b80a4032c310d267903f9a1d627369492f1 (diff)
Add build script for iOS
Signed-off-by: Maxime Gervais <gervais.maxime@gmail.com>
Diffstat (limited to 'Project')
-rwxr-xr-xProject/iOS/build.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/Project/iOS/build.sh b/Project/iOS/build.sh
new file mode 100755
index 0000000..a60288b
--- /dev/null
+++ b/Project/iOS/build.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+PLATFORMPATH="/Applications/Xcode.app/Contents/Developer/Platforms"
+
+export IPHONEOS_DEPLOYMENT_TARGET="8.0"
+
+build_lib()
+{
+ target=$1
+ platform=$2
+ prefix=$3
+
+ host=$target
+ if [[ $host == "x86_64" ]]; then
+ host="i386"
+ elif [[ $host == "arm64" ]]; then
+ host="arm"
+ fi
+
+ export CC="$(xcrun -sdk iphoneos -find clang)"
+ export CXX="$(xcrun -sdk iphoneos -find clang++)"
+ export AR="$(xcrun -sdk iphoneos -find ar)"
+ export RANLIB="$(xcrun -sdk iphoneos -find ranlib)"
+ export CFLAGS="-stdlib=libc++ -fembed-bitcode -arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform.sdk -miphoneos-version-min=$IPHONEOS_DEPLOYMENT_TARGET"
+ export CXXFLAGS="-stdlib=libc++ -fembed-bitcode -arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform.sdk -miphoneos-version-min=$IPHONEOS_DEPLOYMENT_TARGET"
+ export LDFLAGS="-stdlib=libc++ -fembed-bitcode -arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform.sdk"
+
+ pushd "$(dirname "${BASH_SOURCE[0]}")/../GNU/Library"
+ ./configure --prefix="$prefix" --disable-shared --enable-static --host=$host-apple-darwin
+ make clean
+ make
+ make install
+ popd
+}
+
+build_lib armv7 iPhoneOS "$PWD/native/armv7"
+build_lib armv7s iPhoneOS "$PWD/native/armv7s"
+build_lib arm64 iPhoneOS "$PWD/native/arm64"
+build_lib i386 iPhoneSimulator "$PWD/native/i386"
+build_lib x86_64 iPhoneSimulator "$PWD/native/x86_64"
+
+LIPO=$(xcrun -sdk iphoneos -find lipo)
+
+$LIPO -create $PWD/native/armv7/lib/libzen.a $PWD/native/armv7s/lib/libzen.a $PWD/native/arm64/lib/libzen.a $PWD/native/x86_64/lib/libzen.a $PWD/native/i386/lib/libzen.a -output $PWD/libzen.a