aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2021-07-28 10:34:39 +1200
committerMatthew Gregan <[email protected]>2021-07-28 11:43:17 +1200
commitf495dc982572a70701c5df930ef454b68bb6fe20 (patch)
tree8c77623a51100a5c674f93b46334007228b28b5e /CMakeLists.txt
parente6c328cdee5fd09250e584d494e9b9ab147fe833 (diff)
downloadcubeb-f495dc982572a70701c5df930ef454b68bb6fe20.tar.gz
cubeb-f495dc982572a70701c5df930ef454b68bb6fe20.zip
Add clang-format-check target to CMake and run on CI.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6c3309..1b18c9d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -367,3 +367,15 @@ if(BUILD_TOOLS)
add_sanitizers(cubeb-test)
install(TARGETS cubeb-test DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})
endif()
+
+add_custom_target(clang-format-check
+ find
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ -type f (-name "*.cpp" -o -name "*.c" -o -name "*.h")
+ -not -path "*/src/speex/*"
+ -print0
+ | xargs -0 clang-format -Werror -n
+ COMMENT "Check formatting with clang-format"
+ VERBATIM)
+