File tree 1 file changed +10
-1
lines changed
openmp/libomptarget/cmake/Modules 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,16 @@ find_library (
134
134
135
135
# There is a libcuda.so in lib64/stubs that can be used for linking.
136
136
if (NOT LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES AND CUDA_FOUND)
137
- get_filename_component (CUDA_LIBDIR ${CUDA_LIBRARIES} DIRECTORY )
137
+ # Since CMake 3.3 FindCUDA.cmake defaults to using static libraries. In this
138
+ # case CUDA_LIBRARIES contains additional linker arguments which breaks
139
+ # get_filename_component below. Fortunately, since that change the module
140
+ # exports CUDA_cudart_static_LIBRARY which points to a single file in the
141
+ # right directory.
142
+ set (cuda_library ${CUDA_LIBRARIES} )
143
+ if (DEFINED CUDA_cudart_static_LIBRARY)
144
+ set (cuda_library ${CUDA_cudart_static_LIBRARY} )
145
+ endif ()
146
+ get_filename_component (CUDA_LIBDIR ${cuda_library} DIRECTORY )
138
147
find_library (
139
148
LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES
140
149
NAMES
You can’t perform that action at this time.
0 commit comments