Skip to content

Commit d76650b

Browse files
committed
[clang-format] Clean up cmake target clang-format-check-format
1 parent abc4183 commit d76650b

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

clang/lib/Format/CMakeLists.txt

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,33 @@ file(GLOB_RECURSE files
4141

4242
set(check_format_depends)
4343
set(i 0)
44-
foreach (file IN LISTS files)
45-
add_custom_command(OUTPUT clang-format-check-format${i}
44+
foreach(file IN LISTS files)
45+
add_custom_command(OUTPUT check_format_depend_${i}
4646
COMMAND clang-format ${file} | diff -u ${file} -
4747
VERBATIM
48-
COMMENT "Checking format of ${file}..."
48+
COMMENT "Checking format of ${file}"
4949
)
50-
list(APPEND check_format_depends clang-format-check-format${i})
50+
list(APPEND check_format_depends check_format_depend_${i})
5151

5252
math(EXPR i ${i}+1)
53-
endforeach ()
53+
endforeach()
5454

5555
add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
5656

57-
if(CLANG_INCLUDE_DOCS)
58-
set(style_options_depends ${CMAKE_CURRENT_BINARY_DIR}/dummy_output)
59-
set(docs_tools_dir ${CLANG_SOURCE_DIR}/docs/tools)
60-
add_custom_command(OUTPUT ${style_options_depends}
61-
COMMAND ${Python3_EXECUTABLE} dump_format_style.py &&
62-
touch ${style_options_depends}
63-
WORKING_DIRECTORY ${docs_tools_dir}
64-
DEPENDS ${CLANG_SOURCE_DIR}/include/clang/Format/Format.h
65-
${CLANG_SOURCE_DIR}/include/clang/Tooling/Inclusions/IncludeStyle.h
66-
${CLANG_SOURCE_DIR}/docs/ClangFormatStyleOptions.rst
67-
${docs_tools_dir}/plurals.txt
68-
${docs_tools_dir}/dump_format_style.py
69-
)
70-
add_custom_target(clang-format-style-options DEPENDS ${style_options_depends})
71-
endif()
57+
set(style_options_depends ${CMAKE_CURRENT_BINARY_DIR}/dummy_output)
58+
set(docs_tools_dir ${CLANG_SOURCE_DIR}/docs/tools)
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}
63+
WORKING_DIRECTORY ${docs_tools_dir}
64+
VERBATIM
65+
COMMENT "Updating ${style_options_rst}"
66+
DEPENDS ${CLANG_SOURCE_DIR}/include/clang/Format/Format.h
67+
${CLANG_SOURCE_DIR}/include/clang/Tooling/Inclusions/IncludeStyle.h
68+
${style_options_rst}
69+
${docs_tools_dir}/plurals.txt
70+
${docs_tools_dir}/dump_format_style.py
71+
)
72+
73+
add_custom_target(clang-format-style-options DEPENDS ${style_options_depends})

0 commit comments

Comments
 (0)