[libc-commits] [libc] 9c27ba2 - [libc][NFC] Format CMake files under libc/ (#228527)
via libc-commits
libc-commits at lists.llvm.org
Fri Oct 9 00:34:01 PDT 2026
Author: Jeff Bailey
Date: 2026-10-09T07:33:54Z
New Revision: 9c27ba299037ce56a8ced34e76c3ac443230151c
URL: https://github.com/llvm/llvm-project/commit/9c27ba299037ce56a8ced34e76c3ac443230151c
DIFF: https://github.com/llvm/llvm-project/commit/9c27ba299037ce56a8ced34e76c3ac443230151c.diff
LOG: [libc][NFC] Format CMake files under libc/ (#228527)
Run libc/utils/cmake_format.py across libc/ to format CMake files
modified since commit 8969ae16e065.
Assisted-by: Automated tooling, human reviewed.
Added:
Modified:
libc/CMakeLists.txt
libc/cmake/caches/armv8m.main-none-eabihf.cmake
libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
libc/cmake/modules/LLVMLibCTestRules.cmake
libc/fuzzing/__support/CMakeLists.txt
libc/fuzzing/arpa/inet/CMakeLists.txt
libc/lib/CMakeLists.txt
libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
libc/src/__support/macros/CMakeLists.txt
libc/src/grp/CMakeLists.txt
libc/src/stdlib/CMakeLists.txt
libc/src/stdlib/linux/CMakeLists.txt
libc/startup/baremetal/CMakeLists.txt
libc/test/src/__support/CMakeLists.txt
libc/test/src/math/smoke/CMakeLists.txt
libc/test/src/mathvec/CMakeLists.txt
libc/test/src/stdlib/CMakeLists.txt
libc/test/src/sys/stat/CMakeLists.txt
Removed:
################################################################################
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index a5e3cd20f5a8e3..6a1e9ac9e83069 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -102,22 +102,22 @@ set(LIBC_TEST_LINK_OPTIONS_DEFAULT "" CACHE STRING "Common link options for all
# Enable source-based code coverage using Clang's continuous profiling mode.
option(LIBC_ENABLE_COVERAGE "Build libc with coverage instrumentation" OFF)
option(LIBC_ENABLE_COVERAGE_MCDC
- "Enable Modified Condition / Decision Coverage (MC/DC)" OFF)
+ "Enable Modified Condition / Decision Coverage (MC/DC)" OFF)
if(LIBC_ENABLE_COVERAGE)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND LIBC_COMPILE_OPTIONS_DEFAULT
- "-fprofile-instr-generate=libc_cov_%p.profraw"
- "-fcoverage-mapping"
- "-fprofile-continuous")
+ "-fprofile-instr-generate=libc_cov_%p.profraw"
+ "-fcoverage-mapping"
+ "-fprofile-continuous")
list(APPEND LIBC_TEST_LINK_OPTIONS_DEFAULT
- "-fprofile-instr-generate=libc_cov_%p.profraw"
- "-fprofile-continuous")
+ "-fprofile-instr-generate=libc_cov_%p.profraw"
+ "-fprofile-continuous")
if(LIBC_ENABLE_COVERAGE_MCDC)
list(APPEND LIBC_COMPILE_OPTIONS_DEFAULT "-fcoverage-mcdc")
endif()
else()
message(FATAL_ERROR
- "Coverage instrumentation is currently only supported with Clang")
+ "Coverage instrumentation is currently only supported with Clang")
endif()
endif()
@@ -241,16 +241,16 @@ if(LIBC_ENABLE_COVERAGE)
endif()
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} ${target_arg}
- --print-file-name=libclang_rt.profile.a
+ --print-file-name=libclang_rt.profile.a
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE libc_profile_lib
)
if(NOT EXISTS "${libc_profile_lib}")
set(profile_arch_lib
- "libclang_rt.profile-${LIBC_TARGET_ARCHITECTURE}.a")
+ "libclang_rt.profile-${LIBC_TARGET_ARCHITECTURE}.a")
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} ${target_arg}
- --print-file-name=${profile_arch_lib}
+ --print-file-name=${profile_arch_lib}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE libc_profile_lib
)
@@ -259,12 +259,12 @@ if(LIBC_ENABLE_COVERAGE)
message(FATAL_ERROR "Coverage enabled but profile runtime not found.")
endif()
set(LIBC_CLANG_PROFILE_LIB "${libc_profile_lib}"
- CACHE INTERNAL "Clang profile runtime")
+ CACHE INTERNAL "Clang profile runtime")
endif()
endif()
option(LLVM_LIBC_HERMETIC_TEST_USE_INTERNAL_STARTUP
- "Link hermetic tests against LLVM libc's own startup object"
- ON)
+ "Link hermetic tests against LLVM libc's own startup object"
+ ON)
option(LLVM_LIBC_IMPLEMENTATION_DEFINED_TEST_BEHAVIOR "Build LLVM libc tests assuming our implementation-defined behavior" ON)
option(LLVM_LIBC_ENABLE_LINTING "Enables linting of libc source files" OFF)
option(LLVM_LIBC_ALL_HEADERS "Outputs all functions in header files, regardless of whether they are enabled on this target" OFF)
diff --git a/libc/cmake/caches/armv8m.main-none-eabihf.cmake b/libc/cmake/caches/armv8m.main-none-eabihf.cmake
index 46c71dedb0c3a2..e95b0fd8b97ef3 100644
--- a/libc/cmake/caches/armv8m.main-none-eabihf.cmake
+++ b/libc/cmake/caches/armv8m.main-none-eabihf.cmake
@@ -2,7 +2,7 @@ set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
set(RUNTIMES_TARGET_TRIPLE "armv8m.main-none-eabihf" CACHE STRING "")
foreach(lang C;CXX;ASM)
- set(CMAKE_${lang}_FLAGS "-mfloat-abi=hard -march=armv8m.main+fp+dsp -mcpu=cortex-m33" CACHE STRING "")
+ set(CMAKE_${lang}_FLAGS "-mfloat-abi=hard -march=armv8m.main+fp+dsp -mcpu=cortex-m33" CACHE STRING "")
endforeach()
include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake)
diff --git a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
index 79f2d80bcba7a1..95f398e10855fb 100644
--- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -200,7 +200,7 @@ function(_get_compile_options_from_config output_var)
if(LIBC_COPT_HARDENING_MODE)
libc_add_definition(config_options "LIBC_COPT_HARDENING_MODE=${LIBC_COPT_HARDENING_MODE}")
endif()
-
+
if(LIBC_CONF_SCANF_PROVIDE_ISOC99_ALIASES)
list(APPEND config_options "-DLIBC_COPT_SCANF_PROVIDE_ISOC99_ALIASES")
endif()
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index ef157c8456a3a0..cde5519d0a3151 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -214,8 +214,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})
@@ -875,7 +875,7 @@ function(add_libc_hermetic test_name)
endif()
if(LIBC_ENABLE_COVERAGE)
- set(coverage_deps
+ set(coverage_deps
libc.src.stdio.fclose
libc.src.stdio.fdopen
libc.src.stdio.feof
@@ -1041,7 +1041,7 @@ function(add_libc_hermetic test_name)
if(LIBC_ENABLE_COVERAGE)
set(coverage_link_libs
"${LIBC_CLANG_PROFILE_LIB}"
- ${fq_target_name}.__libc__
+ ${fq_target_name}.__libc__
)
endif()
diff --git a/libc/fuzzing/__support/CMakeLists.txt b/libc/fuzzing/__support/CMakeLists.txt
index 2fbaa2f7cd6cff..eec09a1dc1daeb 100644
--- a/libc/fuzzing/__support/CMakeLists.txt
+++ b/libc/fuzzing/__support/CMakeLists.txt
@@ -59,7 +59,7 @@ if(LLVM_LIBC_FULL_BUILD AND NOT LIBC_TARGET_OS_IS_GPU)
# the use of -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded.
get_fq_target_name(freelist_heap_fuzz freelist_heap_fuzz_target_name)
get_fq_target_name(freelist_heap_rotation_fuzz
- freelist_heap_rotation_fuzz_target_name)
+ freelist_heap_rotation_fuzz_target_name)
set_target_properties(
${freelist_heap_fuzz_target_name}
${freelist_heap_rotation_fuzz_target_name}
diff --git a/libc/fuzzing/arpa/inet/CMakeLists.txt b/libc/fuzzing/arpa/inet/CMakeLists.txt
index 244438620c7562..1422ebea660444 100644
--- a/libc/fuzzing/arpa/inet/CMakeLists.txt
+++ b/libc/fuzzing/arpa/inet/CMakeLists.txt
@@ -26,4 +26,3 @@ add_libc_fuzzer(
libc.src.arpa.inet.inet_pton
libc.src.errno.errno
)
-
diff --git a/libc/lib/CMakeLists.txt b/libc/lib/CMakeLists.txt
index b244a8f7667561..48d129132a5179 100644
--- a/libc/lib/CMakeLists.txt
+++ b/libc/lib/CMakeLists.txt
@@ -27,7 +27,7 @@ elseif(LLVM_LIBC_FULL_BUILD)
list(APPEND libc_archive_names c m mvec)
list(APPEND libc_archive_targets libc libm libmvec)
list(APPEND libc_archive_entrypoint_lists
- TARGET_LIBC_ENTRYPOINTS TARGET_LIBM_ENTRYPOINTS TARGET_LIBMVEC_ENTRYPOINTS)
+ TARGET_LIBC_ENTRYPOINTS TARGET_LIBM_ENTRYPOINTS TARGET_LIBMVEC_ENTRYPOINTS)
else()
list(APPEND libc_archive_names llvmlibc)
list(APPEND libc_archive_targets libc)
diff --git a/libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt b/libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
index 47ddb551680199..602531273ac815 100644
--- a/libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
+++ b/libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
@@ -1606,4 +1606,3 @@ add_header_library(
libc.src.__support.error_or
libc.src.__support.macros.config
)
-
diff --git a/libc/src/__support/macros/CMakeLists.txt b/libc/src/__support/macros/CMakeLists.txt
index c9afc2829dbcbb..c600b453af510f 100644
--- a/libc/src/__support/macros/CMakeLists.txt
+++ b/libc/src/__support/macros/CMakeLists.txt
@@ -60,4 +60,3 @@ add_header_library(
HDRS
hardening.h
)
-
diff --git a/libc/src/grp/CMakeLists.txt b/libc/src/grp/CMakeLists.txt
index f7a2c81eea181c..d0c5b47d71eee1 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/stdlib/CMakeLists.txt b/libc/src/stdlib/CMakeLists.txt
index 28f93be03d92b0..2619d6c2ba73ad 100644
--- a/libc/src/stdlib/CMakeLists.txt
+++ b/libc/src/stdlib/CMakeLists.txt
@@ -886,4 +886,3 @@ add_entrypoint_object(
DEPENDS
.${LIBC_TARGET_OS}.system
)
-
diff --git a/libc/src/stdlib/linux/CMakeLists.txt b/libc/src/stdlib/linux/CMakeLists.txt
index e8711b73985862..00d108767ac20c 100644
--- a/libc/src/stdlib/linux/CMakeLists.txt
+++ b/libc/src/stdlib/linux/CMakeLists.txt
@@ -200,4 +200,3 @@ add_entrypoint_object(
libc.src.__support.macros.config
libc.src.__support.macros.null_check
)
-
diff --git a/libc/startup/baremetal/CMakeLists.txt b/libc/startup/baremetal/CMakeLists.txt
index d186b65688c809..668af64ff84b00 100644
--- a/libc/startup/baremetal/CMakeLists.txt
+++ b/libc/startup/baremetal/CMakeLists.txt
@@ -71,7 +71,7 @@ set(fq_target_name libc.startup.baremetal.${LIBC_TARGET_ARCHITECTURE}.crt1)
add_dependencies(libc-startup ${fq_target_name})
if(NOT LLVM_LIBC_ENABLE_MINOR_VARIANT)
install(FILES $<TARGET_OBJECTS:${fq_target_name}>
- DESTINATION ${LIBC_INSTALL_LIBRARY_DIR}
- RENAME $<TARGET_PROPERTY:${fq_target_name},OUTPUT_NAME>
- COMPONENT libc)
+ DESTINATION ${LIBC_INSTALL_LIBRARY_DIR}
+ RENAME $<TARGET_PROPERTY:${fq_target_name},OUTPUT_NAME>
+ COMPONENT libc)
endif()
diff --git a/libc/test/src/__support/CMakeLists.txt b/libc/test/src/__support/CMakeLists.txt
index c71385d98898b5..765eec6b421780 100644
--- a/libc/test/src/__support/CMakeLists.txt
+++ b/libc/test/src/__support/CMakeLists.txt
@@ -301,7 +301,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/math/smoke/CMakeLists.txt b/libc/test/src/math/smoke/CMakeLists.txt
index d647c24cfcf365..fe9fafdfab9a3f 100644
--- a/libc/test/src/math/smoke/CMakeLists.txt
+++ b/libc/test/src/math/smoke/CMakeLists.txt
@@ -5357,18 +5357,18 @@ add_fp_unittest(
# TODO: Re-enable the test for GPU.
if(NOT LIBC_TARGET_OS_IS_GPU)
-add_fp_unittest(
- powf_test
- SUITE
- libc-math-smoke-tests
- SRCS
- powf_test.cpp
- DEPENDS
- libc.src.math.powf
- libc.src.__support.math.powf_double_eval
- libc.src.__support.math.powf_float_eval
- libc.src.__support.FPUtil.fp_bits
-)
+ add_fp_unittest(
+ powf_test
+ SUITE
+ libc-math-smoke-tests
+ SRCS
+ powf_test.cpp
+ DEPENDS
+ libc.src.math.powf
+ libc.src.__support.math.powf_double_eval
+ libc.src.__support.math.powf_float_eval
+ libc.src.__support.FPUtil.fp_bits
+ )
endif()
add_fp_unittest(
diff --git a/libc/test/src/mathvec/CMakeLists.txt b/libc/test/src/mathvec/CMakeLists.txt
index 85a3e09bd22526..597845abcc9596 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/stdlib/CMakeLists.txt b/libc/test/src/stdlib/CMakeLists.txt
index bc705754b64a56..2825605392060c 100644
--- a/libc/test/src/stdlib/CMakeLists.txt
+++ b/libc/test/src/stdlib/CMakeLists.txt
@@ -683,4 +683,3 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
-
diff --git a/libc/test/src/sys/stat/CMakeLists.txt b/libc/test/src/sys/stat/CMakeLists.txt
index 9851488f67c034..72f44c68d03576 100644
--- a/libc/test/src/sys/stat/CMakeLists.txt
+++ b/libc/test/src/sys/stat/CMakeLists.txt
@@ -292,7 +292,7 @@ add_libc_test(
libc.src.fcntl.open
libc.src.sys.stat.stat
libc.src.unistd.close
- libc.src.stdio.remove
+ libc.src.stdio.remove
libc.src.__support.CPP.scope
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
More information about the libc-commits
mailing list