[llvm-branch-commits] [libc] b1067a9 - [libc][NFC] Skip adding dummy targets for skipped unit tests.

Siva Chandra via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Dec 14 17:57:13 PST 2020


Author: Siva Chandra
Date: 2020-12-14T17:52:47-08:00
New Revision: b1067a9b3c8e2c692c31598bf8f399e31f486d4e

URL: https://github.com/llvm/llvm-project/commit/b1067a9b3c8e2c692c31598bf8f399e31f486d4e
DIFF: https://github.com/llvm/llvm-project/commit/b1067a9b3c8e2c692c31598bf8f399e31f486d4e.diff

LOG: [libc][NFC] Skip adding dummy targets for skipped unit tests.

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCTestRules.cmake
    libc/test/src/math/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 33dc2cc7ca74..421e1a16b700 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -111,14 +111,6 @@ function(add_libc_unittest target_name)
     set(msg "Skipping unittest ${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()
 

diff  --git a/libc/test/src/math/CMakeLists.txt b/libc/test/src/math/CMakeLists.txt
index 44abc401da44..7475be150900 100644
--- a/libc/test/src/math/CMakeLists.txt
+++ b/libc/test/src/math/CMakeLists.txt
@@ -18,6 +18,9 @@ function(add_fp_unittest name)
 
   add_libc_unittest(${name} ${MATH_UNITTEST_UNPARSED_ARGUMENTS})
   get_fq_target_name(${name} fq_target_name)
+  if (NOT TARGET ${fq_target_name})
+    return()
+  endif()
   if(MATH_UNITTEST_NEED_MPFR)
     target_link_libraries(${fq_target_name} PRIVATE libcMPFRWrapper -lmpfr -lgmp)
   endif()


        


More information about the llvm-branch-commits mailing list