aarch64-macos-debug.sh (1471B) - Raw
1 #!/bin/sh 2 3 set -x 4 set -e 5 6 # Script assumes the presence of the following: 7 # s3cmd 8 9 ZIGDIR="$PWD" 10 TARGET="$ARCH-macos-none" 11 MCPU="baseline" 12 CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460" 13 PREFIX="$HOME/$CACHE_BASENAME" 14 ZIG="$PREFIX/bin/zig" 15 16 if [ ! -d "$PREFIX" ]; then 17 cd $HOME 18 curl -L -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" 19 tar xf "$CACHE_BASENAME.tar.xz" 20 fi 21 22 cd $ZIGDIR 23 24 # Make the `zig version` number consistent. 25 # This will affect the cmake command below. 26 git fetch --unshallow || true 27 git fetch --tags 28 29 # Override the cache directories because they won't actually help other CI runs 30 # which will be testing alternate versions of zig, and ultimately would just 31 # fill up space on the hard drive for no reason. 32 export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" 33 export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" 34 35 mkdir build-debug 36 cd build-debug 37 38 PATH="$HOME/local/bin:$PATH" cmake .. \ 39 -DCMAKE_INSTALL_PREFIX="stage3-debug" \ 40 -DCMAKE_PREFIX_PATH="$PREFIX" \ 41 -DCMAKE_BUILD_TYPE=Debug \ 42 -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ 43 -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ 44 -DZIG_TARGET_TRIPLE="$TARGET" \ 45 -DZIG_TARGET_MCPU="$MCPU" \ 46 -DZIG_STATIC=ON \ 47 -DZIG_NO_LIB=ON \ 48 -GNinja 49 50 $HOME/local/bin/ninja install 51 52 stage3-debug/bin/zig build test docs \ 53 --zig-lib-dir "$PWD/../lib" \ 54 -Denable-macos-sdk \ 55 -Dstatic-llvm \ 56 -Dskip-non-native \ 57 --search-prefix "$PREFIX"