#!/bin/sh set -x set -e pacman --noconfirm --needed -S git base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-clang mingw-w64-x86_64-lld mingw-w64-x86_64-llvm git config core.abbrev 9 # Git is wrong for autocrlf being enabled by default on Windows. # git is mangling files on Windows by default. # This is the second bug I've tracked down to being caused by autocrlf. git config core.autocrlf false # Too late; the files are already mangled. git checkout . ZIGBUILDDIR="$(pwd)/build" PREFIX="$ZIGBUILDDIR/dist" CMAKEFLAGS="-DCMAKE_COLOR_MAKEFILE=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX -DZIG_STATIC=ON" mkdir $ZIGBUILDDIR cd $ZIGBUILDDIR cmake .. -G 'MSYS Makefiles' -DCMAKE_BUILD_TYPE=RelWithDebInfo $CMAKEFLAGS -DCMAKE_EXE_LINKER_FLAGS='-fuse-ld=lld -Wl,/debug,/pdb:zig.pdb' make -j$(nproc) install ./zig build test-behavior -Dskip-non-native -Dskip-release