Skip to content

Commit f57c6c9

Browse files
committed
build: split compiler presets and CI matrix into GCC and Clang entries
1 parent 69da715 commit f57c6c9

2 files changed

Lines changed: 95 additions & 31 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,46 @@ name: Build Linux + Windows
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: [ main ]
66
pull_request:
7-
branches: ["main"]
7+
branches: [ main ]
88

99
jobs:
1010
build:
1111
name: ${{ matrix.name }}
1212
runs-on: ${{ matrix.os }}
13-
1413
strategy:
1514
fail-fast: false
1615
matrix:
1716
include:
1817
# --------------------------------
19-
# Linux — Ninja (Debug)
18+
# Linux — GCC (Debug)
2019
# --------------------------------
21-
- name: Linux (Ninja, Debug)
20+
- name: Linux (GCC, Ninja, Debug)
2221
os: ubuntu-latest
23-
configure-preset: linux-ninja-debug
24-
build-preset: linux-ninja-debug
25-
22+
configure-preset: linux-gcc-debug
23+
build-preset: linux-gcc-debug
24+
# --------------------------------
25+
# Linux — Clang (Debug)
26+
# --------------------------------
27+
- name: Linux (Clang, Ninja, Debug)
28+
os: ubuntu-latest
29+
configure-preset: linux-clang-debug
30+
build-preset: linux-clang-debug
2631
# --------------------------------
27-
# Windows — Ninja + GCC (Debug)
32+
# Windows — GCC + Ninja (Debug)
2833
# --------------------------------
29-
- name: Windows (Ninja + GCC, Debug)
34+
- name: Windows (GCC, Ninja, Debug)
3035
os: windows-latest
31-
configure-preset: windows-ninja-debug
32-
build-preset: windows-ninja-debug
33-
36+
configure-preset: windows-gcc-debug
37+
build-preset: windows-gcc-debug
38+
# --------------------------------
39+
# Windows — Clang + Ninja (Debug)
40+
# --------------------------------
41+
- name: Windows (Clang, Ninja, Debug)
42+
os: windows-latest
43+
configure-preset: windows-clang-debug
44+
build-preset: windows-clang-debug
3445
# --------------------------------
3546
# Windows — MSVC (Debug)
3647
# --------------------------------
@@ -43,14 +54,11 @@ jobs:
4354
- name: Checkout
4455
uses: actions/checkout@v4
4556

46-
# Install CMake + Ninja
4757
- name: Setup CMake & Ninja
4858
uses: lukka/get-cmake@latest
4959

50-
# Configure
5160
- name: Configure
5261
run: cmake --preset ${{ matrix.configure-preset }}
5362

54-
# Build
5563
- name: Build
56-
run: cmake --build --preset ${{ matrix.build-preset }}
64+
run: cmake --build --preset ${{ matrix.build-preset }}

CMakePresets.json

Lines changed: 70 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,56 @@
1818
}
1919
},
2020
{
21-
"name": "linux-ninja-debug",
22-
"displayName": "Linux (Ninja) - Debug",
21+
"name": "base-gcc",
22+
"hidden": true,
2323
"inherits": "base-config",
24+
"cacheVariables": {
25+
"CMAKE_C_COMPILER": "gcc",
26+
"CMAKE_CXX_COMPILER": "g++",
27+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion"
28+
}
29+
},
30+
{
31+
"name": "base-clang",
32+
"hidden": true,
33+
"inherits": "base-config",
34+
"cacheVariables": {
35+
"CMAKE_C_COMPILER": "clang",
36+
"CMAKE_CXX_COMPILER": "clang++",
37+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion"
38+
}
39+
},
40+
{
41+
"name": "linux-gcc-debug",
42+
"displayName": "Linux (GCC, Ninja) - Debug",
43+
"inherits": "base-gcc",
2444
"condition": {
2545
"type": "equals",
2646
"lhs": "${hostSystemName}",
2747
"rhs": "Linux"
2848
},
2949
"generator": "Ninja",
3050
"cacheVariables": {
31-
"CMAKE_BUILD_TYPE": "Debug",
32-
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion"
51+
"CMAKE_BUILD_TYPE": "Debug"
52+
}
53+
},
54+
{
55+
"name": "linux-clang-debug",
56+
"displayName": "Linux (Clang, Ninja) - Debug",
57+
"inherits": "base-clang",
58+
"condition": {
59+
"type": "equals",
60+
"lhs": "${hostSystemName}",
61+
"rhs": "Linux"
62+
},
63+
"generator": "Ninja",
64+
"cacheVariables": {
65+
"CMAKE_BUILD_TYPE": "Debug"
3366
}
3467
},
3568
{
3669
"name": "windows-msvc",
37-
"displayName": "Windows (VS 2022) - Debug",
70+
"displayName": "Windows (MSVC, VS 2022) - Debug",
3871
"inherits": "base-config",
3972
"condition": {
4073
"type": "equals",
@@ -47,25 +80,43 @@
4780
}
4881
},
4982
{
50-
"name": "windows-ninja-debug",
51-
"displayName": "Windows (Ninja + GCC) - Debug",
52-
"inherits": "base-config",
83+
"name": "windows-gcc-debug",
84+
"displayName": "Windows (GCC, Ninja) - Debug",
85+
"inherits": "base-gcc",
5386
"condition": {
5487
"type": "equals",
5588
"lhs": "${hostSystemName}",
5689
"rhs": "Windows"
5790
},
5891
"generator": "Ninja",
5992
"cacheVariables": {
60-
"CMAKE_BUILD_TYPE": "Debug",
61-
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion"
93+
"CMAKE_BUILD_TYPE": "Debug"
94+
}
95+
},
96+
{
97+
"name": "windows-clang-debug",
98+
"displayName": "Windows (Clang, Ninja) - Debug",
99+
"inherits": "base-clang",
100+
"condition": {
101+
"type": "equals",
102+
"lhs": "${hostSystemName}",
103+
"rhs": "Windows"
104+
},
105+
"generator": "Ninja",
106+
"cacheVariables": {
107+
"CMAKE_BUILD_TYPE": "Debug"
62108
}
63109
}
64110
],
65111
"buildPresets": [
66112
{
67-
"name": "linux-ninja-debug",
68-
"configurePreset": "linux-ninja-debug",
113+
"name": "linux-gcc-debug",
114+
"configurePreset": "linux-gcc-debug",
115+
"jobs": 0
116+
},
117+
{
118+
"name": "linux-clang-debug",
119+
"configurePreset": "linux-clang-debug",
69120
"jobs": 0
70121
},
71122
{
@@ -75,8 +126,13 @@
75126
"jobs": 0
76127
},
77128
{
78-
"name": "windows-ninja-debug",
79-
"configurePreset": "windows-ninja-debug",
129+
"name": "windows-gcc-debug",
130+
"configurePreset": "windows-gcc-debug",
131+
"jobs": 0
132+
},
133+
{
134+
"name": "windows-clang-debug",
135+
"configurePreset": "windows-clang-debug",
80136
"jobs": 0
81137
}
82138
]

0 commit comments

Comments
 (0)