Skip to content

Cleanup CMake even more #11

Cleanup CMake even more

Cleanup CMake even more #11

Workflow file for this run

name: Windows Build with open source compilers
on: [push, pull_request]
jobs:
Windows:
runs-on: windows-latest
strategy:
matrix:
compiler: [clang-cl]
build_type: [Release, Debug]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: "Clang-cl: Define compiler version"
if: matrix.compiler == 'clang-cl'
run: |
$env:COMPILER_VERSION = "21"
Add-Content -Path $env:GITHUB_ENV -Value "COMPILER_VERSION=$env:COMPILER_VERSION"
- name: "Define package name"
run: |
$env:VERSION = if ($env:GITHUB_REF -and $env:GITHUB_REF -match "^refs/tags/(?<tag>.+)$") { $matches["tag"] } else { "dev" }
$env:PACKAGE_VERSION = "$env:VERSION-${{ matrix.compiler }}-$env:COMPILER_VERSION-x64-${{ matrix.build_type }}"
Add-Content -Path $env:GITHUB_ENV -Value "PACKAGE_VERSION=$env:PACKAGE_VERSION"
- name: "Clang-cl: Set up LLVM"
if: matrix.compiler == 'clang-cl'
uses: KyleMayes/install-llvm-action@98e68e10c96dffcb7bfed8b2144541a66b49aa02 # v2.0.8
with:
version: ${{ env.COMPILER_VERSION }}
- name: Install Ninja
run: choco install ninja
- name: Output environment information
run: |
cmake --version
ninja --version
${{ matrix.compiler }} --version
- name: "Configure CMake"
if: matrix.compiler == 'clang-cl'
run: |
cmake -S . -B build -G "Ninja" -DCMAKE_C_COMPILER=${{ matrix.compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCPACK_PACKAGE_VERSION="$env:PACKAGE_VERSION" -DUSE_STATIC_RUNTIME=ON
- name: Build with CMake
run: cmake --build build --config "${{ matrix.build_type }}"
- name: Create package
run: cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ env.PACKAGE_VERSION }}
path: build/win_flex_bison*.zip