Skip to content

Commit

Permalink
Use msys clang toolchain to build windows binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
TerrorJack committed Dec 3, 2022
1 parent b89244e commit 6ba1db8
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,42 +42,33 @@ jobs:

winbuild:
name: Windows Build
runs-on: windows-2019
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch:
- x64
- x86
env:
MSYS2_PATH_TYPE: inherit
MSYSTEM: MINGW64
CC: cl
CXX: cl
NINJA_FLAGS: -v
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Install ninja (Windows)
run: choco install ninja
- name: Build
shell: cmd
# vcvarsall.bat need explicit Visual Studio 2019 to be installed
- name: Build (x64)
if: matrix.arch == 'x64'
run: |
set "HOME=%CD%"
set CL_ARCH=${{ fromJson('{ "x86": "amd64_x86", "x64": "amd64" }')[matrix.arch] }}
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %CL_ARCH%
C:\msys64\usr\bin\bash.exe --login -c "make package"
- name: Run the testsuite
shell: cmd
C:\msys64\msys2_shell.cmd -clang64 -defterm -here -no-start -c "pacman --noconfirm --disable-download-timeout --needed -S base-devel git mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-toolchain && make package && make check"
- name: Build (x86)
if: matrix.arch == 'x86'
run: |
set "HOME=%CD%"
set CL_ARCH=${{ fromJson('{ "x86": "amd64_x86", "x64": "amd64" }')[matrix.arch] }}
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %CL_ARCH%
C:\msys64\usr\bin\bash.exe --login -c "make check"
C:\msys64\msys2_shell.cmd -clang32 -defterm -here -no-start -c "pacman --noconfirm --disable-download-timeout --needed -S base-devel git mingw-w64-clang-i686-cmake mingw-w64-clang-i686-ninja mingw-w64-clang-i686-toolchain && make package && make check"
- name: Does it work sans msys2?
run: |
C:\wasi-sdk\bin\clang.exe --version
C:\wasi-sdk\bin\llvm-ar.exe --version
C:\wasi-sdk\bin\wasm-ld.exe --version
- name: Upload artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
# Upload the dist folder. Give it a name according to the OS it was built for.
name: ${{ format( 'dist-windows-latest-{0}', matrix.arch) }}
Expand Down

0 comments on commit 6ba1db8

Please sign in to comment.