Vulkan spec
This commit is contained in:
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [recp]
|
||||
patreon: recp
|
||||
open_collective: cglm
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
custom: # Replace with a single custom sponsorship URL
|
||||
Vendored
+645
@@ -0,0 +1,645 @@
|
||||
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
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
name: CMake WebAssembly
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
env:
|
||||
wasmtime_version: v7.0.0
|
||||
wasmer_version: v3.1.1
|
||||
|
||||
jobs:
|
||||
build_wasi_sdk:
|
||||
strategy:
|
||||
matrix:
|
||||
BUILD_TYPE: [Release, Debug, RelWithDebInfo, MinSizeRel]
|
||||
C_FLAGS: ['', '-msimd128']
|
||||
wasi_sdk_version: [19, 20]
|
||||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
|
||||
# You can convert this to a matrix build if you need cross-platform coverage.
|
||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Downloading wasi-sdk
|
||||
run: |
|
||||
cd ${{github.workspace}}
|
||||
wget --no-verbose https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{matrix.wasi_sdk_version}}/wasi-sdk-${{matrix.wasi_sdk_version}}.0-linux.tar.gz
|
||||
tar xf wasi-sdk-${{matrix.wasi_sdk_version}}.0-linux.tar.gz
|
||||
|
||||
# Building a wasm library without needing to define a main():
|
||||
# https://github.com/WebAssembly/wasi-sdk/issues/332
|
||||
- name: Modify CMakeLists.txt for WASI
|
||||
run: |
|
||||
echo 'if (CMAKE_SYSTEM_NAME STREQUAL "WASI")' >> CMakeLists.txt
|
||||
echo ' target_link_options(${PROJECT_NAME} PRIVATE -mexec-model=reactor)' >> CMakeLists.txt
|
||||
echo 'endif()' >> CMakeLists.txt
|
||||
|
||||
- name: Configure CMake
|
||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
||||
# Below suppress <<'clock' is deprecated: WASI lacks process-associated clocks; ...>> warns:
|
||||
# -D_WASI_EMULATED_PROCESS_CLOCKS" -DCMAKE_EXE_LINKER_FLAGS="-lwasi-emulated-process-clocks
|
||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DCMAKE_C_FLAGS="${{matrix.C_FLAGS}} -D_WASI_EMULATED_PROCESS_CLOCKS" -DCMAKE_EXE_LINKER_FLAGS="-lwasi-emulated-process-clocks" -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/wasi-sdk-${{matrix.wasi_sdk_version}}.0/share/cmake/wasi-sdk.cmake -DWASI_SDK_PREFIX=${{github.workspace}}/wasi-sdk-${{matrix.wasi_sdk_version}}.0 -DCGLM_STATIC=ON -DCGLM_SHARED=OFF -DCGLM_USE_TEST=ON
|
||||
|
||||
- name: Build
|
||||
# Build your program with the given configuration
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{matrix.BUILD_TYPE}}
|
||||
|
||||
- name: Test with wasmtime
|
||||
run: |
|
||||
cd ${{github.workspace}}
|
||||
ls -lh ${{github.workspace}}/build/
|
||||
wget --no-verbose https://github.com/bytecodealliance/wasmtime/releases/download/${{env.wasmtime_version}}/wasmtime-${{env.wasmtime_version}}-x86_64-linux.tar.xz
|
||||
tar xf wasmtime-${{env.wasmtime_version}}-x86_64-linux.tar.xz
|
||||
./wasmtime-${{env.wasmtime_version}}-x86_64-linux/wasmtime run --wasm-features simd ${{github.workspace}}/build/tests
|
||||
|
||||
- name: Test with wasmer
|
||||
run: |
|
||||
cd ${{github.workspace}}
|
||||
mkdir wasmer
|
||||
cd wasmer
|
||||
wget --no-verbose https://github.com/wasmerio/wasmer/releases/download/${{env.wasmer_version}}/wasmer-linux-amd64.tar.gz
|
||||
tar xf wasmer-linux-amd64.tar.gz
|
||||
./bin/wasmer run --enable-simd ${{github.workspace}}/build/tests
|
||||
|
||||
build_emsdk:
|
||||
strategy:
|
||||
matrix:
|
||||
BUILD_TYPE: [Release, Debug, RelWithDebInfo, MinSizeRel]
|
||||
C_FLAGS: ['', '-msimd128', '-msse -msse2 -msimd128', '-msse -msse2 -msse3 -msse4 -msimd128']
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v12
|
||||
|
||||
- name: Verify emsdk
|
||||
run: emcc -v
|
||||
|
||||
- name: Configure CMake
|
||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
||||
run: emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DCMAKE_C_FLAGS="${{matrix.C_FLAGS}}" -DCMAKE_EXE_LINKER_FLAGS="-s STANDALONE_WASM" -DCGLM_STATIC=ON -DCGLM_USE_TEST=ON
|
||||
|
||||
- name: Build
|
||||
# Build your program with the given configuration
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{matrix.BUILD_TYPE}}
|
||||
|
||||
- name: Test with wasmtime
|
||||
run: |
|
||||
cd ${{github.workspace}}
|
||||
ls -lh ${{github.workspace}}/build/
|
||||
wget --no-verbose https://github.com/bytecodealliance/wasmtime/releases/download/${{env.wasmtime_version}}/wasmtime-${{env.wasmtime_version}}-x86_64-linux.tar.xz
|
||||
tar xf wasmtime-${{env.wasmtime_version}}-x86_64-linux.tar.xz
|
||||
./wasmtime-${{env.wasmtime_version}}-x86_64-linux/wasmtime run --wasm-features simd ${{github.workspace}}/build/tests.wasm
|
||||
- name: Test with wasmer
|
||||
run: |
|
||||
cd ${{github.workspace}}
|
||||
mkdir wasmer
|
||||
cd wasmer
|
||||
wget --no-verbose https://github.com/wasmerio/wasmer/releases/download/${{env.wasmer_version}}/wasmer-linux-amd64.tar.gz
|
||||
tar xf wasmer-linux-amd64.tar.gz
|
||||
./bin/wasmer run --enable-simd ${{github.workspace}}/build/tests.wasm
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
name: Meson WebAssembly
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
env:
|
||||
wasmtime_version: v7.0.0
|
||||
wasmer_version: v3.1.1
|
||||
|
||||
jobs:
|
||||
build_emsdk:
|
||||
strategy:
|
||||
matrix:
|
||||
BUILD_TYPE: [debug, debugoptimized, release, minsize]
|
||||
C_FLAGS: ['', '-msimd128', '-msse -msse2 -msimd128', '-msse -msse2 -msse3 -msse4 -msimd128']
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v13
|
||||
|
||||
- name: Verify emsdk
|
||||
run: emcc -v
|
||||
|
||||
- name: Creating cross file
|
||||
run: |
|
||||
cat << EOF > ${{github.workspace}}/meson_cross_emsdk.txt
|
||||
[binaries]
|
||||
c = '`which emcc`'
|
||||
cpp = '`which em++`'
|
||||
ar = '`which emar`'
|
||||
|
||||
[built-in options]
|
||||
|
||||
c_args = ['-Wno-unused-parameter']
|
||||
c_link_args = ['-s', 'STANDALONE_WASM']
|
||||
cpp_args = ['-Wno-unused-parameter']
|
||||
cpp_link_args = ['-s', 'STANDALONE_WASM']
|
||||
|
||||
[host_machine]
|
||||
|
||||
system = 'emscripten'
|
||||
cpu_family = 'wasm32'
|
||||
cpu = 'wasm32'
|
||||
endian = 'little'
|
||||
|
||||
EOF
|
||||
cat ${{github.workspace}}/meson_cross_emsdk.txt
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
|
||||
- name: Install meson
|
||||
run: |
|
||||
sudo python3 -m pip install meson ninja
|
||||
|
||||
- name: Build with meson
|
||||
run: |
|
||||
meson setup build -Dbuildtype=${{matrix.BUILD_TYPE}} --cross-file ${{github.workspace}}/meson_cross_emsdk.txt --default-library=static -Dbuild_tests=true
|
||||
meson test -C build
|
||||
|
||||
- name: Test with wasmtime
|
||||
run: |
|
||||
cd ${{github.workspace}}
|
||||
ls -lh ${{github.workspace}}/build/
|
||||
wget --no-verbose https://github.com/bytecodealliance/wasmtime/releases/download/${{env.wasmtime_version}}/wasmtime-${{env.wasmtime_version}}-x86_64-linux.tar.xz
|
||||
tar xf wasmtime-${{env.wasmtime_version}}-x86_64-linux.tar.xz
|
||||
./wasmtime-${{env.wasmtime_version}}-x86_64-linux/wasmtime run --wasm-features simd ${{github.workspace}}/build/tests.wasm
|
||||
|
||||
- name: Test with wasmer
|
||||
run: |
|
||||
cd ${{github.workspace}}
|
||||
mkdir wasmer
|
||||
cd wasmer
|
||||
wget --no-verbose https://github.com/wasmerio/wasmer/releases/download/${{env.wasmer_version}}/wasmer-linux-amd64.tar.gz
|
||||
tar xf wasmer-linux-amd64.tar.gz
|
||||
./bin/wasmer run --enable-simd ${{github.workspace}}/build/tests.wasm
|
||||
Reference in New Issue
Block a user