updated Makefile.msvc for making it to work with jom #114
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2026 Giovanni MARIANO | |
| # | |
| # SPDX-License-Identifier: MPL-2.0 | |
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| compiler: [gcc, clang] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y valgrind libomp-dev | |
| - name: Build (debug) | |
| run: make full cli tools CC=${{ matrix.compiler }} USE_OPENMP=1 | |
| - name: Run unit tests | |
| run: make test-unit CC=${{ matrix.compiler }} USE_OPENMP=1 | |
| - name: Run integration tests | |
| run: make test-integration CC=${{ matrix.compiler }} USE_OPENMP=1 | |
| - name: Run Lua tests | |
| run: make test-lua CC=${{ matrix.compiler }} USE_OPENMP=1 | |
| - name: Valgrind check (gcc only) | |
| if: matrix.compiler == 'gcc' | |
| run: make test-valgrind CC=${{ matrix.compiler }} USE_OPENMP=1 | |
| - name: Build (release) | |
| run: make clean && make full cli tools RELEASE=1 CC=${{ matrix.compiler }} USE_OPENMP=1 | |
| build-macos: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-15, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Install OpenMP | |
| run: brew install libomp | |
| - name: Build | |
| run: make full cli tools USE_OPENMP=1 | |
| - name: Run tests | |
| run: make test-unit test-integration test-lua USE_OPENMP=1 | |
| - name: Build (release) | |
| run: make clean && make full cli tools RELEASE=1 USE_OPENMP=1 | |
| build-windows: | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: UCRT64 | |
| update: true | |
| install: >- | |
| mingw-w64-ucrt-x86_64-gcc | |
| mingw-w64-ucrt-x86_64-make | |
| mingw-w64-ucrt-x86_64-omp | |
| make | |
| - name: Build | |
| run: make full cli tools USE_OPENMP=1 | |
| - name: Run tests | |
| run: make test-unit test-integration test-lua USE_OPENMP=1 | |
| build-windows-conda-gnu-ucrt: | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - uses: conda-incubator/setup-miniconda@v4 | |
| with: | |
| activate-environment: libalea-conda-gnu | |
| auto-activate: false | |
| channel-priority: strict | |
| channels: conda-forge/label/m2w64-experimental,conda-forge | |
| - name: Install conda MinGW-w64 UCRT toolchain | |
| run: | | |
| for attempt in 1 2 3; do | |
| conda install -y \ | |
| mingw-w64-ucrt-x86_64-gcc \ | |
| mingw-w64-ucrt-x86_64-binutils \ | |
| make && break | |
| if [ "$attempt" -eq 3 ]; then | |
| exit 1 | |
| fi | |
| conda clean -i -y || true | |
| sleep $((attempt * 20)) | |
| done | |
| cc_bin="$(command -v x86_64-w64-mingw32-gcc)" | |
| ar_bin="$("$cc_bin" -print-prog-name=ar)" | |
| if ! "$ar_bin" --version >/dev/null 2>&1; then | |
| ar_bin="$("$cc_bin" -print-prog-name=x86_64-w64-mingw32-ar)" | |
| fi | |
| if [ -z "$cc_bin" ] || [ -z "$ar_bin" ]; then | |
| echo "Could not determine conda MinGW-w64 compiler tools" | |
| exit 1 | |
| fi | |
| echo "WINDOWS_GNU_CC=$cc_bin" >> "$GITHUB_ENV" | |
| echo "WINDOWS_GNU_AR=$ar_bin" >> "$GITHUB_ENV" | |
| "$cc_bin" --version | |
| "$ar_bin" --version | |
| - name: Build (conda MinGW-w64 UCRT) | |
| run: > | |
| make WINDOWS_GNU=1 | |
| CC="$WINDOWS_GNU_CC" | |
| AR="$WINDOWS_GNU_AR" | |
| full cli tools | |
| - name: Run tests (conda MinGW-w64 UCRT) | |
| run: > | |
| make WINDOWS_GNU=1 | |
| CC="$WINDOWS_GNU_CC" | |
| AR="$WINDOWS_GNU_AR" | |
| test-unit test-integration test-lua | |
| build-windows-conda-clang-jom: | |
| # Genuinely Visual-Studio-free build: conda clang-cl + jom (Qt's nmake clone) | |
| # invoked directly, NOT via build-msvc.ps1 (that wrapper requires VS for | |
| # nmake/vcvars). This mirrors what a contributor with conda-only gets, and | |
| # guards against nmake-only constructs the wrapper job would never hit | |
| # (e.g. batch-mode `.obj::` inference rules, which jom does not support). | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - uses: conda-incubator/setup-miniconda@v4 | |
| with: | |
| activate-environment: libalea-conda-clang-jom | |
| auto-activate: false | |
| channel-priority: strict | |
| channels: conda-forge | |
| - name: Install conda clang-cl toolchain + jom | |
| shell: pwsh | |
| run: | | |
| conda install -y clang_win-64 jom | |
| where.exe clang-cl | |
| where.exe llvm-lib | |
| where.exe jom | |
| - name: Build static libraries (conda clang-cl + jom, no VS) | |
| shell: pwsh | |
| # /J 1 keeps the build serial so the `dirs` target creates the output | |
| # directories before the inference rules write .obj into them. | |
| run: jom /J 1 /f Makefile.msvc CONDA_CLANG=1 full | |
| - name: Run tests (conda clang-cl + jom, no VS) | |
| shell: pwsh | |
| run: jom /J 1 /f Makefile.msvc CONDA_CLANG=1 test | |
| build-windows-msvc: | |
| # Native MSVC (cl.exe) build via the self-contained wrapper, which locates VS | |
| # with vswhere and enters the x64 dev env itself — no msvc-dev-cmd needed. | |
| # Non-blocking while the MSVC path is still being hardened; flip | |
| # continue-on-error off once it is reliably green. | |
| runs-on: windows-latest | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Build static libraries (MSVC) | |
| shell: pwsh | |
| run: ./build-msvc.ps1 full | |
| - name: Run tests (MSVC) | |
| shell: pwsh | |
| run: ./build-msvc.ps1 test | |
| reuse-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: REUSE compliance check | |
| uses: fsfe/reuse-action@v6 |