Skip to content

Commit 5493f10

Browse files
committed
Add clang-cl option to build matrix.
1 parent 4b03e64 commit 5493f10

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ jobs:
99
os: [ubuntu-24.04, ubuntu-22.04,
1010
windows-latest, windows-2025, windows-2022,
1111
macos-latest, macos-26, macos-15, macos-14, macos-15-intel]
12+
compiler: ['']
1213
include:
1314
- coverage: OFF
1415
config: Release
1516
static_lib: ON
17+
- compiler: clang-cl
18+
os: windows-latest
19+
coverage: OFF
20+
config: Release
21+
static_lib: ON
1622
- coverage: ON
1723
config: DEBUG
1824
static_lib: OFF
@@ -43,13 +49,18 @@ jobs:
4349
GCC_VERSION=$(g++ --version | head -n 1)
4450
echo "COMPILER_VERSION=$GCC_VERSION" >> $GITHUB_ENV
4551
elif [ "$RUNNER_OS" == "Windows" ]; then
46-
echo "COMPILER_VERSION=cl.exe" >> $GITHUB_ENV
52+
if [ "${{ matrix.compiler }}" == "clang-cl" ]; then
53+
CLANG_CL_VERSION=$(clang-cl --version | head -n 1)
54+
echo "COMPILER_VERSION=$CLANG_CL_VERSION" >> $GITHUB_ENV
55+
else
56+
echo "COMPILER_VERSION=cl.exe" >> $GITHUB_ENV
57+
fi
4758
elif [ "$RUNNER_OS" == "macOS" ]; then
4859
CLANG_VERSION=$(clang --version | head -n 1)
4960
echo "COMPILER_VERSION=$CLANG_VERSION" >> $GITHUB_ENV
5061
fi
5162
- name: Configure CMake
52-
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="${{ matrix.config }}" -D${{ env.REPOSITORY_NAME }}_STATIC_LIB="${{ matrix.static_lib }}" -D${{ env.REPOSITORY_NAME }}_COVERAGE="${{ matrix.coverage }}" -D${{ env.REPOSITORY_NAME }}_BUILD_EXAMPLES="${{ matrix.examples }}"
63+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="${{ matrix.config }}" -D${{ env.REPOSITORY_NAME }}_STATIC_LIB="${{ matrix.static_lib }}" -D${{ env.REPOSITORY_NAME }}_COVERAGE="${{ matrix.coverage }}" -D${{ env.REPOSITORY_NAME }}_BUILD_EXAMPLES="${{ matrix.examples }}"${{ matrix.compiler == 'clang-cl' && ' -T ClangCL' || '' }}
5364
- name: "Build with compiler: ${{ env.COMPILER_VERSION }}"
5465
run: cmake --build build --config ${{ matrix.config }}
5566
- name: Setup Mesa3D

0 commit comments

Comments
 (0)