mirror of
https://github.com/Nexoniarz/Finch.git
synced 2026-11-03 00:44:27 +00:00
Windows support (wip): target layer, Microsoft x64 ABI, portable runtime, CI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8497251dc5
commit
84cbbb3e16
18 changed files with 481 additions and 94 deletions
79
.github/workflows/ci.yml
vendored
Normal file
79
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, "ci/**"]
|
||||
tags: ["v*"]
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
LLVM_VERSION: 21.1.8
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install LLVM 21, libclang, tools
|
||||
run: |
|
||||
wget -q https://apt.llvm.org/llvm.sh
|
||||
sudo bash llvm.sh 21
|
||||
sudo apt-get install -y llvm-21-dev libclang-21-dev ninja-build valgrind
|
||||
echo "/usr/lib/llvm-21/bin" >> $GITHUB_PATH
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja -DLLVM_DIR=/usr/lib/llvm-21/lib/cmake/llvm -DCMAKE_BUILD_TYPE=Release
|
||||
ninja -C build
|
||||
build/finch version
|
||||
- name: Tests
|
||||
run: tests/run.sh
|
||||
- name: Tests under valgrind
|
||||
run: MEMCHECK=1 tests/run.sh
|
||||
- name: Self-hosting
|
||||
run: tests/boot.sh
|
||||
|
||||
windows:
|
||||
runs-on: windows-2022
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- name: Cache LLVM
|
||||
id: cache-llvm
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: C:/llvm
|
||||
key: llvm-${{ env.LLVM_VERSION }}-x86_64-pc-windows-msvc
|
||||
- name: Download LLVM ${{ env.LLVM_VERSION }}
|
||||
if: steps.cache-llvm.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
curl -sSL -o llvm.tar.xz "https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-pc-windows-msvc.tar.xz"
|
||||
mkdir -p /c/llvm
|
||||
tar -xf llvm.tar.xz -C /c/llvm --strip-components=1
|
||||
rm llvm.tar.xz
|
||||
- name: Build finch.exe
|
||||
run: |
|
||||
echo "C:/llvm/bin" >> $GITHUB_PATH
|
||||
export PATH="/c/llvm/bin:$PATH"
|
||||
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=C:/llvm/lib/cmake/llvm \
|
||||
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl
|
||||
ninja -C build
|
||||
cp /c/llvm/bin/libclang.dll build/
|
||||
build/finch.exe version
|
||||
- name: Tests
|
||||
run: |
|
||||
export PATH="/c/llvm/bin:$PATH"
|
||||
tests/run.sh
|
||||
- name: Package
|
||||
run: |
|
||||
mkdir -p dist/finch
|
||||
cp build/finch.exe build/libclang.dll dist/finch/
|
||||
cp README.md LICENSE dist/finch/
|
||||
cp -r examples dist/finch/
|
||||
cd dist && 7z a -tzip finch-windows-x64.zip finch > /dev/null
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: finch-windows-x64
|
||||
path: dist/finch-windows-x64.zip
|
||||
Loading…
Reference in a new issue