[mlir][tensor] fix typo in pad tiling comment
[llvm-project.git] / clang / lib / Format / CMakeLists.txt
blob9f4939824fdb8b8f5ef5484b7267aa9ef6b5c86e
1 set(LLVM_LINK_COMPONENTS support)
3 add_clang_library(clangFormat
4   AffectedRangeManager.cpp
5   BreakableToken.cpp
6   ContinuationIndenter.cpp
7   DefinitionBlockSeparator.cpp
8   Format.cpp
9   FormatToken.cpp
10   FormatTokenLexer.cpp
11   IntegerLiteralSeparatorFixer.cpp
12   MacroCallReconstructor.cpp
13   MacroExpander.cpp
14   MatchFilePath.cpp
15   NamespaceEndCommentsFixer.cpp
16   ObjCPropertyAttributeOrderFixer.cpp
17   QualifierAlignmentFixer.cpp
18   SortJavaScriptImports.cpp
19   TokenAnalyzer.cpp
20   TokenAnnotator.cpp
21   UnwrappedLineFormatter.cpp
22   UnwrappedLineParser.cpp
23   UsingDeclarationsSorter.cpp
24   WhitespaceManager.cpp
26   LINK_LIBS
27   clangBasic
28   clangLex
29   clangToolingCore
30   clangToolingInclusions
31   )
33 file(GLOB_RECURSE files
34   *.cpp
35   *.h
36   ${CLANG_SOURCE_DIR}/include/clang/Format/*.h
37   ${CLANG_SOURCE_DIR}/tools/clang-format/*.cpp
38   ${CLANG_SOURCE_DIR}/unittests/Format/*.cpp
39   ${CLANG_SOURCE_DIR}/unittests/Format/*.h
40   )
42 set(check_format_depends)
43 set(i 0)
44 foreach(file IN LISTS files)
45   add_custom_command(OUTPUT check_format_depend_${i}
46     COMMAND clang-format ${file} | diff -u ${file} -
47     VERBATIM
48     COMMENT "Checking format of ${file}"
49     )
50   list(APPEND check_format_depends check_format_depend_${i})
51   math(EXPR i ${i}+1)
52 endforeach()
53 add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
55 set(docs_tools_dir ${CLANG_SOURCE_DIR}/docs/tools)
57 set(format_style_depend ${CMAKE_CURRENT_BINARY_DIR}/format_style_depend)
58 set(dump_style dump_format_style.py)
59 set(style_options_rst ${CLANG_SOURCE_DIR}/docs/ClangFormatStyleOptions.rst)
60 add_custom_command(OUTPUT ${format_style_depend}
61   COMMAND ${Python3_EXECUTABLE} ${dump_style} && touch ${format_style_depend}
62   WORKING_DIRECTORY ${docs_tools_dir}
63   VERBATIM
64   COMMENT "Updating ${style_options_rst}"
65   DEPENDS ${CLANG_SOURCE_DIR}/include/clang/Format/Format.h
66           ${CLANG_SOURCE_DIR}/include/clang/Tooling/Inclusions/IncludeStyle.h
67           ${style_options_rst}
68           ${docs_tools_dir}/plurals.txt
69           ${docs_tools_dir}/${dump_style}
70   )
71 add_custom_target(clang-format-style DEPENDS ${format_style_depend})
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})