Skip to content

Commit 4f09b3b

Browse files
committed
Update CI to set compiler env vars conditionally
Adds conditional steps in the CI workflow to set CC and CXX environment variables only when matrix.cc is defined. Ensures builds use the correct compiler configuration based on the matrix setup.
1 parent e4a3ee5 commit 4f09b3b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

templates/.github/workflows/ci.yml.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ jobs:
5858
cmake --preset=default
5959
cmake --build --preset=default
6060
cmake --install build/default --prefix ${{ runner.temp }}/install
61+
env:
62+
CC: ${{ matrix.cc }}
63+
CXX: ${{ matrix.cxx }}
64+
if: ${{ matrix.cc }}
65+
66+
- name: Build and Install
67+
run: |
68+
cmake --preset=default
69+
cmake --build --preset=default
70+
cmake --install build/default --prefix ${{ runner.temp }}/install
71+
if: ${{ !matrix.cc }}
6172

6273
- name: Test find_package
6374
shell: bash

0 commit comments

Comments
 (0)