[libc-commits] [libc] 18d0d9b - [libc] Update install directory for offloading versions of libraries (#83592)

via libc-commits libc-commits at lists.llvm.org
Fri Mar 1 08:48:36 PST 2024


Author: Joseph Huber
Date: 2024-03-01T10:48:32-06:00
New Revision: 18d0d9b9b2e99ba1d22b9c7c3352f5f9df978d2c

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

LOG: [libc] Update install directory for offloading versions of libraries (#83592)

Summary:
These currently go to `lib/`, but if the user has `lib/<triple>` they
should go there because it's always searched first.

Added: 
    

Modified: 
    libc/CMakeLists.txt
    libc/lib/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 75fcc91757b807..7c7322e3043393 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -232,7 +232,7 @@ else()
     set(LIBC_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
   endif()
   if(LIBC_TARGET_OS_IS_GPU)
-    set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
+    set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LIBC_TARGET_TRIPLE})
   else()
     set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR})
   endif()

diff  --git a/libc/lib/CMakeLists.txt b/libc/lib/CMakeLists.txt
index e5ebd1e10084d7..37acf3950b4602 100644
--- a/libc/lib/CMakeLists.txt
+++ b/libc/lib/CMakeLists.txt
@@ -77,9 +77,13 @@ install(
 )
 
 if(LIBC_TARGET_OS_IS_GPU)
+  set(gpu_install_dir lib${LLVM_LIBDIR_SUFFIX})
+  if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
+    set(gpu_install_dir lib${LLVM_LIBDIR_SUFFIX}/${LLVM_HOST_TRIPLE})
+  endif()
   install(
     TARGETS ${added_gpu_archive_targets}
-    ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+    ARCHIVE DESTINATION ${gpu_install_dir}
     COMPONENT libc
   )
   foreach(file ${added_gpu_bitcode_targets})


        


More information about the libc-commits mailing list