[clang] d76650b - [clang-format] Clean up cmake target clang-format-check-format

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 7 00:19:19 PST 2024


Author: Owen Pan
Date: 2024-12-07T00:19:11-08:00
New Revision: d76650bced1de20cb79d1b4a0c1732339a5d0099

URL: https://github.com/llvm/llvm-project/commit/d76650bced1de20cb79d1b4a0c1732339a5d0099
DIFF: https://github.com/llvm/llvm-project/commit/d76650bced1de20cb79d1b4a0c1732339a5d0099.diff

LOG: [clang-format] Clean up cmake target clang-format-check-format

Added: 
    

Modified: 
    clang/lib/Format/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/CMakeLists.txt b/clang/lib/Format/CMakeLists.txt
index 7bb1a44f546f13..7d2db087328e4a 100644
--- a/clang/lib/Format/CMakeLists.txt
+++ b/clang/lib/Format/CMakeLists.txt
@@ -41,31 +41,33 @@ file(GLOB_RECURSE files
 
 set(check_format_depends)
 set(i 0)
-foreach (file IN LISTS files)
-  add_custom_command(OUTPUT clang-format-check-format${i}
+foreach(file IN LISTS files)
+  add_custom_command(OUTPUT check_format_depend_${i}
     COMMAND clang-format ${file} | 
diff  -u ${file} -
     VERBATIM
-    COMMENT "Checking format of ${file}..."
+    COMMENT "Checking format of ${file}"
     )
-  list(APPEND check_format_depends clang-format-check-format${i})
+  list(APPEND check_format_depends check_format_depend_${i})
 
   math(EXPR i ${i}+1)
-endforeach ()
+endforeach()
 
 add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
 
-if(CLANG_INCLUDE_DOCS)
-  set(style_options_depends ${CMAKE_CURRENT_BINARY_DIR}/dummy_output)
-  set(docs_tools_dir ${CLANG_SOURCE_DIR}/docs/tools)
-  add_custom_command(OUTPUT ${style_options_depends}
-    COMMAND ${Python3_EXECUTABLE} dump_format_style.py &&
-            touch ${style_options_depends}
-    WORKING_DIRECTORY ${docs_tools_dir}
-    DEPENDS ${CLANG_SOURCE_DIR}/include/clang/Format/Format.h
-            ${CLANG_SOURCE_DIR}/include/clang/Tooling/Inclusions/IncludeStyle.h
-            ${CLANG_SOURCE_DIR}/docs/ClangFormatStyleOptions.rst
-            ${docs_tools_dir}/plurals.txt
-            ${docs_tools_dir}/dump_format_style.py
-    )
-  add_custom_target(clang-format-style-options DEPENDS ${style_options_depends})
-endif()
+set(style_options_depends ${CMAKE_CURRENT_BINARY_DIR}/dummy_output)
+set(docs_tools_dir ${CLANG_SOURCE_DIR}/docs/tools)
+set(style_options_rst ${CLANG_SOURCE_DIR}/docs/ClangFormatStyleOptions.rst)
+add_custom_command(OUTPUT ${style_options_depends}
+  COMMAND ${Python3_EXECUTABLE} dump_format_style.py &&
+          touch ${style_options_depends}
+  WORKING_DIRECTORY ${docs_tools_dir}
+  VERBATIM
+  COMMENT "Updating ${style_options_rst}"
+  DEPENDS ${CLANG_SOURCE_DIR}/include/clang/Format/Format.h
+          ${CLANG_SOURCE_DIR}/include/clang/Tooling/Inclusions/IncludeStyle.h
+          ${style_options_rst}
+          ${docs_tools_dir}/plurals.txt
+          ${docs_tools_dir}/dump_format_style.py
+  )
+
+add_custom_target(clang-format-style-options DEPENDS ${style_options_depends})


        


More information about the cfe-commits mailing list