Skip to content

Commit c2ff406

Browse files
authored
[CI] Use clang to generate compile_commands (#2031)
Ensure the code-formatting job uses clang to generate compile_commands.json, to avoid passing GCC-specific flags to clang-format or clang-tidy.
1 parent 89d658c commit c2ff406

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/check-code-style.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ jobs:
7575
if: ${{ steps.gather-list-of-changes.outputs.HAS_CHANGES }}
7676
run: |
7777
mkdir build && cd build
78-
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ${{ github.workspace }}
78+
cmake -DCMAKE_CXX_COMPILER=clang++-${{ env.LLVM_VERSION }} \
79+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ${{ github.workspace }}
7980
8081
- name: Run clang-format
8182
if: ${{ steps.gather-list-of-changes.outputs.HAS_CHANGES }}

0 commit comments

Comments
 (0)