[libc-commits] [PATCH] D142802: [libc] Add an off-by-default option to silence "skipping" messages from CMake.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Sat Jan 28 01:29:32 PST 2023


sivachandra created this revision.
sivachandra added reviewers: michaelrj, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
sivachandra requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142802

Files:
  libc/CMakeLists.txt
  libc/cmake/modules/LLVMLibCObjectRules.cmake
  libc/cmake/modules/LLVMLibCTestRules.cmake
  libc/test/src/math/differential_testing/CMakeLists.txt


Index: libc/test/src/math/differential_testing/CMakeLists.txt
===================================================================
--- libc/test/src/math/differential_testing/CMakeLists.txt
+++ libc/test/src/math/differential_testing/CMakeLists.txt
@@ -21,9 +21,11 @@
   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()
 
Index: libc/cmake/modules/LLVMLibCTestRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCTestRules.cmake
+++ libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -112,10 +112,11 @@
     # 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 @@
   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.
Index: libc/cmake/modules/LLVMLibCObjectRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -271,7 +271,9 @@
         "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()
 
Index: libc/CMakeLists.txt
===================================================================
--- libc/CMakeLists.txt
+++ libc/CMakeLists.txt
@@ -31,6 +31,8 @@
   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")
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142802.492987.patch
Type: text/x-patch
Size: 3140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230128/125bbfcc/attachment.bin>


More information about the libc-commits mailing list