#!/usr/bin/env bash # CI helper: Windows x86_64 release with Debian's mingw-w64 UCRT gcc. # apt-get install gcc-mingw-w64-ucrt64 binutils-mingw-w64-ucrt64 nsis (trixie+) # Checks the toolchain, then runs bootstrap_windows.sh, which builds the # third-party libs, cst-agent.exe, the zip and the NSIS installer. set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" export MINGW_HOST="${MINGW_HOST:-x86_64-w64-mingw32ucrt}" export BUILD_CC="${BUILD_CC:-cc}" export CST_REQUIRE_NSIS=1 need() { command -v "$1" >/dev/null || { echo "missing $1" >&2; exit 1; }; } need "$MINGW_HOST-gcc" need "$MINGW_HOST-windres" need cmake; need ninja; need perl; need zip; need git; need make; need makensis if ! printf '#include \n' | "$MINGW_HOST-gcc" -dM -E - | grep -qw _UCRT; then echo "$MINGW_HOST-gcc is not UCRT" >&2 exit 1 fi "$MINGW_HOST-gcc" --version | head -1 # Do not set a global insteadOf: a single broken proxy (e.g. gitclone 502) # would take down every third_party clone. build_third_party_mingw.sh tries # several mirrors per repo instead. echo "==> bootstrap_windows.sh" exec bash scripts/bootstrap_windows.sh "$ROOT"