Skip to content

Commit 11f0058

Browse files
committed
ci: correctly use clang in msys2 clang based environments
1 parent c540c73 commit 11f0058

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
environment: msys2
4646
msystem: MINGW64
4747
architecture: x86_64
48+
use-clang: false
4849
shell: 'msys2 {0}'
4950
fatal_warnings: true
5051

@@ -54,6 +55,7 @@ jobs:
5455
environment: msys2
5556
msystem: UCRT64
5657
architecture: ucrt-x86_64
58+
use-clang: false
5759
shell: 'msys2 {0}'
5860
fatal_warnings: true
5961

@@ -63,6 +65,7 @@ jobs:
6365
environment: msys2
6466
msystem: CLANG64
6567
architecture: clang-x86_64
68+
use-clang: true
6669
shell: 'msys2 {0}'
6770
fatal_warnings: true
6871

@@ -72,6 +75,7 @@ jobs:
7275
environment: msys2
7376
msystem: CLANGARM64
7477
architecture: clang-x86_64
78+
use-clang: true
7579
shell: 'msys2 {0}'
7680
fatal_warnings: true
7781

@@ -161,7 +165,7 @@ jobs:
161165
git
162166
163167
- name: Setup GCC (MSYS2)
164-
if: matrix.config.os == 'windows' && matrix.config.environment == 'msys2'
168+
if: matrix.config.os == 'windows' && matrix.config.environment == 'msys2' && matrix.config.use-clang == false
165169
uses: Totto16/msys2-install-packages-pinned@v1
166170
with:
167171
msystem: ${{matrix.config.msystem}}
@@ -170,7 +174,16 @@ jobs:
170174
install: |
171175
gcc=15 gcc-libs=!
172176
173-
- name: Setup Clang (Linux) (libc++)
177+
- name: Setup Clang (MSYS2, libc++)
178+
if: matrix.config.os == 'windows' && matrix.config.environment == 'msys2' && matrix.config.use-clang == true
179+
uses: Totto16/msys2-install-packages-pinned@v1
180+
with:
181+
msystem: ${{matrix.config.msystem}}
182+
install: |
183+
clang=20
184+
libc++=20
185+
186+
- name: Setup Clang (Linux, libc++)
174187
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib
175188
run: |
176189
wget https://apt.llvm.org/llvm.sh
@@ -181,7 +194,7 @@ jobs:
181194
echo "CXX=clang++-20" >> "$GITHUB_ENV"
182195
echo "OBJC=clang-20" >> "$GITHUB_ENV"
183196
184-
- name: Setup Clang (Linux) (libstdc++)
197+
- name: Setup Clang (Linux, libstdc++)
185198
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && (! matrix.config.use-clang_stdlib)
186199
run: |
187200
wget https://apt.llvm.org/llvm.sh
@@ -248,7 +261,7 @@ jobs:
248261
brew install sdl2 sdl2_ttf sdl2_mixer sdl2_image
249262
250263
- name: Configure
251-
run: meson setup build -Dbuildtype=release -Ddefault_library=${{( matrix.config.os == 'windows' && matrix.config.environment == 'msvc' && matrix.config.static ) && 'static' ||'shared' }} -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} -Drun_in_ci=true ${{( matrix.config.fatal_warnings ) && '--fatal-meson-warnings' || '' }}
264+
run: meson setup build -Dbuildtype=release -Ddefault_library=${{( matrix.config.os == 'windows' && matrix.config.environment == 'msvc' && matrix.config.static ) && 'static' ||'shared' }} -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' || ( matrix.config.os == 'windows' && matrix.config.environment == 'msys2' && matrix.config.use-clang == true ) ) && 'enabled' || 'disabled' }} -Drun_in_ci=true ${{( matrix.config.fatal_warnings ) && '--fatal-meson-warnings' || '' }}
252265

253266
- name: Build
254267
run: meson compile -C build

tools/options/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ if get_option('run_in_ci')
8383
'compilers': [msvc_compiler_current],
8484
},
8585
'msys2': {
86-
'compilers': [gcc_15_compiler],
86+
'compilers': [clang_20_compiler, gcc_14_compiler],
8787
},
8888
'linux': {
8989
'compilers': [clang_20_compiler, gcc_14_compiler],

0 commit comments

Comments
 (0)