[libc-commits] [libc] 8937174 - [libc] Add an option to always build GPU loader utilities (#86040)

via libc-commits libc-commits at lists.llvm.org
Wed Mar 20 17:58:57 PDT 2024


Author: Joseph Huber
Date: 2024-03-20T19:58:53-05:00
New Revision: 893717446bbc8f31427b581af5fbaf4154b63402

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

LOG: [libc] Add an option to always build GPU loader utilities (#86040)

Summary:
Right now it's difficult to build these utilities standalone becayse
they're keyed off of the other GPU handling. if someone wants to *just*
build these utilities it's not possible without setting up the runtimes
build. Since we can't just build these by default add an option to
enable it.

We can't just use the handling like LIBC_HDRGEN does because this is
only for the GPU build, which isn't fully set up until way later. So
this is probably the easiest way to just allow people to build these
tools even without a GPU build setup.

Added: 
    

Modified: 
    libc/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 7afb3c5f0faa95..a0d79858a896ad 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -61,7 +61,8 @@ if(LLVM_LIBC_FULL_BUILD OR LLVM_LIBC_GPU_BUILD)
   endif()
 endif()
 # We will build the GPU utilities if we are not doing a runtimes build.
-if(LLVM_LIBC_GPU_BUILD AND NOT LLVM_RUNTIMES_BUILD)
+option(LIBC_BUILD_GPU_LOADER "Always build the GPU loader utilities" OFF)
+if(LIBC_BUILD_GPU_LOADER OR (LLVM_LIBC_GPU_BUILD AND NOT LLVM_RUNTIMES_BUILD))
   add_subdirectory(utils/gpu)
 endif()
 


        


More information about the libc-commits mailing list