diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2022-10-20 18:15:59 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-11-02 12:09:53 +0100 |
commit | 4d02d593b585b57ccc86023c65185031f642c8d8 (patch) | |
tree | d94f5c518650afd17f80e9207a5be9a281066a5b /scripts | |
parent | Simplify building multiple zstds for Android. (diff) | |
download | online-4d02d593b585b57ccc86023c65185031f642c8d8.tar.gz online-4d02d593b585b57ccc86023c65185031f642c8d8.zip |
zstd: build for iOS.
Change-Id: Ifa2df0a0f9cf5bdfad5a513a37b64632b3e0a84f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build-zstd-android.sh (renamed from scripts/build-zstd.sh) | 2 | ||||
-rwxr-xr-x | scripts/build-zstd-ios.sh | 42 |
2 files changed, 43 insertions, 1 deletions
diff --git a/scripts/build-zstd.sh b/scripts/build-zstd-android.sh index af998e1760..3916d131dc 100755 --- a/scripts/build-zstd.sh +++ b/scripts/build-zstd-android.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ $# -eq 0 ]; then - echo "build-zstd.sh <abs-path-to-ndk-toplevel> <abs-path-to-build-top-dir>" + echo "build-zstd-android.sh <abs-path-to-ndk-toplevel> <abs-path-to-build-top-dir>" exit; fi diff --git a/scripts/build-zstd-ios.sh b/scripts/build-zstd-ios.sh new file mode 100755 index 0000000000..8419093407 --- /dev/null +++ b/scripts/build-zstd-ios.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + echo "build-zstd-ios.sh <abs-path-to-build-top-dir>" + exit; +fi + +BUILD_PATH=$1 # eg. /opt/libreoffice/ + +PLATFORMS="OS OS64" + +mkdir -p $BUILD_PATH +cd $BUILD_PATH +if ! test -f ios-cmake/.git/config; then + git clone https://github.com/leetal/ios-cmake.git ios-cmake +fi +if ! test -f ios-zstd/.git/config; then + git clone https://github.com/facebook/zstd.git ios-zstd +fi +cd ios-zstd + +TOP_PATH=$BUILD_PATH/ios-zstd +rm -Rf $TOP_PATH/install +mkdir -p $TOP_PATH/install +for p in $PLATFORMS; do + echo "Building $p:" + mkdir -p $TOP_PATH/install/$p + cd $TOP_PATH/install/$p + rm -f CMakeCache.txt + CFLAGS="-isysroot `xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" + CXXFLAGS="-isysroot `xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" + cmake \ + -DCMAKE_TOOLCHAIN_FILE=$BUILD_PATH/ios-cmake/ios.toolchain.cmake -DPLATFORM=$p \ + -DENABLE_BITCODE=OFF \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + -DCMAKE_CXX_FLAGS="$CFLAGS" \ + -DDEPLOYMENT_TARGET=13.6 \ + -DCMAKE_BUILD_TYPE=Release \ + $TOP_PATH/build/cmake || exit 1; +# cmake --build . --config Release + make -j4 libzstd_static +done |