summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-04-26 14:20:47 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-04-26 14:21:13 (GMT)
commit768c36e2566bc66cdfe593715816321df683c0a0 (patch)
tree49723f28b5f546da1871d12a6df71d3bcebd2226 /Modules
parentd77b3d342e133fe885d4ab6bb7b4285d3e5aaacc (diff)
parent11a9f88bdf0cc06656c561b745b87b04e6181918 (diff)
downloadCMake-768c36e2566bc66cdfe593715816321df683c0a0.zip
CMake-768c36e2566bc66cdfe593715816321df683c0a0.tar.gz
CMake-768c36e2566bc66cdfe593715816321df683c0a0.tar.bz2
Merge topic 'FindCUDAToolkit_nvrtc_windows_dependencies'
11a9f88bdf FindCUDAToolkit: Fix nvrtc_static dependencies on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8405
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindCUDAToolkit.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 4423ebb..a91580d 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -1146,7 +1146,12 @@ if(CUDAToolkit_FOUND)
_CUDAToolkit_find_and_add_import_lib(nvrtc DEPS nvrtc_builtins nvJitLink)
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.5.0)
_CUDAToolkit_find_and_add_import_lib(nvrtc_builtins_static ALT nvrtc-builtins_static DEPS cuda_driver)
- _CUDAToolkit_find_and_add_import_lib(nvrtc_static DEPS nvrtc_builtins_static nvptxcompiler_static nvJitLink_static)
+ if(NOT TARGET CUDA::nvrtc_static)
+ _CUDAToolkit_find_and_add_import_lib(nvrtc_static DEPS nvrtc_builtins_static nvptxcompiler_static nvJitLink_static)
+ if(TARGET CUDA::nvrtc_static AND WIN32 AND NOT (BORLAND OR MINGW OR CYGWIN))
+ target_link_libraries(CUDA::nvrtc_static INTERFACE Ws2_32.lib)
+ endif()
+ endif()
endif()
_CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml)