mirror of
https://github.com/recp/cglm.git
synced 2025-10-03 08:41:55 +00:00
153
.github/workflows/ci.yml
vendored
153
.github/workflows/ci.yml
vendored
@@ -130,7 +130,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Configure CMake
|
||||
run: 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 -DCGLM_USE_C99=OFF -DCGLM_SHARED=OFF
|
||||
run: 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
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
@@ -161,9 +161,7 @@ jobs:
|
||||
-GNinja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCGLM_STATIC=ON \
|
||||
-DCGLM_USE_TEST=ON \
|
||||
-DCGLM_USE_C99=OFF \
|
||||
-DCGLM_SHARED=OFF
|
||||
-DCGLM_USE_TEST=ON
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
@@ -188,75 +186,6 @@ jobs:
|
||||
if: runner.os == 'macOS'
|
||||
run: brew upgrade && brew install ninja
|
||||
|
||||
- name: Set SIMD flags
|
||||
shell: ${{ (runner.os == 'Windows' && 'pwsh') || 'bash' }}
|
||||
run: |
|
||||
${{ (runner.os == 'Windows' && 'function Set-Flags {
|
||||
$simd = $env:MATRIX_SIMD
|
||||
switch ($simd) {
|
||||
"none" { $env:CFLAGS = "" }
|
||||
"sse" { $env:CFLAGS = "-arch:SSE" }
|
||||
"sse2" { $env:CFLAGS = "-arch:SSE2" }
|
||||
"sse3" { $env:CFLAGS = "-arch:SSE3" }
|
||||
"sse4" { $env:CFLAGS = "-arch:SSE4" }
|
||||
"avx" { $env:CFLAGS = "-arch:AVX" }
|
||||
"avx2" { $env:CFLAGS = "-arch:AVX2" }
|
||||
"neon" { $env:CFLAGS = "-arch:NEON" }
|
||||
}
|
||||
}
|
||||
$env:MATRIX_SIMD = "' + matrix.simd + '"
|
||||
Set-Flags') || '
|
||||
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
|
||||
shell: ${{ (runner.os == 'Windows' && 'pwsh') || 'bash' }}
|
||||
run: |
|
||||
${{ (runner.os == 'Windows' && 'cmake -B build -G "Visual Studio 17 2022" -A x64 -T host=x64 -DCMAKE_BUILD_TYPE=Release -DCGLM_STATIC=ON -DCGLM_USE_TEST=ON -DCGLM_USE_C99=OFF -DCGLM_SHARED=OFF -DCMAKE_C_FLAGS="$env:CFLAGS"') || 'cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DCGLM_STATIC=ON -DCGLM_USE_TEST=ON -DCGLM_USE_C99=OFF -DCGLM_SHARED=OFF -DCMAKE_C_FLAGS="$CFLAGS"' }}
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build --config Release
|
||||
|
||||
- name: Test
|
||||
working-directory: build
|
||||
shell: ${{ (runner.os == 'Windows' && 'pwsh') || 'bash' }}
|
||||
run: ${{ (runner.os == 'Windows' && '.\Release\tests.exe') || './tests' }}
|
||||
|
||||
build_meson:
|
||||
name: Meson / ${{ matrix.os }} / ${{ matrix.simd }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-14, ubuntu-22.04, ubuntu-24.04, windows-2022]
|
||||
simd: [none, sse, sse2, sse3, sse4, avx, avx2, 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
|
||||
@@ -302,16 +231,84 @@ jobs:
|
||||
export CFLAGS="-mfpu=neon"
|
||||
fi
|
||||
|
||||
- name: Build with meson (Windows)
|
||||
- name: Configure CMake (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
|
||||
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: Build with meson (Unix)
|
||||
- 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
|
||||
working-directory: build
|
||||
run: ./tests
|
||||
|
||||
build_meson:
|
||||
name: Meson / ${{ matrix.os }} / ${{ matrix.simd }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-14, ubuntu-22.04, ubuntu-24.04, windows-2022]
|
||||
simd: [none, sse, sse2, sse3, sse4, avx, avx2, 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
|
||||
run: |
|
||||
if ($Env:RUNNER_OS -eq 'Windows') {
|
||||
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"
|
||||
}
|
||||
} else {
|
||||
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
|
||||
run: |
|
||||
meson setup build -Dbuildtype=release --default-library=static -Dbuild_tests=true -Dc_args="$CFLAGS"
|
||||
meson test -C build
|
||||
|
Reference in New Issue
Block a user