File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,27 @@ add_clang_library(clangFormat
29
29
clangToolingCore
30
30
clangToolingInclusions
31
31
)
32
+
33
+ file (GLOB_RECURSE files
34
+ *.cpp
35
+ *.h
36
+ ../../include/clang/Format/*.h
37
+ ../../tools/clang-format/*.cpp
38
+ ../../unittests/Format/*.cpp
39
+ ../../unittests/Format/*.h
40
+ )
41
+
42
+ set (check_format_depends )
43
+ set (i 0 )
44
+ foreach (file IN LISTS files )
45
+ add_custom_command (OUTPUT clang-format-check-format${i}
46
+ COMMAND clang-format ${file} | diff -u ${file} -
47
+ VERBATIM
48
+ COMMENT "Checking format of ${file} ..."
49
+ )
50
+ list (APPEND check_format_depends "clang-format-check-format${i} " )
51
+
52
+ math (EXPR i ${i} +1 )
53
+ endforeach ()
54
+
55
+ add_custom_target (clang-format-check-format DEPENDS ${check_format_depends} )
You can’t perform that action at this time.
0 commit comments