Skip to content

Commit 93dc3f6

Browse files
committed
ci: correctly use clang in msys2 clang based environments
1 parent c0785df commit 93dc3f6

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}}
@@ -179,7 +183,16 @@ jobs:
179183
python=3.12.9-4
180184
gcc=14 gcc-libs=!
181185
182-
- name: Setup Clang (Linux) (libc++)
186+
- name: Setup Clang (MSYS2, libc++)
187+
if: matrix.config.os == 'windows' && matrix.config.environment == 'msys2' && matrix.config.use-clang == true
188+
uses: Totto16/msys2-install-packages-pinned@v1
189+
with:
190+
msystem: ${{matrix.config.msystem}}
191+
install: |
192+
clang=20
193+
libc++=20
194+
195+
- name: Setup Clang (Linux, libc++)
183196
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib
184197
run: |
185198
wget https://apt.llvm.org/llvm.sh
@@ -190,7 +203,7 @@ jobs:
190203
echo "CXX=clang++-20" >> "$GITHUB_ENV"
191204
echo "OBJC=clang-20" >> "$GITHUB_ENV"
192205
193-
- name: Setup Clang (Linux) (libstdc++)
206+
- name: Setup Clang (Linux, libstdc++)
194207
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && (! matrix.config.use-clang_stdlib)
195208
run: |
196209
wget https://apt.llvm.org/llvm.sh
@@ -257,7 +270,7 @@ jobs:
257270
brew install sdl2 sdl2_ttf sdl2_mixer sdl2_image
258271
259272
- name: Configure
260-
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' || '' }}
273+
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' || '' }}
261274

262275
- name: Build
263276
run: meson compile -C build

tools/options/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if get_option('run_in_ci')
7878
'compilers': [msvc_compiler_current],
7979
},
8080
'msys2': {
81-
'compilers': [gcc_14_compiler],
81+
'compilers': [clang_20_compiler, gcc_14_compiler],
8282
},
8383
'linux': {
8484
'compilers': [clang_20_compiler, gcc_14_compiler],

0 commit comments

Comments
 (0)