-
Notifications
You must be signed in to change notification settings - Fork 18
89 lines (79 loc) · 2.56 KB
/
cmake-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Build
on:
workflow_dispatch:
push:
branches:
- dev
- 57-add-support-for-adjustment-layers
pull_request:
branches:
- master
release:
types:
- published
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-24.04
compiler: gcc-13
compilercxx: g++-13
cflags: "-fsanitize=address,leak,undefined"
cxxflags: "-fsanitize=address,leak,undefined"
- name: Ubuntu Clang
os: ubuntu-24.04
compiler: clang
compilercxx: clang++
cflags: "-fsanitize=address,leak,undefined"
cxxflags: "-fsanitize=address,leak,undefined"
- name: Windows MSVC
os: windows-latest
compiler: msvc
compilercxx: msvc
cflags: ""
cxxflags: ""
- name: MacOS ARM GCC
os: macos-latest
compiler: gcc-13
compilercxx: g++-13
cflags: ""
cxxflags: ""
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
# Further brew packages needed to run/install vcpkg dependencies
- name: Setup MacOS dependencies
if: matrix.os == 'macos-latest'
run: |
brew install ninja
brew install autoconf
brew install libtool
brew install automake
- name: Initialize vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: '${{ github.workspace }}/thirdparty/vcpkg'
- name: Configure CMake ${{ matrix.os }}-${{ matrix.compilercxx }}
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compilercxx }}
CFLAGS: ${{ matrix.cflags }}
CXXFLAGS: ${{ matrix.cxxflags }}
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPSAPI_BUILD_DOCS=OFF -DPSAPI_BUILD_BENCHMARKS=OFF -DPSAPI_BUILD_TESTS=OFF -DPSAPI_BUILD_EXAMPLES=ON -DPSAPI_BUILD_PYTHON=OFF
- name: Build ${{ matrix.os }}-${{ matrix.compilercxx }}
# Build your program with the given configuration
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compilercxx }}
CFLAGS: ${{ matrix.cflags }}
CXXFLAGS: ${{ matrix.cxxflags }}
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(nproc || echo $NUMBER_OF_PROCESSORS)