[libc-commits] [PATCH] D81519: [libc] Skip fuzzer as well if its dependent entrypoints are skipped.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jun 9 17:09:40 PDT 2020


sivachandra created this revision.
sivachandra added a reviewer: asteinhauser.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added a project: libc-project.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81519

Files:
  libc/cmake/modules/LLVMLibCTestRules.cmake


Index: libc/cmake/modules/LLVMLibCTestRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCTestRules.cmake
+++ libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -198,6 +198,24 @@
   endif()
 
   get_fq_target_name(${target_name} fq_target_name)
+  get_fq_deps_list(fq_deps_list ${LIBC_FUZZER_DEPENDS})
+  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})
+    add_custom_target(${fq_target_name})
+
+    # A post build custom command is used to avoid running the command always.
+    add_custom_command(
+      TARGET ${fq_target_name}
+      POST_BUILD
+      COMMAND ${CMAKE_COMMAND} -E echo ${msg}
+    )
+    return()
+  endif()
+
   add_executable(
     ${fq_target_name}
     EXCLUDE_FROM_ALL
@@ -212,8 +230,6 @@
       ${LIBC_BUILD_DIR}/include
   )
 
-  get_fq_deps_list(fq_deps_list ${LIBC_FUZZER_DEPENDS})
-  get_object_files_for_test(link_object_files ${fq_deps_list})
   target_link_libraries(${fq_target_name} PRIVATE ${link_object_files})
 
   set_target_properties(${fq_target_name}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81519.269704.patch
Type: text/x-patch
Size: 1282 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20200610/d3aff13b/attachment.bin>


More information about the libc-commits mailing list