[clang] [clang-format][NFC] Clean up clang/lib/Format/CMakeLists.txt (PR #206314)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 28 00:09:47 PDT 2026


https://github.com/owenca created https://github.com/llvm/llvm-project/pull/206314

None

>From a8b94d973d2bceb1a055fafa7e522c4f09f791b2 Mon Sep 17 00:00:00 2001
From: Owen Pan <owenpiano at gmail.com>
Date: Sun, 28 Jun 2026 00:08:46 -0700
Subject: [PATCH] [clang-format][NFC] Clean up clang/lib/Format/CMakeLists.txt

---
 clang/lib/Format/CMakeLists.txt | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/clang/lib/Format/CMakeLists.txt b/clang/lib/Format/CMakeLists.txt
index df73212983ab1..fcaae71530370 100644
--- a/clang/lib/Format/CMakeLists.txt
+++ b/clang/lib/Format/CMakeLists.txt
@@ -41,9 +41,9 @@ file(GLOB_RECURSE files
   ${CLANG_SOURCE_DIR}/unittests/Format/*.h
   )
 
+set(check_format_depends clang-format)
 find_program(DIFF_EXE diff)
 if(DIFF_EXE)
-  set(check_format_depends)
   set(i 0)
   foreach(file IN LISTS files)
     add_custom_command(OUTPUT check_format_depend_${i}
@@ -55,13 +55,10 @@ if(DIFF_EXE)
               ${file}
       )
     list(APPEND check_format_depends check_format_depend_${i})
-    math(EXPR i ${i}+1)
+    math(EXPR i "${i} + 1")
   endforeach()
-  add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
-else()
-  add_custom_target(clang-format-check-format DEPENDS clang-format)
 endif()
-
+add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
 
 set(docs_tools_dir ${CLANG_SOURCE_DIR}/docs/tools)
 



More information about the cfe-commits mailing list