libreoffice-online/scripts/build-zstd-android.sh
Michael Meeks 4d02d593b5 zstd: build for iOS.
Change-Id: Ifa2df0a0f9cf5bdfad5a513a37b64632b3e0a84f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-11-02 12:09:53 +01:00

36 lines
989 B
Bash
Executable file

#!/bin/bash
if [ $# -eq 0 ]; then
echo "build-zstd-android.sh <abs-path-to-ndk-toplevel> <abs-path-to-build-top-dir>"
exit;
fi
NDK_PATH=$1 # eg. /opt/libreoffice/android-ndk-r20b
BUILD_PATH=$2 # eg. /opt/libreoffice/
PLATFORMS="armeabi-v7a arm64-v8a x86 x86_64"
mkdir -p $BUILD_PATH
cd $BUILD_PATH
if ! test -f android-zstd/.git/config; then
git clone https://android.googlesource.com/platform/external/zstd/ android-zstd
fi
cd android-zstd
TOP_PATH=$BUILD_PATH/android-zstd
mkdir -p $TOP_PATH/install
for p in $PLATFORMS; do
echo "Building $p:"
mkdir -p $TOP_PATH/install/$p
cd $TOP_PATH/install/$p
cmake \
-DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=$p \
-DCMAKE_ANDROID_ARCH_ABI=$p \
-DANDROID_NDK=${NDK_PATH} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_SYSTEM_VERSION=21 \
$TOP_PATH/build/cmake || exit 1;
make
done