[libc-commits] [libc] 179a7f1 - [libc] Fix dependency to unit tests, and quitting in non-GPU mode

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri Mar 17 11:08:19 PDT 2023


Author: Joseph Huber
Date: 2023-03-17T13:08:01-05:00
New Revision: 179a7f1ea26226d65a7287e03eaf03994c93a3cb

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

LOG: [libc] Fix dependency to unit tests, and quitting in non-GPU mode

Summary:
Fixes the lack of a dependency after changing the order of some
includes. Also we weren't running any tests as the GPU was always
disabling them. Fix the logic.

Added: 
    

Modified: 
    libc/test/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/test/CMakeLists.txt b/libc/test/CMakeLists.txt
index 8a7023c3fff6..710f1138a6f2 100644
--- a/libc/test/CMakeLists.txt
+++ b/libc/test/CMakeLists.txt
@@ -5,6 +5,10 @@ add_dependencies(check-libc libc-unit-tests)
 add_custom_target(exhaustive-check-libc)
 add_custom_target(libc-long-running-tests)
 
+if(NOT LIBC_TARGET_ARCHITECTURE_IS_GPU)
+  add_subdirectory(UnitTest)
+endif()
+
 add_header_library(
   errno_setter_matcher
   HDRS
@@ -13,13 +17,13 @@ add_header_library(
     libc.src.errno.errno
 )
 
-if(NOT TARGET libc.utils.gpu.loader OR NOT TARGET libc.startup.gpu.crt1)
+if(LIBC_TARGET_ARCHITECTURE_IS_GPU AND
+   (NOT TARGET libc.utils.gpu.loader OR NOT TARGET libc.startup.gpu.crt1))
   message(WARNING "Cannot build libc GPU tests, missing loader implementation")
   return()
 endif()
 
 if(NOT LIBC_TARGET_ARCHITECTURE_IS_GPU)
-  add_subdirectory(UnitTest)
   add_subdirectory(src)
   add_subdirectory(utils)
 endif()


        


More information about the libc-commits mailing list