[Openmp-commits] [PATCH] D87195: [CMake][OpenMP] Simplify getting CUDA library target

Raul Tambre via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Sep 5 08:30:15 PDT 2020


tambre created this revision.
tambre added a reviewer: Hahnfeld.
Herald added subscribers: openmp-commits, guansong, yaxunl, mgorny.
Herald added a project: OpenMP.
tambre requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

LLVM now requires CMake 3.13.4 so we can simplify this.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87195

Files:
  openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake


Index: openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
===================================================================
--- openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+++ openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
@@ -137,16 +137,7 @@
 
 # There is a libcuda.so in lib64/stubs that can be used for linking.
 if (NOT LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES AND CUDA_FOUND)
-  # Since CMake 3.3 FindCUDA.cmake defaults to using static libraries. In this
-  # case CUDA_LIBRARIES contains additional linker arguments which breaks
-  # get_filename_component below. Fortunately, since that change the module
-  # exports CUDA_cudart_static_LIBRARY which points to a single file in the
-  # right directory.
-  set(cuda_library ${CUDA_LIBRARIES})
-  if (DEFINED CUDA_cudart_static_LIBRARY)
-    set(cuda_library ${CUDA_cudart_static_LIBRARY})
-  endif()
-  get_filename_component(CUDA_LIBDIR ${cuda_library} DIRECTORY)
+  get_filename_component(CUDA_LIBDIR ${CUDA_cudart_static_LIBRARY} DIRECTORY)
   find_library (
       LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES
     NAMES


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87195.290096.patch
Type: text/x-patch
Size: 1140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200905/05532fa4/attachment.bin>


More information about the Openmp-commits mailing list