diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2023-04-07 18:16:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-04-25 17:37:19 (GMT) |
commit | 11a9f88bdf0cc06656c561b745b87b04e6181918 (patch) | |
tree | b8a72e49272c1bf53befbefb08f84347f7f7208c /Modules | |
parent | 35c8f504aeafd958ecd38f8a6155d6dbc96fb181 (diff) | |
download | CMake-11a9f88bdf0cc06656c561b745b87b04e6181918.zip CMake-11a9f88bdf0cc06656c561b745b87b04e6181918.tar.gz CMake-11a9f88bdf0cc06656c561b745b87b04e6181918.tar.bz2 |
FindCUDAToolkit: Fix nvrtc_static dependencies on Windows
Required for CUDA toolkit 11.5:
* https://docs.nvidia.com/cuda/archive/11.5.0/nvrtc/index.html#build-instruction
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index fcafe65..d94a32b 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -1126,7 +1126,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) |