@@ -48,26 +48,39 @@ foreach(file IN LISTS files)
48
48
COMMENT "Checking format of ${file} "
49
49
)
50
50
list (APPEND check_format_depends check_format_depend_${i} )
51
-
52
51
math (EXPR i ${i} +1)
53
52
endforeach ()
54
-
55
53
add_custom_target (clang-format-check-format DEPENDS ${check_format_depends} )
56
54
57
- set (style_options_depends ${CMAKE_CURRENT_BINARY_DIR} /dummy_output)
58
55
set (docs_tools_dir ${CLANG_SOURCE_DIR} /docs/tools)
56
+
57
+ set (format_style_depend ${CMAKE_CURRENT_BINARY_DIR} /format_style_depend)
58
+ set (dump_style dump_format_style.py)
59
59
set (style_options_rst ${CLANG_SOURCE_DIR} /docs/ClangFormatStyleOptions.rst)
60
- add_custom_command (OUTPUT ${style_options_depends}
61
- COMMAND ${Python3_EXECUTABLE} dump_format_style.py &&
62
- touch ${style_options_depends}
60
+ add_custom_command (OUTPUT ${format_style_depend}
61
+ COMMAND ${Python3_EXECUTABLE} ${dump_style} && touch ${format_style_depend}
63
62
WORKING_DIRECTORY ${docs_tools_dir}
64
63
VERBATIM
65
64
COMMENT "Updating ${style_options_rst} "
66
65
DEPENDS ${CLANG_SOURCE_DIR} /include /clang/Format/Format.h
67
66
${CLANG_SOURCE_DIR} /include /clang/Tooling/Inclusions/IncludeStyle.h
68
67
${style_options_rst}
69
68
${docs_tools_dir} /plurals.txt
70
- ${docs_tools_dir} /dump_format_style.py
69
+ ${docs_tools_dir} /${dump_style}
71
70
)
71
+ add_custom_target (clang-format-style DEPENDS ${format_style_depend} )
72
72
73
- add_custom_target (clang-format-style-options DEPENDS ${style_options_depends} )
73
+ set (format_help_depend ${CMAKE_CURRENT_BINARY_DIR} /format_help_depend)
74
+ set (dump_help dump_format_help.py)
75
+ set (clang_format_rst ${CLANG_SOURCE_DIR} /docs/ClangFormat.rst)
76
+ add_custom_command (OUTPUT ${format_help_depend}
77
+ COMMAND ${Python3_EXECUTABLE} ${dump_help} -d ${CMAKE_BINARY_DIR} /bin &&
78
+ touch ${format_help_depend}
79
+ WORKING_DIRECTORY ${docs_tools_dir}
80
+ VERBATIM
81
+ COMMENT "Updating ${clang_format_rst} "
82
+ DEPENDS clang-format
83
+ ${clang_format_rst}
84
+ ${docs_tools_dir} /${dump_help}
85
+ )
86
+ add_custom_target (clang-format-help DEPENDS ${format_help_depend} )
0 commit comments