aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPaul Adenot <[email protected]>2023-05-02 13:54:01 +0200
committerPaul Adenot <[email protected]>2023-05-17 10:57:17 +0200
commit5e12bb870def1815b146e1820eb4a55ec63ea3c4 (patch)
treed8deaa46bd45b9763982c1f7e915c2baed5b33d9 /CMakeLists.txt
parentfebf49d0898d1c1691235639b0796b91df522394 (diff)
downloadcubeb-5e12bb870def1815b146e1820eb4a55ec63ea3c4.tar.gz
cubeb-5e12bb870def1815b146e1820eb4a55ec63ea3c4.zip
Allow specifying a particular clang-format binary (version), and pin the CI to version 15
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
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)