diff options
author | Paul Adenot <[email protected]> | 2023-05-02 13:54:01 +0200 |
---|---|---|
committer | Paul Adenot <[email protected]> | 2023-05-17 10:57:17 +0200 |
commit | 5e12bb870def1815b146e1820eb4a55ec63ea3c4 (patch) | |
tree | d8deaa46bd45b9763982c1f7e915c2baed5b33d9 | |
parent | febf49d0898d1c1691235639b0796b91df522394 (diff) | |
download | cubeb-5e12bb870def1815b146e1820eb4a55ec63ea3c4.tar.gz cubeb-5e12bb870def1815b146e1820eb4a55ec63ea3c4.zip |
Allow specifying a particular clang-format binary (version), and pin the CI to version 15
-rw-r--r-- | .github/workflows/build.yml | 7 | ||||
-rw-r--r-- | CMakeLists.txt | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 202f7e1..f4cb552 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,15 +74,18 @@ jobs: run: cmake --build build check_format: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: submodules: true + - name: Install Dependencies (Linux) + run: sudo apt-get update && sudo apt-get install clang-format-15 + - name: Configure CMake shell: bash - run: cmake -S . -B build + run: cmake -S . -B build -DCLANG_FORMAT_BINARY=clang-format-15 - name: Check format shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index 0aa6841..279968d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -427,6 +427,10 @@ if(BUILD_TOOLS) install(TARGETS cubeb-test) endif() +if(NOT CLANG_FORMAT_BINARY) +set(CLANG_FORMAT_BINARY clang-format) +endif() + add_custom_target(clang-format-check find ${CMAKE_CURRENT_SOURCE_DIR}/src @@ -434,7 +438,7 @@ add_custom_target(clang-format-check -type f (-name "*.cpp" -o -name "*.c" -o -name "*.h") -not -path "*/subprojects/speex/*" -print0 - | xargs -0 clang-format -Werror -n + | xargs -0 ${CLANG_FORMAT_BINARY} -Werror -n COMMENT "Check formatting with clang-format" VERBATIM) |