[libc-commits] [libc] 23872aa - [libc] Add an off-by-default option to silence "skipping" messages from CMake.
Siva Chandra Reddy via libc-commits
libc-commits at lists.llvm.org
Mon Jan 30 08:39:49 PST 2023
Author: Siva Chandra Reddy
Date: 2023-01-30T16:39:41Z
New Revision: 23872aae129ce0282477c6838707569315f41585
URL: https://github.com/llvm/llvm-project/commit/23872aae129ce0282477c6838707569315f41585
DIFF: https://github.com/llvm/llvm-project/commit/23872aae129ce0282477c6838707569315f41585.diff
LOG: [libc] Add an off-by-default option to silence "skipping" messages from CMake.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D142802
Added:
Modified:
libc/CMakeLists.txt
libc/cmake/modules/LLVMLibCObjectRules.cmake
libc/cmake/modules/LLVMLibCTestRules.cmake
libc/test/src/math/differential_testing/CMakeLists.txt
Removed:
################################################################################
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index a293286a4f6d4..38fe16a3c26c7 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -31,6 +31,8 @@ if(LLVM_ENABLE_RUNTIMES AND NOT LLVM_RUNTIMES_BUILD)
return()
endif()
+option(LIBC_CMAKE_VERBOSE_LOGGING
+ "Log details warnings and notifications during CMake configuration." OFF)
# Path libc/scripts directory.
set(LIBC_BUILD_SCRIPTS_DIR "${LIBC_SOURCE_DIR}/utils/build_scripts")
diff --git a/libc/cmake/modules/LLVMLibCObjectRules.cmake b/libc/cmake/modules/LLVMLibCObjectRules.cmake
index 35c016df63654..24fd36080814e 100644
--- a/libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ b/libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -271,7 +271,9 @@ function(create_entrypoint_object fq_target_name)
"DEPS" ""
"SKIPPED" "YES"
)
- message(STATUS "Skipping libc entrypoint ${fq_target_name}.")
+ if(LIBC_CMAKE_VERBOSE_LOGGING)
+ message(STATUS "Skipping libc entrypoint ${fq_target_name}.")
+ endif()
return()
endif()
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 10e3823cb5c9a..6aa4286d36ecc 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -112,10 +112,11 @@ function(create_libc_unittest fq_target_name)
# capabilities and add entrypoints and tests accordingly. That approach is
# much lower level approach and is independent of the kind of skipping that
# is happening here at the entrypoint level.
-
- set(msg "Skipping unittest ${fq_target_name} as it has missing deps: "
- "${skipped_entrypoints_list}.")
- message(STATUS ${msg})
+ if(LIBC_CMAKE_VERBOSE_LOGGING)
+ set(msg "Skipping unittest ${fq_target_name} as it has missing deps: "
+ "${skipped_entrypoints_list}.")
+ message(STATUS ${msg})
+ endif()
return()
endif()
@@ -336,9 +337,11 @@ function(add_libc_fuzzer target_name)
get_object_files_for_test(
link_object_files skipped_entrypoints_list ${fq_deps_list})
if(skipped_entrypoints_list)
- set(msg "Skipping fuzzer target ${fq_target_name} as it has missing deps: "
- "${skipped_entrypoints_list}.")
- message(STATUS ${msg})
+ if(LIBC_CMAKE_VERBOSE_LOGGING)
+ set(msg "Skipping fuzzer target ${fq_target_name} as it has missing deps: "
+ "${skipped_entrypoints_list}.")
+ message(STATUS ${msg})
+ endif()
add_custom_target(${fq_target_name})
# A post build custom command is used to avoid running the command always.
diff --git a/libc/test/src/math/
diff erential_testing/CMakeLists.txt b/libc/test/src/math/
diff erential_testing/CMakeLists.txt
index 32bbc6c461542..a4ac9d5883522 100644
--- a/libc/test/src/math/
diff erential_testing/CMakeLists.txt
+++ b/libc/test/src/math/
diff erential_testing/CMakeLists.txt
@@ -21,9 +21,11 @@ function(add_
diff _binary target_name)
get_object_files_for_test(
link_object_files skipped_entrypoints_list ${fq_deps_list})
if(skipped_entrypoints_list)
- set(msg "Will not build ${fq_target_name} as it has missing deps: "
- "${skipped_entrypoints_list}.")
- message(STATUS ${msg})
+ if(LIBC_CMAKE_VERBOSE_LOGGING)
+ set(msg "Will not build ${fq_target_name} as it has missing deps: "
+ "${skipped_entrypoints_list}.")
+ message(STATUS ${msg})
+ endif()
return()
endif()
More information about the libc-commits
mailing list