diff options
author | Brad King <brad.king@kitware.com> | 2022-11-03 12:15:04 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-11-03 12:15:12 (GMT) |
commit | 32352abbd12a02a31a16eac4e774a934675dff8e (patch) | |
tree | dd7493adb9562cece1dc816f0aa77eb70e348cdc /Modules | |
parent | 083b3198221885364d451a4dec79d958b6b1646a (diff) | |
parent | 62f13ed588da428699d84a7e61b6d33b3563a374 (diff) | |
download | CMake-32352abbd12a02a31a16eac4e774a934675dff8e.zip CMake-32352abbd12a02a31a16eac4e774a934675dff8e.tar.gz CMake-32352abbd12a02a31a16eac4e774a934675dff8e.tar.bz2 |
Merge topic 'correct_nvptxcompiler_not_linking_to_threads' into release-3.25
62f13ed588 FindCUDAToolkit: Restore usage from multiple directories
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7859
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index b019f0b..94c86e9 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -1058,8 +1058,10 @@ if(CUDAToolkit_FOUND) _CUDAToolkit_find_and_add_import_lib(nvrtc DEPS cuda_driver) if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.1.0) - _CUDAToolkit_find_and_add_import_lib(nvptxcompiler_static DEPS cuda_driver) - target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads) + if(NOT TARGET CUDA::nvptxcompiler_static) + _CUDAToolkit_find_and_add_import_lib(nvptxcompiler_static DEPS cuda_driver) + target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads) + endif() endif() _CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml) |