aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-11-13 09:05:25 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2015-11-13 09:22:48 +0100
commit152ba0847d739067f2086c382a878c59d6d8d57a (patch)
treebebc38fba637c5ba7d2acabbae54efbba07df4f4 /CMakeLists.txt
parentfe88e30bf58c7892e1d9591c7ffcfe73e3e41657 (diff)
downloadxK-152ba0847d739067f2086c382a878c59d6d8d57a.tar.gz
xK-152ba0847d739067f2086c382a878c59d6d8d57a.tar.xz
xK-152ba0847d739067f2086c382a878c59d6d8d57a.zip
Add a CMake target for clang-tidy
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c630da1..aa0d3e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,6 +111,20 @@ target_link_libraries (degesch ${project_libraries})
add_executable (kike kike.c kike-replies.c ${common_sources} ${common_headers})
target_link_libraries (kike ${project_libraries})
+# Various clang-based diagnostics, loads of fake positives and spam
+file (GLOB clang_tidy_sources *.c)
+set (clang_tidy_checks misc-* readability-*
+ -readability-braces-around-statements
+ -readability-named-parameter)
+string (REPLACE ";" "," clang_tidy_checks "${clang_tidy_checks}")
+
+set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
+add_custom_target (clang-tidy
+ COMMAND clang-tidy -p ${PROJECT_BINARY_DIR} -checks=${clang_tidy_checks}
+ ${clang_tidy_sources} 1>&2
+ USES_TERMINAL
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+
# Installation
install (TARGETS zyklonb degesch kike DESTINATION ${CMAKE_INSTALL_BINDIR})
install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})