# shellcheck shell=sh # Toolchain environment for cross-building the toolkit for Windows # (x86_64-pc-windows-gnu) on Linux. One definition, used by # scripts/build-gui-windows.sh locally and by the CI Windows job: # # . scripts/windows-cross-env.sh # export into this shell # sh scripts/windows-cross-env.sh --github-env # append to $GITHUB_ENV # # WX_WINDOWS_PREFIX selects the wxMSW prefix built by build-wx-windows.sh. # `cargo test --target x86_64-pc-windows-gnu` runs the test .exe files through # scripts/wine-run.sh, so the Windows build is unit-tested on every Linux host. # The posix-threads mingw variants are required: libstdc++'s std::thread and # the wx build both use them, and mixing in the win32-thread variant at link # time fails on missing pthread symbols. WX_WINDOWS_PREFIX="${WX_WINDOWS_PREFIX:-$HOME/.cache/wx-3.3.3-mingw}" ALKANE_WIN_TARGET=x86_64-pc-windows-gnu # Sourced scripts cannot rely on $0, so locate the checkout through git. ALKANE_REPO="${ALKANE_REPO:-$(git rev-parse --show-toplevel)}" _alkane_win_env() { cat <> "${GITHUB_ENV:?GITHUB_ENV is required}" else eval "$(_alkane_win_env | sed 's/^/export /')" fi