Skip to content
This repository was archived by the owner on Sep 6, 2026. It is now read-only.

Build W++ for Windows (llvm-mingw) #22

Build W++ for Windows (llvm-mingw)

Build W++ for Windows (llvm-mingw) #22

Workflow file for this run

name: Build W++ for Windows (llvm-mingw)
on:
workflow_dispatch: # manual trigger only
jobs:
build-windows:
name: Build W++ (Windows via llvm-mingw)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Install Rust and Windows target
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-gnu
- name: Install MinGW binutils (for dlltool etc.)
run: sudo apt-get update && sudo apt-get install -y binutils-mingw-w64
- name: Download llvm-mingw toolchain
run: |
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20220906/llvm-mingw-20220906-msvcrt-x86_64.zip -O llvm-mingw.zip
unzip llvm-mingw.zip -d llvm-mingw
echo "$(pwd)/llvm-mingw/bin" >> $GITHUB_PATH
export PATH="$(pwd)/llvm-mingw/bin:$PATH"
ls llvm-mingw/llvm-mingw-20220906-msvcrt-x86_64/bin
- name: Configure environment for cross-compilation
run: |
# Verify clang exists
which x86_64-w64-mingw32-clang || echo "clang not found in PATH!"
echo "CC_x86_64_pc_windows_gnu=x86_64-w64-mingw32-clang" >> $GITHUB_ENV
echo "CXX_x86_64_pc_windows_gnu=x86_64-w64-mingw32-clang++" >> $GITHUB_ENV
echo "AR_x86_64_pc_windows_gnu=x86_64-w64-mingw32-ar" >> $GITHUB_ENV
echo "CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-clang" >> $GITHUB_ENV
echo "RUSTFLAGS=-C linker=lld" >> $GITHUB_ENV
- name: Build W++ compiler
run: cargo build -p wpp-cli --release --target x86_64-pc-windows-gnu --verbose
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: wpp-windows
path: target/x86_64-pc-windows-gnu/release/wpp-cli.exe