Files
Build-System/.gitea/scripts/install-mingw.sh
T
faumaray 67b89c7d3a
VoidBuildSystem CI / 1 · Requirements (push) Successful in 9s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Failing after 32s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Failing after 32s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Skipped
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4B · Windows package (debug) (push) Skipped
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 2m39s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 3m27s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 5m44s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 5 · Release (push) Skipped
ci(windows): use the prebuilt MinGW-w64 GCC 16 UCRT cross toolchain
The runner only ships apt's MinGW-w64 GCC 10, which cannot compile
C++26 reflection. install-mingw.sh now downloads AmanoTeam's
mingw-gcc-cross gcc-16 release (x86_64 Linux host, GCC 16.2.1 with
-freflection) into /opt and the Wine build uses its CMake toolchain
file. The _WIN32_WINNT/NTDDI_VERSION target level is set for Windows so
MinGW headers declare the APIs VoidLibrary uses (e.g.
DUPLICATE_EXTENTS_DATA).

Verified locally: all Windows targets build with this toolchain, vbs
runs under Wine and the SDK suite passes 17/17.
2026-12-06 07:02:41 +03:00

34 lines
1.2 KiB
Bash

#!/usr/bin/env bash
# Installs the MinGW-w64 GCC 16 cross toolchain (UCRT) used to build VBS for
# Windows from Linux: https://github.com/AmanoTeam/mingw-gcc-cross (gcc-16).
#
# Usage: install-mingw.sh [PREFIX] (default /opt/mingw-gcc-cross)
set -euo pipefail
release=gcc-16
host=x86_64-unknown-linux-gnu
url="https://github.com/AmanoTeam/mingw-gcc-cross/releases/download/${release}/${host}.tar.xz"
prefix="${1:-/opt/mingw-gcc-cross}"
if [ -x "${prefix}/bin/x86_64-w64-mingw32-ucrt-g++" ]; then
echo "using the existing MinGW-w64 toolchain at ${prefix}"
else
sudo=""
if [ "$(id -u)" -ne 0 ]; then sudo="sudo"; fi
tmp="$(mktemp -d)"
trap 'rm -rf "${tmp}"' EXIT
if command -v curl >/dev/null 2>&1; then
curl -fsSL "${url}" -o "${tmp}/toolchain.tar.xz"
else
wget -qO "${tmp}/toolchain.tar.xz" "${url}"
fi
mkdir -p "${tmp}/toolchain"
tar -xJf "${tmp}/toolchain.tar.xz" -C "${tmp}/toolchain" --strip-components=1
${sudo} rm -rf "${prefix}"
${sudo} mkdir -p "${prefix}"
${sudo} cp -a "${tmp}/toolchain/." "${prefix}/"
fi
"${prefix}/bin/x86_64-w64-mingw32-ucrt-g++" --version | head -n1
echo "toolchain file: ${prefix}/usr/local/share/mingw/cmake/x86_64-w64-mingw32-ucrt.cmake"