[libc-commits] [libc] [libc][cmake] Indent hanging CMake lines by 4 spaces (PR #240832)

via libc-commits libc-commits at lists.llvm.org
Tue Nov 10 06:03:19 PST 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Jeff Bailey (kaladron)

<details>
<summary>Changes</summary>

Indenting wrapped control-flow headers and header-line keyword lists by 2 spaces makes continuation lines visually indistinguishable from child control blocks and sibling 2-space keyword sub-stanzas beneath them.

Updated cmake_format.py to indent wrapped control-flow headers and header-line keyword items by 4 spaces when sibling keywords exist in the command schema, while keeping positional arguments and single-keyword property calls at 2 spaces. Corrected elseif base indentation so wrapped conditions indent 4 spaces rather than 6, and reformatted the libc CMake files.

Assisted-by: Automated tooling, human reviewed.

---

Patch is 37.02 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/240832.diff


28 Files Affected:

- (modified) libc/cmake/modules/LLVMLibCArchitectures.cmake (+1-1) 
- (modified) libc/cmake/modules/LLVMLibCCompileOptionRules.cmake (+3-3) 
- (modified) libc/cmake/modules/LLVMLibCFlagRules.cmake (+2-2) 
- (modified) libc/cmake/modules/LLVMLibCLibraryRules.cmake (+1-1) 
- (modified) libc/cmake/modules/LLVMLibCTestRules.cmake (+9-9) 
- (modified) libc/cmake/modules/LibcParseArguments.cmake (+8-8) 
- (modified) libc/cmake/modules/prepare_libc_gpu_build.cmake (+2-2) 
- (modified) libc/lib/CMakeLists.txt (+1-1) 
- (modified) libc/src/__support/File/CMakeLists.txt (+1-1) 
- (modified) libc/src/__support/time/CMakeLists.txt (+1-1) 
- (modified) libc/src/grp/CMakeLists.txt (+1-1) 
- (modified) libc/src/stdio/generic/CMakeLists.txt (+5-5) 
- (modified) libc/src/stdlib/CMakeLists.txt (+2-2) 
- (modified) libc/test/CMakeLists.txt (+1-1) 
- (modified) libc/test/integration/src/__support/threads/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/__support/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/fenv/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/mathvec/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/stdio/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/stdio/scanf_core/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/stdlib/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/string/memory_utils/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/sys/prctl/linux/CMakeLists.txt (+2-2) 
- (modified) libc/test/utils/FPUtil/CMakeLists.txt (+1-1) 
- (modified) libc/utils/MPCWrapper/CMakeLists.txt (+3-3) 
- (modified) libc/utils/MPFRWrapper/CMakeLists.txt (+5-5) 
- (modified) libc/utils/cmake_format.py (+34-15) 
- (modified) libc/utils/cmake_format_test.py (+124-1) 


``````````diff
diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index e65ddff98269ef..57351cf4442bff 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -234,7 +234,7 @@ endif()
 # if the compiler is clang. If the compiler is GCC we just error out as there
 # is no equivalent of an option like --target.
 if(explicit_target_triple AND
-  (NOT (libc_compiler_triple STREQUAL explicit_target_triple)))
+    (NOT (libc_compiler_triple STREQUAL explicit_target_triple)))
   set(LIBC_CROSSBUILD TRUE)
   if(CMAKE_COMPILER_IS_GNUCXX)
     message(FATAL_ERROR
diff --git a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
index f4b9d29d27faec..b345add27f050d 100644
--- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -87,7 +87,7 @@ function(_get_compile_options_from_flags output_var)
         list(APPEND compile_options "-D__LIBC_USE_BUILTIN_FMAXF16_FMINF16")
       endif()
       if("FullFP16" IN_LIST LIBC_CPU_FEATURES AND
-        CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+          CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
         list(APPEND compile_options
           "SHELL:-Xclang -target-feature -Xclang +fullfp16")
       endif()
@@ -250,7 +250,7 @@ function(_get_common_compile_options_impl output_var)
         # -ffreestanding, which in turn includes <stdlib.h>. Suppress it by
         # defining its header guard.
         if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
-          (LIBC_TARGET_ARCHITECTURE_IS_X86_64 OR LIBC_TARGET_ARCHITECTURE_IS_X86))
+            (LIBC_TARGET_ARCHITECTURE_IS_X86_64 OR LIBC_TARGET_ARCHITECTURE_IS_X86))
           list(APPEND compile_options "-D_MM_MALLOC_H_INCLUDED")
         endif()
       endif()
@@ -266,7 +266,7 @@ function(_get_common_compile_options_impl output_var)
       endif()
       # TODO: We should set this unconditionally on Linux.
       if(LIBC_TARGET_OS_IS_LINUX AND
-        (LIBC_CC_SUPPORTS_NOSTDLIBINC OR COMPILER_RESOURCE_DIR))
+          (LIBC_CC_SUPPORTS_NOSTDLIBINC OR COMPILER_RESOURCE_DIR))
         # We use -idirafter to avoid preempting libc's own headers in case the
         # directory (e.g. /usr/include) contains other headers.
         foreach(path IN LISTS LIBC_KERNEL_HEADERS)
diff --git a/libc/cmake/modules/LLVMLibCFlagRules.cmake b/libc/cmake/modules/LLVMLibCFlagRules.cmake
index c658c077372eca..7a7a2a148d35ee 100644
--- a/libc/cmake/modules/LLVMLibCFlagRules.cmake
+++ b/libc/cmake/modules/LLVMLibCFlagRules.cmake
@@ -285,7 +285,7 @@ set(MISC_MATH_BASIC_OPS_OPT_FLAG "MISC_MATH_BASIC_OPS_OPT")
 # Skip FMA_OPT flag for targets that don't support fma.
 if(NOT DEFINED SKIP_FLAG_EXPANSION_FMA_OPT)
   if(NOT((LIBC_TARGET_ARCHITECTURE_IS_X86_64 AND (LIBC_CPU_FEATURES MATCHES "FMA")) OR
-    LIBC_TARGET_ARCHITECTURE_IS_ANY_RISCV))
+      LIBC_TARGET_ARCHITECTURE_IS_ANY_RISCV))
     set(SKIP_FLAG_EXPANSION_FMA_OPT TRUE)
   endif()
 endif()
@@ -303,7 +303,7 @@ endif()
 # SSE4.2 support.
 if(NOT DEFINED SKIP_FLAG_EXPANSION_ROUND_OPT)
   if(NOT((LIBC_TARGET_ARCHITECTURE_IS_X86_64 AND (LIBC_CPU_FEATURES MATCHES "SSE4_2")) OR
-    LIBC_TARGET_ARCHITECTURE_IS_AARCH64 OR LIBC_TARGET_OS_IS_GPU))
+      LIBC_TARGET_ARCHITECTURE_IS_AARCH64 OR LIBC_TARGET_OS_IS_GPU))
     set(SKIP_FLAG_EXPANSION_ROUND_OPT TRUE)
   endif()
 endif()
diff --git a/libc/cmake/modules/LLVMLibCLibraryRules.cmake b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
index cdff1b907214bb..59fa869d472ef8 100644
--- a/libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -54,7 +54,7 @@ function(get_all_object_file_deps result fq_deps_list)
   foreach(dep ${fq_deps_list})
     get_target_property(dep_type ${dep} "TARGET_TYPE")
     if(NOT ((${dep_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE}) OR
-      (${dep_type} STREQUAL ${ENTRYPOINT_EXT_TARGET_TYPE})))
+        (${dep_type} STREQUAL ${ENTRYPOINT_EXT_TARGET_TYPE})))
       message(FATAL_ERROR "Dependency '${dep}' of 'add_entrypoint_collection' is "
         "not an 'add_entrypoint_object' or 'add_entrypoint_external' target.")
     endif()
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 09cf51a0b4ffc1..8300f19742f15c 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -64,7 +64,7 @@ function(_get_common_test_compile_options_impl output_var c_test)
       # Only add -ffreestanding flag in full build mode.
       list(APPEND compile_options "-ffreestanding")
       if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
-        (LIBC_TARGET_ARCHITECTURE_IS_X86_64 OR LIBC_TARGET_ARCHITECTURE_IS_X86))
+          (LIBC_TARGET_ARCHITECTURE_IS_X86_64 OR LIBC_TARGET_ARCHITECTURE_IS_X86))
         list(APPEND compile_options "-D_MM_MALLOC_H_INCLUDED")
       endif()
       list(APPEND compile_options "-fno-exceptions")
@@ -312,8 +312,8 @@ function(get_object_files_for_test result skipped_entrypoints_list)
           # object. External baremetal startup code can reference the public C exit
           # symbol, so use the public-packaging object for exit in this configuration.
           if(dep STREQUAL "libc.src.stdlib.exit" AND
-            NOT LLVM_LIBC_HERMETIC_TEST_USE_INTERNAL_STARTUP AND
-            LIBC_TARGET_OS_IS_BAREMETAL)
+              NOT LLVM_LIBC_HERMETIC_TEST_USE_INTERNAL_STARTUP AND
+              LIBC_TARGET_OS_IS_BAREMETAL)
             string(REPLACE ".__internal__" "" object_file_raw ${object_file_raw})
           endif()
           list(APPEND dep_obj ${object_file_raw})
@@ -354,8 +354,8 @@ endif()
 # that the driver selects the same multilib. GPU and UEFI targets do not link a
 # compiler runtime.
 if(LLVM_INCLUDE_TESTS AND LLVM_LIBC_FULL_BUILD AND NOT LIBC_TARGET_OS_IS_GPU AND
-  NOT LIBC_TARGET_OS_IS_UEFI AND
-  NOT LIBC_TEST_BUILTINS_LIBRARY AND NOT LIBC_TEST_BUILTINS_TARGET)
+    NOT LIBC_TARGET_OS_IS_UEFI AND
+    NOT LIBC_TEST_BUILTINS_LIBRARY AND NOT LIBC_TEST_BUILTINS_TARGET)
   separate_arguments(libc_cxx_flags NATIVE_COMMAND "${CMAKE_CXX_FLAGS}")
   execute_process(
     COMMAND ${CMAKE_CXX_COMPILER} ${libc_cxx_flags}
@@ -572,8 +572,8 @@ function(_link_libc_hermetic_test fq_target_name fq_build_target_name startup_ta
 
   set(compiler_runtime "")
   if(NOT LIBC_TARGET_ARCHITECTURE_IS_AMDGPU AND
-    NOT LIBC_TARGET_ARCHITECTURE_IS_NVPTX AND
-    NOT LIBC_CC_SUPPORTS_NOSTDLIBPP)
+      NOT LIBC_TARGET_ARCHITECTURE_IS_NVPTX AND
+      NOT LIBC_CC_SUPPORTS_NOSTDLIBPP)
     list(APPEND compiler_runtime ${LIBGCC_S_LOCATION})
   endif()
 
@@ -942,8 +942,8 @@ function(add_libc_fuzzer target_name)
   target_include_directories(${fq_target_name} PRIVATE ${LIBC_SOURCE_DIR})
 
   target_link_libraries(${fq_target_name} PRIVATE
-    ${link_object_files}
-    ${link_libraries}
+      ${link_object_files}
+      ${link_libraries}
   )
 
   set_target_properties(${fq_target_name}
diff --git a/libc/cmake/modules/LibcParseArguments.cmake b/libc/cmake/modules/LibcParseArguments.cmake
index f564865f4de5e8..5002657b6cd6c2 100644
--- a/libc/cmake/modules/LibcParseArguments.cmake
+++ b/libc/cmake/modules/LibcParseArguments.cmake
@@ -179,14 +179,14 @@ function(llvm_libc_parse_arguments name_prefix)
   endforeach()
 
   foreach(argument
-    IN LISTS
-    LLVM_LIBC_COMMON_OPTIONAL_ARGS
-    LLVM_LIBC_OPTIONAL_ARGS
-    LLVM_LIBC_SINGLE_VALUE_ARGS
-    LLVM_LIBC_MULTI_VALUE_ARGS
-    ITEMS
-    UNPARSED_ARGUMENTS
-    KEYWORDS_MISSING_VALUES
+      IN LISTS
+      LLVM_LIBC_COMMON_OPTIONAL_ARGS
+      LLVM_LIBC_OPTIONAL_ARGS
+      LLVM_LIBC_SINGLE_VALUE_ARGS
+      LLVM_LIBC_MULTI_VALUE_ARGS
+      ITEMS
+      UNPARSED_ARGUMENTS
+      KEYWORDS_MISSING_VALUES
   )
     set(${name_prefix}_${argument} "${ARG_${argument}}" PARENT_SCOPE)
   endforeach()
diff --git a/libc/cmake/modules/prepare_libc_gpu_build.cmake b/libc/cmake/modules/prepare_libc_gpu_build.cmake
index 3bfa98b1dcba7a..c1e10418f06064 100644
--- a/libc/cmake/modules/prepare_libc_gpu_build.cmake
+++ b/libc/cmake/modules/prepare_libc_gpu_build.cmake
@@ -6,7 +6,7 @@ endif()
 # Ensure the compiler is a valid clang when building the GPU target.
 set(req_ver "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
 if(LLVM_VERSION_MAJOR AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" AND
-  ${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL "${req_ver}"))
+    ${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL "${req_ver}"))
   message(WARNING "libc for GPU requires an up-to-date clang. CMake compiler "
     "'${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}' "
     " is not 'Clang ${req_ver}'.")
@@ -43,7 +43,7 @@ endif()
 
 set(gpu_test_architecture "")
 if(DEFINED LLVM_TARGETS_TO_BUILD AND LIBC_TARGET_ARCHITECTURE_IS_AMDGPU
-  AND NOT "AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD)
+    AND NOT "AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD)
   set(LIBC_GPU_TESTS_DISABLED TRUE)
   message(STATUS "AMDGPU backend is not available, tests will not be built")
 elseif(DEFINED LLVM_TARGETS_TO_BUILD AND LIBC_TARGET_ARCHITECTURE_IS_NVPTX
diff --git a/libc/lib/CMakeLists.txt b/libc/lib/CMakeLists.txt
index aa0b35e65a1a0b..b7947cace695e6 100644
--- a/libc/lib/CMakeLists.txt
+++ b/libc/lib/CMakeLists.txt
@@ -37,7 +37,7 @@ endif()
 set(added_archive_targets "")
 set(added_bitcode_targets "")
 foreach(archive IN ZIP_LISTS
-  libc_archive_names libc_archive_targets libc_archive_entrypoint_lists)
+    libc_archive_names libc_archive_targets libc_archive_entrypoint_lists)
   if(NOT ${archive_2})
     # If an entrypoint list is missing, then skip adding targets for it.
     continue()
diff --git a/libc/src/__support/File/CMakeLists.txt b/libc/src/__support/File/CMakeLists.txt
index 691ada0fc99586..c65e5b7ee23dc5 100644
--- a/libc/src/__support/File/CMakeLists.txt
+++ b/libc/src/__support/File/CMakeLists.txt
@@ -5,7 +5,7 @@ add_header_library(
 )
 
 if(NOT (TARGET libc.src.__support.threads.mutex)
-  OR LIBC_TARGET_OS_IS_GPU)
+    OR LIBC_TARGET_OS_IS_GPU)
   # Not all platforms have a mutex implementation. If mutex is unvailable,
   # we just skip everything about files.
   return()
diff --git a/libc/src/__support/time/CMakeLists.txt b/libc/src/__support/time/CMakeLists.txt
index 00d7dba572fc7c..7cc1d1888ea5fe 100644
--- a/libc/src/__support/time/CMakeLists.txt
+++ b/libc/src/__support/time/CMakeLists.txt
@@ -8,7 +8,7 @@ add_header_library(
 )
 
 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS}
-  AND TARGET libc.src.__support.OSUtil.osutil)
+    AND TARGET libc.src.__support.OSUtil.osutil)
   add_subdirectory(${LIBC_TARGET_OS})
 else()
   message(STATUS "Skip libc.src.__support.time.* targets.")
diff --git a/libc/src/grp/CMakeLists.txt b/libc/src/grp/CMakeLists.txt
index d0c5b47d71eee1..398509182bae9c 100644
--- a/libc/src/grp/CMakeLists.txt
+++ b/libc/src/grp/CMakeLists.txt
@@ -1,5 +1,5 @@
 if(NOT TARGET libc.src.__support.File.file OR
-  NOT TARGET libc.src.__support.File.platform_file)
+    NOT TARGET libc.src.__support.File.platform_file)
   return()
 endif()
 
diff --git a/libc/src/stdio/generic/CMakeLists.txt b/libc/src/stdio/generic/CMakeLists.txt
index 58a0cefcf9356d..e05a9e1bd9be78 100644
--- a/libc/src/stdio/generic/CMakeLists.txt
+++ b/libc/src/stdio/generic/CMakeLists.txt
@@ -96,11 +96,11 @@ add_generic_entrypoint_object(
 
 # since this isn't an entrypoint we need to do these checks manually.
 if(NOT TARGET libc.src.stdio.${LIBC_TARGET_OS}.fflush_internal AND
-  TARGET libc.src.__support.File.file AND
-  TARGET libc.src.__support.File.platform_file AND
-  "libc.src.stdio.stdin" IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS AND
-  "libc.src.stdio.stdout" IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS AND
-  "libc.src.stdio.stderr" IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS)
+    TARGET libc.src.__support.File.file AND
+    TARGET libc.src.__support.File.platform_file AND
+    "libc.src.stdio.stdin" IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS AND
+    "libc.src.stdio.stdout" IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS AND
+    "libc.src.stdio.stderr" IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS)
   add_object_library(
     fflush_internal
     SRCS
diff --git a/libc/src/stdlib/CMakeLists.txt b/libc/src/stdlib/CMakeLists.txt
index a40e6bfa4d2c51..98e356244e87a5 100644
--- a/libc/src/stdlib/CMakeLists.txt
+++ b/libc/src/stdlib/CMakeLists.txt
@@ -81,8 +81,8 @@ add_entrypoint_object(
 # GCC-12 crashed when building environ_internal during GIMPLE pass: waccess.
 set(environ_internal_gcc12_workaround "")
 if((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") AND
-  (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12") AND
-  (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13"))
+    (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12") AND
+    (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13"))
   set(environ_internal_gcc12_workaround "-Wno-stringop-overflow"
     "-fdisable-tree-waccess1" "-fdisable-tree-waccess2"
     "-fdisable-tree-waccess3")
diff --git a/libc/test/CMakeLists.txt b/libc/test/CMakeLists.txt
index ae9cd0e4b028f8..1342acfe68d683 100644
--- a/libc/test/CMakeLists.txt
+++ b/libc/test/CMakeLists.txt
@@ -52,7 +52,7 @@ endif()
 add_subdirectory(include)
 
 if(NOT ${LIBC_TARGET_OS} STREQUAL "linux" AND
-  NOT ${LIBC_TARGET_OS} STREQUAL "gpu")
+    NOT ${LIBC_TARGET_OS} STREQUAL "gpu")
   # Integration tests are currently only available for linux and the GPU.
   return()
 endif()
diff --git a/libc/test/integration/src/__support/threads/CMakeLists.txt b/libc/test/integration/src/__support/threads/CMakeLists.txt
index de5738c23c06e7..f4da964c4f7401 100644
--- a/libc/test/integration/src/__support/threads/CMakeLists.txt
+++ b/libc/test/integration/src/__support/threads/CMakeLists.txt
@@ -1,5 +1,5 @@
 if(NOT (TARGET libc.src.__support.threads.thread AND
-  TARGET libc.src.__support.threads.mutex))
+    TARGET libc.src.__support.threads.mutex))
   return()
 endif()
 
diff --git a/libc/test/src/__support/CMakeLists.txt b/libc/test/src/__support/CMakeLists.txt
index e4620f1c04d58f..ca2ea8eb799d83 100644
--- a/libc/test/src/__support/CMakeLists.txt
+++ b/libc/test/src/__support/CMakeLists.txt
@@ -312,7 +312,7 @@ add_libc_test(
 )
 
 if(LIBC_TARGET_OS_IS_BAREMETAL AND
-  NOT LLVM_LIBC_HERMETIC_TEST_USE_INTERNAL_STARTUP)
+    NOT LLVM_LIBC_HERMETIC_TEST_USE_INTERNAL_STARTUP)
   add_object_library(
     minimal_external_crt1_for_test
     SRCS
diff --git a/libc/test/src/fenv/CMakeLists.txt b/libc/test/src/fenv/CMakeLists.txt
index 911e162aa613ae..b944b4c510332c 100644
--- a/libc/test/src/fenv/CMakeLists.txt
+++ b/libc/test/src/fenv/CMakeLists.txt
@@ -96,7 +96,7 @@ add_libc_test(
 )
 
 if(NOT (LLVM_USE_SANITIZER OR (${LIBC_TARGET_OS} STREQUAL "windows")
-  OR (${LIBC_TARGET_OS} STREQUAL "darwin")))
+    OR (${LIBC_TARGET_OS} STREQUAL "darwin")))
   # Sanitizers don't like SIGFPE. So, we will run the
   # tests which raise SIGFPE only in non-sanitizer builds.
   # The tests are also disabled for Windows and MacOS as they fail currently.
diff --git a/libc/test/src/mathvec/CMakeLists.txt b/libc/test/src/mathvec/CMakeLists.txt
index 3a41ab0da9759f..6283304a0a3286 100644
--- a/libc/test/src/mathvec/CMakeLists.txt
+++ b/libc/test/src/mathvec/CMakeLists.txt
@@ -421,7 +421,7 @@ add_fp_unittest(
 )
 
 if(NOT LIBC_CONF_MATH_OPTIMIZATIONS MATCHES
-  "LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT")
+    "LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT")
   add_fp_unittest(
     sinf_test
     SUITE
diff --git a/libc/test/src/stdio/CMakeLists.txt b/libc/test/src/stdio/CMakeLists.txt
index e20395737b2d1e..23acf2537a175f 100644
--- a/libc/test/src/stdio/CMakeLists.txt
+++ b/libc/test/src/stdio/CMakeLists.txt
@@ -200,7 +200,7 @@ if(LIBC_CONF_PRINTF_DISABLE_FLOAT)
   libc_add_definition(sprintf_test_copts "LIBC_COPT_PRINTF_DISABLE_FLOAT")
 endif()
 if(LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_DYADIC_FLOAT OR
-  LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_FLOAT320)
+    LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_FLOAT320)
   libc_add_definition(sprintf_test_copts "LIBC_COPT_FLOAT_TO_STR_REDUCED_PRECISION")
 endif()
 if(LIBC_CONF_PRINTF_DISABLE_INDEX_MODE)
diff --git a/libc/test/src/stdio/scanf_core/CMakeLists.txt b/libc/test/src/stdio/scanf_core/CMakeLists.txt
index 46e99ffe56fe0d..72330662149a41 100644
--- a/libc/test/src/stdio/scanf_core/CMakeLists.txt
+++ b/libc/test/src/stdio/scanf_core/CMakeLists.txt
@@ -18,7 +18,7 @@ add_libc_test(
 )
 
 if(NOT(TARGET libc.src.__support.File.file) AND LLVM_LIBC_FULL_BUILD AND
-  (NOT LIBC_TARGET_OS_IS_GPU))
+    (NOT LIBC_TARGET_OS_IS_GPU))
   # Not all platforms have a file implementation. If file is unvailable, and a
   # full build is requested, then we must skip all file based scanf sections.
   return()
diff --git a/libc/test/src/stdlib/CMakeLists.txt b/libc/test/src/stdlib/CMakeLists.txt
index a208ac4cdec41f..5e054cb430db31 100644
--- a/libc/test/src/stdlib/CMakeLists.txt
+++ b/libc/test/src/stdlib/CMakeLists.txt
@@ -169,7 +169,7 @@ add_libc_test(
 )
 
 if(LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_DYADIC_FLOAT OR
-  LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_FLOAT320)
+    LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_FLOAT320)
   libc_set_definition(strfrom_test_copts "LIBC_COPT_FLOAT_TO_STR_REDUCED_PRECISION")
 endif()
 
@@ -677,7 +677,7 @@ endif()
 
 # Only baremetal and GPU has an in-tree 'malloc' implementation.
 if((LIBC_TARGET_OS_IS_BAREMETAL OR LIBC_TARGET_OS_IS_GPU) AND
-  NOT LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
+    NOT LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
   add_libc_test(
     malloc_test
     SUITE
diff --git a/libc/test/src/string/memory_utils/CMakeLists.txt b/libc/test/src/string/memory_utils/CMakeLists.txt
index 0b94cd22df1aca..2dcb86a1f3dd48 100644
--- a/libc/test/src/string/memory_utils/CMakeLists.txt
+++ b/libc/test/src/string/memory_utils/CMakeLists.txt
@@ -1,8 +1,8 @@
 # Targets with implemented src/string/memory_utils/op_XXX.h specializations.
 if(LIBC_TARGET_ARCHITECTURE_IS_AARCH64 OR
-  LIBC_TARGET_ARCHITECTURE_IS_X86_64 OR
-  LIBC_TARGET_ARCHITECTURE_IS_X86 OR
-  LIBC_TARGET_ARCHITECTURE_IS_ANY_RISCV)
+    LIBC_TARGET_ARCHITECTURE_IS_X86_64 OR
+    LIBC_TARGET_ARCHITECTURE_IS_X86 OR
+    LIBC_TARGET_ARCHITECTURE_IS_ANY_RISCV)
   add_libc_test(
     utils_test
     SUITE
diff --git a/libc/test/src/sys/prctl/linux/CMakeLists.txt b/libc/test/src/sys/prctl/linux/CMakeLists.txt
index 01e8c1a712ad4f..b08f02bb3864c5 100644
--- a/libc/test/src/sys/prctl/linux/CMakeLists.txt
+++ b/libc/test/src/sys/prctl/linux/CMakeLists.txt
@@ -3,8 +3,8 @@ add_libc_testsuite(libc-sys-prctl-tests)
 # Temporarily disable this test while setting up arm and riscv buildbots
 # using qemu, since PR_GET_THP_DISABLE is not supported on qemu.
 if(NOT (LIBC_TARGET_ARCHITECTURE_IS_ARM OR
-  LIBC_TARGET_ARCHITECTURE_IS_RISCV32 OR
-  LIBC_TARGET_ARCHITECTURE_IS_RISCV64))
+    LIBC_TARGET_ARCHITECTURE_IS_RISCV32 OR
+    LIBC_TARGET_ARCHITECTURE_IS_RISCV64))
   add_libc_test(
     prctl_test
     SUITE
diff --git a/libc/test/utils/FPUtil/CMakeLists.txt b/libc/test/utils/FPUtil/CMakeLists.txt
index e76f8ff783c867..dbd2270a7754af 100644
--- a/libc/test/utils/FPUtil/CMakeLists.txt
+++ b/libc/test/utils/FPUtil/CMakeLists.txt
@@ -1,5 +1,5 @@
 if((${LIBC_TARGET_OS} STREQUAL "linux") AND ((${LIBC_TARGET_ARCHITECTURE_IS_X86})
-  OR (${LIBC_TARGET_ARCHITECTURE_IS_X86_64})))
+    OR (${LIBC_TARGET_ARCHITECTURE_IS_X86_64})))
   add_libc_test(
     x86_long_double_test
     SUITE
diff --git a/libc/utils/MPCWrapper/CMakeLists.txt b/libc/utils/MPCWrapper/CMakeLists.txt
index c982f2232088a3..fbb98dba2c1f97 100644
--- a/libc/utils/MPCWrapper/CMakeLists.txt
+++ b/libc/utils/MPCWrapper/CMakeLists.txt
@@ -1,8 +1,8 @@
 if(LIBC_TESTS_CAN_USE_MPC)
   add_library(libc.utils.MPCWrapper STATIC
-    MPCUtils.cpp
-    MPCUtils.h
-    mpc_inc.h
+      MPCUtils.cpp
+      MPCUtils.h
+      mpc_inc.h
   )
   _get_common_test_compile_options(compile_options "" "")
   list(REMOVE_ITEM compile_options "-ffreestanding")
diff --git a/libc/utils/MPFRWrapper/CMakeLists.txt b/libc/utils/MPFRWrapper/CMakeLists.txt
index fe241c72d89c82..3c301180882a8e 100644
--- a/libc/utils/MPFRWrapper/CMakeLists.txt
+++ b/libc/utils/MPFRWrapper/CMakeLists.txt
@@ -1,8 +1,8 @@
 if(LIBC_TESTS_CAN_USE_MPFR OR LIBC_TESTS_CAN_USE_MPC)
   add_library(libc.utils.MPCommon STATIC
-    MPCommon.cpp
-    MPCommon.h
-    mpfr_inc.h
+      MPCommon.cpp
+      MPCommon.h
+      mpfr_inc.h
   )
   _get_common_test_compile_options(compile_options "" "")
   # mpfr/gmp headers do not work with -ffreestanding flag.
@@ -...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/240832


More information about the libc-commits mailing list