| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645 |
- name: CI
- on:
- push:
- branches: [ "master" ]
- pull_request:
- branches: [ "master" ]
- jobs:
- build_autotools:
- name: Autotools / ${{ matrix.os }} / ${{ matrix.simd }}
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- include:
- # x86/x64 builds
- - { os: macos-13, simd: none }
- - { os: macos-13, simd: sse }
- - { os: macos-13, simd: sse2 }
- - { os: macos-13, simd: sse3 }
- - { os: macos-13, simd: sse4 }
- - { os: macos-13, simd: avx }
- - { os: macos-13, simd: avx2 }
- - { os: macos-14, simd: none }
- - { os: macos-14, simd: sse }
- - { os: macos-14, simd: sse2 }
- - { os: macos-14, simd: sse3 }
- - { os: macos-14, simd: sse4 }
- - { os: macos-14, simd: avx }
- - { os: macos-14, simd: avx2 }
- - { os: ubuntu-22.04, simd: none }
- - { os: ubuntu-22.04, simd: sse }
- - { os: ubuntu-22.04, simd: sse2 }
- - { os: ubuntu-22.04, simd: sse3 }
- - { os: ubuntu-22.04, simd: sse4 }
- - { os: ubuntu-22.04, simd: avx }
- - { os: ubuntu-22.04, simd: avx2 }
- - { os: ubuntu-24.04, simd: none }
- - { os: ubuntu-24.04, simd: sse }
- - { os: ubuntu-24.04, simd: sse2 }
- - { os: ubuntu-24.04, simd: sse3 }
- - { os: ubuntu-24.04, simd: sse4 }
- - { os: ubuntu-24.04, simd: avx }
- - { os: ubuntu-24.04, simd: avx2 }
- # ARM64 builds
- - { os: ubuntu-latest-arm64, simd: neon }
- steps:
- - uses: actions/checkout@v4
- - name: Install Autotools on macOS
- if: runner.os == 'macOS'
- run: brew upgrade && brew install autoconf automake libtool
- - name: Install Autotools on Ubuntu
- if: matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04'
- run: sudo apt-get install -y autoconf automake libtool
- - name: Set SIMD flags
- run: |
- if [ "${{ matrix.simd }}" == "none" ]; then
- export CFLAGS=""
- elif [ "${{ matrix.simd }}" == "sse" ]; then
- export CFLAGS="-msse"
- elif [ "${{ matrix.simd }}" == "sse2" ]; then
- export CFLAGS="-msse2"
- elif [ "${{ matrix.simd }}" == "sse3" ]; then
- export CFLAGS="-msse3"
- elif [ "${{ matrix.simd }}" == "sse4" ]; then
- export CFLAGS="-msse4"
- elif [ "${{ matrix.simd }}" == "avx" ]; then
- export CFLAGS="-mavx"
- elif [ "${{ matrix.simd }}" == "avx2" ]; then
- export CFLAGS="-mavx2"
- elif [ "${{ matrix.simd }}" == "neon" ]; then
- export CFLAGS="-mfpu=neon"
- fi
- - name: Generate Autotools
- run: ./autogen.sh
- - name: Configure Autotools
- run: ./configure CFLAGS="$CFLAGS"
- - name: Build
- run: make
- - name: Test
- run: make check
- build_cmake_ios:
- name: CMake / iOS
- runs-on: macos-14
- steps:
- - uses: actions/checkout@v4
- - name: Configure CMake
- run: |
- cmake \
- -B build \
- -GXcode \
- -DCMAKE_SYSTEM_NAME=iOS \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO \
- -DCGLM_STATIC=ON \
- -DCGLM_USE_TEST=ON
- - name: Build
- run: cmake --build build
- build_cmake_ubuntu:
- name: CMake / ${{ matrix.target.os }} / ${{ matrix.target.cc }} / ${{ matrix.target.arch }} / ${{ matrix.target.simd }}
- runs-on: ${{ matrix.target.arch == 'arm64' && 'ubuntu-latest-arm64' || matrix.target.os }}
- strategy:
- fail-fast: false
- matrix:
- target:
- # GCC 11 builds
- - { os: ubuntu-20.04, cc: gcc-11, arch: x64, simd: none }
- - { os: ubuntu-20.04, cc: gcc-11, arch: x64, simd: sse }
- - { os: ubuntu-20.04, cc: gcc-11, arch: x64, simd: sse2 }
- - { os: ubuntu-20.04, cc: gcc-11, arch: x64, simd: sse3 }
- - { os: ubuntu-20.04, cc: gcc-11, arch: x64, simd: sse4 }
- - { os: ubuntu-20.04, cc: gcc-11, arch: x64, simd: avx }
- - { os: ubuntu-20.04, cc: gcc-11, arch: x64, simd: avx2 }
- # GCC 12 builds
- - { os: ubuntu-22.04, cc: gcc-12, arch: x64, simd: none }
- - { os: ubuntu-22.04, cc: gcc-12, arch: x64, simd: sse }
- - { os: ubuntu-22.04, cc: gcc-12, arch: x64, simd: sse2 }
- - { os: ubuntu-22.04, cc: gcc-12, arch: x64, simd: sse3 }
- - { os: ubuntu-22.04, cc: gcc-12, arch: x64, simd: sse4 }
- - { os: ubuntu-22.04, cc: gcc-12, arch: x64, simd: avx }
- - { os: ubuntu-22.04, cc: gcc-12, arch: x64, simd: avx2 }
- # GCC 13 builds
- - { os: ubuntu-24.04, cc: gcc-13, arch: x64, simd: none }
- - { os: ubuntu-24.04, cc: gcc-13, arch: x64, simd: sse }
- - { os: ubuntu-24.04, cc: gcc-13, arch: x64, simd: sse2 }
- - { os: ubuntu-24.04, cc: gcc-13, arch: x64, simd: sse3 }
- - { os: ubuntu-24.04, cc: gcc-13, arch: x64, simd: sse4 }
- - { os: ubuntu-24.04, cc: gcc-13, arch: x64, simd: avx }
- - { os: ubuntu-24.04, cc: gcc-13, arch: x64, simd: avx2 }
- # Clang 12 builds
- - { os: ubuntu-20.04, cc: clang-12, arch: x64, simd: none }
- - { os: ubuntu-20.04, cc: clang-12, arch: x64, simd: sse }
- - { os: ubuntu-20.04, cc: clang-12, arch: x64, simd: sse2 }
- - { os: ubuntu-20.04, cc: clang-12, arch: x64, simd: sse3 }
- - { os: ubuntu-20.04, cc: clang-12, arch: x64, simd: sse4 }
- - { os: ubuntu-20.04, cc: clang-12, arch: x64, simd: avx }
- - { os: ubuntu-20.04, cc: clang-12, arch: x64, simd: avx2 }
- # Clang 15 builds
- - { os: ubuntu-22.04, cc: clang-15, arch: x64, simd: none }
- - { os: ubuntu-22.04, cc: clang-15, arch: x64, simd: sse }
- - { os: ubuntu-22.04, cc: clang-15, arch: x64, simd: sse2 }
- - { os: ubuntu-22.04, cc: clang-15, arch: x64, simd: sse3 }
- - { os: ubuntu-22.04, cc: clang-15, arch: x64, simd: sse4 }
- - { os: ubuntu-22.04, cc: clang-15, arch: x64, simd: avx }
- - { os: ubuntu-22.04, cc: clang-15, arch: x64, simd: avx2 }
- # ARM64 builds
- - { os: ubuntu-latest, cc: gcc-12, arch: arm64, simd: neon }
- - { os: ubuntu-latest, cc: gcc-13, arch: arm64, simd: neon }
- # ARMv7 builds
- - { os: ubuntu-latest-arm64, cc: gcc-12, arch: armv7, simd: neon }
- - { os: ubuntu-latest-arm64, cc: gcc-12, arch: armv7, simd: none }
- steps:
- - uses: actions/checkout@v4
- - name: Add Ubuntu Toolchain PPA
- if: matrix.target.os == 'ubuntu-20.04'
- run: |
- sudo apt-get update
- sudo apt-get install -y software-properties-common
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- - name: Install Compiler and Ninja
- run: |
- sudo apt-get install -y ${{ matrix.target.cc }} ninja-build
- - name: Set SIMD flags
- run: |
- if [ "${{ matrix.simd }}" == "none" ]; then
- export CFLAGS=""
- elif [ "${{ matrix.simd }}" == "sse" ]; then
- export CFLAGS="-msse"
- elif [ "${{ matrix.simd }}" == "sse2" ]; then
- export CFLAGS="-msse2"
- elif [ "${{ matrix.simd }}" == "sse3" ]; then
- export CFLAGS="-msse3"
- elif [ "${{ matrix.simd }}" == "sse4" ]; then
- export CFLAGS="-msse4"
- elif [ "${{ matrix.simd }}" == "avx" ]; then
- export CFLAGS="-mavx"
- elif [ "${{ matrix.simd }}" == "avx2" ]; then
- export CFLAGS="-mavx2"
- elif [ "${{ matrix.simd }}" == "neon" ]; then
- export CFLAGS="-mfpu=neon"
- fi
- - name: Configure CMake
- run: |
- if [ "${{ matrix.target.arch }}" == "armv7" ]; then
- # Build for ARMv7
- neon_flags=""
- if [ "${{ matrix.simd }}" == "neon" ]; then
- neon_flags="-mfpu=neon -mfloat-abi=hard"
- fi
- cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_C_COMPILER=${{ matrix.target.cc }} \
- -DCMAKE_C_FLAGS="$CFLAGS -m32 -march=armv7-a ${neon_flags}" \
- -DCGLM_STATIC=ON -DCGLM_USE_TEST=ON
- elif [ "${{ matrix.target.arch }}" == "arm64" ]; then
- # Build for ARM64 (AArch64)
- neon_flags=""
- if [ "${{ matrix.simd }}" == "neon" ]; then
- neon_flags="+simd" # Enable SIMD/NEON features on ARM64
- else
- neon_flags="+nosimd" # Explicitly disable SIMD/NEON
- fi
- cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_C_COMPILER=${{ matrix.target.cc }} \
- -DCMAKE_C_FLAGS="$CFLAGS -march=armv8-a${neon_flags}" \
- -DCGLM_STATIC=ON -DCGLM_USE_TEST=ON
- else
- # Normal build (x86/x64)
- cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_C_COMPILER=${{ matrix.target.cc }} \
- -DCMAKE_C_FLAGS="$CFLAGS" \
- -DCGLM_STATIC=ON -DCGLM_USE_TEST=ON
- fi
- - name: Build
- run: cmake --build build
- - name: Test
- working-directory: build
- run: ./tests
- build_cmake_macos:
- name: CMake / ${{ matrix.os }}
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [macos-13, macos-14]
- steps:
- - uses: actions/checkout@v4
- - name: Install Ninja
- if: runner.os == 'macOS'
- run: brew upgrade && brew install ninja
- - name: Configure CMake
- run: |
- cmake \
- -B build \
- -GNinja \
- -DCMAKE_BUILD_TYPE=Release \
- -DCGLM_STATIC=ON \
- -DCGLM_USE_TEST=ON
- - name: Build
- run: cmake --build build
- - name: Test
- working-directory: build
- run: ./tests
- build_cmake:
- name: CMake / ${{ matrix.os }} / ${{ matrix.simd }}
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- include:
- # x86/x64 builds
- - { os: macos-13, simd: none }
- - { os: macos-13, simd: sse }
- - { os: macos-13, simd: sse2 }
- - { os: macos-13, simd: sse3 }
- - { os: macos-13, simd: sse4 }
- - { os: macos-13, simd: avx }
- - { os: macos-13, simd: avx2 }
- - { os: macos-14, simd: none }
- - { os: macos-14, simd: sse }
- - { os: macos-14, simd: sse2 }
- - { os: macos-14, simd: sse3 }
- - { os: macos-14, simd: sse4 }
- - { os: macos-14, simd: avx }
- - { os: macos-14, simd: avx2 }
- - { os: windows-2022, simd: none }
- - { os: windows-2022, simd: sse }
- - { os: windows-2022, simd: sse2 }
- - { os: windows-2022, simd: sse3 }
- - { os: windows-2022, simd: sse4 }
- - { os: windows-2022, simd: avx }
- - { os: windows-2022, simd: avx2 }
- # ARM64 builds
- - { os: macos-14-arm64, simd: neon }
- steps:
- - uses: actions/checkout@v4
- - name: Install Ninja on macOS
- if: runner.os == 'macOS'
- run: brew upgrade && brew install ninja
- - name: Set SIMD flags (Windows)
- if: runner.os == 'Windows'
- shell: pwsh
- run: |
- $simd = "${{ matrix.simd }}"
- if ($simd -eq "none") {
- $env:CFLAGS = ""
- } elseif ($simd -eq "sse") {
- $env:CFLAGS = "-arch:SSE"
- } elseif ($simd -eq "sse2") {
- $env:CFLAGS = "-arch:SSE2"
- } elseif ($simd -eq "sse3") {
- $env:CFLAGS = "-arch:SSE3"
- } elseif ($simd -eq "sse4") {
- $env:CFLAGS = "-arch:SSE4"
- } elseif ($simd -eq "avx") {
- $env:CFLAGS = "-arch:AVX"
- } elseif ($simd -eq "avx2") {
- $env:CFLAGS = "-arch:AVX2"
- } elseif ($simd -eq "neon") {
- $env:CFLAGS = "-arch:NEON"
- }
- - name: Set SIMD flags (Unix)
- if: runner.os != 'Windows'
- shell: bash
- run: |
- if [ "${{ matrix.simd }}" == "none" ]; then
- export CFLAGS=""
- elif [ "${{ matrix.simd }}" == "sse" ]; then
- export CFLAGS="-msse"
- elif [ "${{ matrix.simd }}" == "sse2" ]; then
- export CFLAGS="-msse2"
- elif [ "${{ matrix.simd }}" == "sse3" ]; then
- export CFLAGS="-msse3"
- elif [ "${{ matrix.simd }}" == "sse4" ]; then
- export CFLAGS="-msse4"
- elif [ "${{ matrix.simd }}" == "avx" ]; then
- export CFLAGS="-mavx"
- elif [ "${{ matrix.simd }}" == "avx2" ]; then
- export CFLAGS="-mavx2"
- elif [ "${{ matrix.simd }}" == "neon" ]; then
- export CFLAGS="-mfpu=neon"
- fi
- - name: Configure CMake (Windows)
- if: runner.os == 'Windows'
- shell: pwsh
- run: cmake -B build -G "Visual Studio 17 2022" -A x64 -T host=x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="$env:CFLAGS" -DCGLM_STATIC=ON -DCGLM_USE_TEST=ON
- - name: Configure CMake (Unix)
- if: runner.os != 'Windows'
- shell: bash
- run: cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="$CFLAGS" -DCGLM_STATIC=ON -DCGLM_USE_TEST=ON
- - name: Build
- run: cmake --build build
- - name: Test (Windows)
- if: runner.os == 'Windows'
- shell: pwsh
- working-directory: build
- run: .\Debug\tests.exe
- - name: Test (Unix)
- if: runner.os != 'Windows'
- shell: bash
- working-directory: build
- run: ./tests
- build_meson:
- name: Meson / ${{ matrix.os }} / ${{ matrix.simd }}
- runs-on: ${{ contains(matrix.os, 'arm64') && 'ubuntu-latest-arm64' || matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- include:
- # x86/x64 builds
- - { os: macos-14, simd: none }
- - { os: macos-14, simd: sse }
- - { os: macos-14, simd: sse2 }
- - { os: macos-14, simd: sse3 }
- - { os: macos-14, simd: sse4 }
- - { os: macos-14, simd: avx }
- - { os: macos-14, simd: avx2 }
- - { os: ubuntu-22.04, simd: none }
- - { os: ubuntu-22.04, simd: sse }
- - { os: ubuntu-22.04, simd: sse2 }
- - { os: ubuntu-22.04, simd: sse3 }
- - { os: ubuntu-22.04, simd: sse4 }
- - { os: ubuntu-22.04, simd: avx }
- - { os: ubuntu-22.04, simd: avx2 }
- - { os: ubuntu-24.04, simd: none }
- - { os: ubuntu-24.04, simd: sse }
- - { os: ubuntu-24.04, simd: sse2 }
- - { os: ubuntu-24.04, simd: sse3 }
- - { os: ubuntu-24.04, simd: sse4 }
- - { os: ubuntu-24.04, simd: avx }
- - { os: ubuntu-24.04, simd: avx2 }
- - { os: windows-2022, simd: none }
- - { os: windows-2022, simd: sse }
- - { os: windows-2022, simd: sse2 }
- - { os: windows-2022, simd: sse3 }
- - { os: windows-2022, simd: sse4 }
- - { os: windows-2022, simd: avx }
- - { os: windows-2022, simd: avx2 }
- # ARM64 builds
- - { os: ubuntu-latest-arm64, simd: neon }
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: '3.12'
- cache: 'pip'
- - name: Install meson
- run: python3 -m pip install meson ninja
- - name: Set SIMD flags (Windows)
- if: runner.os == 'Windows'
- shell: pwsh
- run: |
- $simd = "${{ matrix.simd }}"
- if ($simd -eq "none") {
- $env:CFLAGS = ""
- } elseif ($simd -eq "sse") {
- $env:CFLAGS = "-arch:SSE"
- } elseif ($simd -eq "sse2") {
- $env:CFLAGS = "-arch:SSE2"
- } elseif ($simd -eq "sse3") {
- $env:CFLAGS = "-arch:SSE3"
- } elseif ($simd -eq "sse4") {
- $env:CFLAGS = "-arch:SSE4"
- } elseif ($simd -eq "avx") {
- $env:CFLAGS = "-arch:AVX"
- } elseif ($simd -eq "avx2") {
- $env:CFLAGS = "-arch:AVX2"
- } elseif ($simd -eq "neon") {
- $env:CFLAGS = "-arch:NEON"
- }
- - name: Set SIMD flags (Unix)
- if: runner.os != 'Windows'
- shell: bash
- run: |
- if [ "${{ matrix.simd }}" == "none" ]; then
- export CFLAGS=""
- elif [ "${{ matrix.simd }}" == "sse" ]; then
- export CFLAGS="-msse"
- elif [ "${{ matrix.simd }}" == "sse2" ]; then
- export CFLAGS="-msse2"
- elif [ "${{ matrix.simd }}" == "sse3" ]; then
- export CFLAGS="-msse3"
- elif [ "${{ matrix.simd }}" == "sse4" ]; then
- export CFLAGS="-msse4"
- elif [ "${{ matrix.simd }}" == "avx" ]; then
- export CFLAGS="-mavx"
- elif [ "${{ matrix.simd }}" == "avx2" ]; then
- export CFLAGS="-mavx2"
- elif [ "${{ matrix.simd }}" == "neon" ]; then
- export CFLAGS="-mfpu=neon"
- fi
- - name: Build with meson (Windows)
- if: runner.os == 'Windows'
- shell: pwsh
- run: |
- meson setup build -Dbuildtype=release --default-library=static -Dbuild_tests=true -Dc_args="$env:CFLAGS"
- meson test -C build
- - name: Build with meson (Unix)
- if: runner.os != 'Windows'
- shell: bash
- run: |
- meson setup build -Dbuildtype=release --default-library=static -Dbuild_tests=true -Dc_args="$CFLAGS"
- meson test -C build
- build_msbuild:
- name: MSBuild / Windows / ${{ matrix.simd }}
- runs-on: windows-2022
- strategy:
- fail-fast: false
- matrix:
- simd: [none, sse, sse2, sse3, sse4, avx, avx2, neon]
- steps:
- - uses: actions/checkout@v4
- - uses: microsoft/setup-msbuild@v2
- - name: Retarget solution
- run: |
- vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
- $vsInstallPath = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
- & "$vsInstallPath\Common7\IDE\devenv.com" cglm.sln /Upgrade
- - name: Set SIMD flags
- run: |
- if ($Env:SIMD -eq 'none') {
- $Env:CFLAGS=""
- } elseif ($Env:SIMD -eq 'sse') {
- $Env:CFLAGS="-arch:SSE"
- } elseif ($Env:SIMD -eq 'sse2') {
- $Env:CFLAGS="-arch:SSE2"
- } elseif ($Env:SIMD -eq 'sse3') {
- $Env:CFLAGS="-arch:SSE3"
- } elseif ($Env:SIMD -eq 'sse4') {
- $Env:CFLAGS="-arch:SSE4"
- } elseif ($Env:SIMD -eq 'avx') {
- $Env:CFLAGS="-arch:AVX"
- } elseif ($Env:SIMD -eq 'avx2') {
- $Env:CFLAGS="-arch:AVX2"
- } elseif ($Env:SIMD -eq 'neon') {
- $Env:CFLAGS="-arch:NEON"
- }
- - name: Build (x86)
- working-directory: win
- run: msbuild cglm.vcxproj /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v143 /p:BuildInParallel=true /p:AdditionalOptions="$Env:CFLAGS"
- - name: Build (x64)
- working-directory: win
- run: msbuild cglm.vcxproj /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /p:BuildInParallel=true /p:AdditionalOptions="$Env:CFLAGS"
- build_documentation:
- name: Documentation
- runs-on: ubuntu-22.04
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: '3.12'
- - name: Install Dependencies
- working-directory: docs
- run: python3 -m pip install -r requirements.txt
- - name: Build
- working-directory: docs
- run: sphinx-build -W --keep-going source build
- build_swift:
- name: Swift ${{ matrix.swift }} / ${{ matrix.os }}
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [macos-13, macos-14, ubuntu-22.04]
- # This has no test yet.
- steps:
- - uses: actions/checkout@v4
- - name: Build
- run: swift build
- build_cmake_arm:
- name: CMake / ARM / ${{ matrix.os }} / ${{ matrix.arch }} / ${{ matrix.simd }}
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- include:
- # Linux ARM builds
- - os: ubuntu-latest-arm64
- arch: arm64
- simd: neon
- - os: ubuntu-latest-arm64
- arch: armv7
- simd: neon
- - os: ubuntu-latest-arm64
- arch: armv7
- simd: none
- # Windows ARM builds
- - os: windows-latest-arm64
- arch: arm64
- simd: neon
- - os: windows-latest-arm64
- arch: arm
- simd: neon
- - os: windows-latest-arm64
- arch: arm
- simd: none
- steps:
- - uses: actions/checkout@v4
- - name: Configure CMake (Windows)
- if: runner.os == 'Windows'
- shell: pwsh
- run: |
- $flags = ""
- if ("${{ matrix.arch }}" -eq "arm") {
- $flags = "-m32 -march=armv7-a"
- if ("${{ matrix.simd }}" -eq "neon") {
- $flags += " -mfpu=neon"
- }
- }
- elseif ("${{ matrix.simd }}" -eq "neon") {
- $flags = "-march=armv8-a+simd"
- }
-
- cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch == 'arm64' && 'ARM64' || 'ARM' }} `
- -DCMAKE_BUILD_TYPE=Release `
- -DCMAKE_C_FLAGS="$flags" `
- -DCGLM_STATIC=ON -DCGLM_USE_TEST=ON
- - name: Configure CMake (Unix)
- if: runner.os != 'Windows'
- shell: bash
- run: |
- flags=""
- if [ "${{ matrix.arch }}" = "armv7" ]; then
- flags="-m32 -march=armv7-a"
- if [ "${{ matrix.simd }}" = "neon" ]; then
- flags="$flags -mfpu=neon -mfloat-abi=hard"
- fi
- elif [ "${{ matrix.simd }}" = "neon" ]; then
- flags="-march=armv8-a+simd"
- fi
-
- cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_C_FLAGS="$flags" \
- -DCGLM_STATIC=ON -DCGLM_USE_TEST=ON
- - name: Build
- run: cmake --build build
- - name: Test
- working-directory: build
- run: ./tests
|