2019-09-11 19:27:06 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-05-06 21:58:41 +03:00
|
|
|
if [ "$1" == "clean" ]; then
|
|
|
|
rm -f CMakeCache.txt *.cmake
|
|
|
|
rm -rf out
|
|
|
|
rm -rf .buildtools
|
|
|
|
# make clean
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" == "release" ] || [ "$2" == "release" ]; then
|
2019-09-11 19:27:06 +03:00
|
|
|
BUILD_TYPE="Release"
|
|
|
|
else
|
|
|
|
BUILD_TYPE="Debug"
|
|
|
|
fi
|
|
|
|
|
2020-05-06 21:58:41 +03:00
|
|
|
if [ "$2" == "arm64" ] || [ "$3" == "arm64" ]; then
|
2020-02-05 01:27:51 +03:00
|
|
|
IOS_ARCH="arm64"
|
2020-05-06 21:58:41 +03:00
|
|
|
elif [ "$2" == "arm64e" ] || [ "$3" == "arm64e" ]; then
|
2020-02-05 01:27:51 +03:00
|
|
|
IOS_ARCH="arm64e"
|
2020-05-06 21:58:41 +03:00
|
|
|
elif [ "$2" == "x86_64" ] || [ "$2" == "simulator" ] || [ "$3" == "x86_64" ] || [ "$3" == "simulator" ]; then
|
2020-02-05 01:27:51 +03:00
|
|
|
IOS_ARCH="x86_64"
|
|
|
|
else
|
|
|
|
IOS_ARCH="x86_64"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set target iOS minver
|
2020-04-15 03:06:19 +03:00
|
|
|
IOS_DEPLOYMENT_TARGET=10.0
|
2020-02-05 01:27:51 +03:00
|
|
|
|
2019-09-11 19:27:06 +03:00
|
|
|
# Install build tools and recent sqlite3
|
|
|
|
FILE=.buildtools
|
|
|
|
OS_NAME=`uname -a`
|
|
|
|
if [ ! -f $FILE ]; then
|
2020-05-06 21:58:41 +03:00
|
|
|
tools/setup-buildtools-apple.sh ios
|
2019-09-11 19:27:06 +03:00
|
|
|
# Assume that the build tools have been successfully installed
|
|
|
|
echo > $FILE
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f /usr/bin/gcc ]; then
|
|
|
|
echo "gcc version: `gcc --version`"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f /usr/bin/clang ]; then
|
|
|
|
echo "clang version: `clang --version`"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p out
|
|
|
|
cd out
|
|
|
|
|
2019-09-26 19:59:33 +03:00
|
|
|
CMAKE_PACKAGE_TYPE=tgz
|
|
|
|
|
2020-02-05 01:27:51 +03:00
|
|
|
cmake -DBUILD_IOS=YES -DIOS_ARCH=$IOS_ARCH -DIOS_DEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DBUILD_UNIT_TESTS=YES -DBUILD_FUNC_TESTS=YES -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PACKAGE_TYPE=$CMAKE_PACKAGE_TYPE ..
|
2019-09-11 19:27:06 +03:00
|
|
|
make
|
|
|
|
|
|
|
|
make package
|