diff options
author | Brad King <brad.king@kitware.com> | 2023-04-26 14:20:47 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-04-26 14:21:12 (GMT) |
commit | f0b45e6dbbdda3787687fc237492ea2a233c3b30 (patch) | |
tree | 014962f89ac062fc00770d0b1b07ceafa48b7252 | |
parent | 32c3dbbee8a9b2005b4040761efec622fa822f28 (diff) | |
parent | 11a9f88bdf0cc06656c561b745b87b04e6181918 (diff) | |
download | CMake-f0b45e6dbbdda3787687fc237492ea2a233c3b30.zip CMake-f0b45e6dbbdda3787687fc237492ea2a233c3b30.tar.gz CMake-f0b45e6dbbdda3787687fc237492ea2a233c3b30.tar.bz2 |
Merge topic 'FindCUDAToolkit_nvrtc_windows_dependencies' into release-3.26
11a9f88bdf FindCUDAToolkit: Fix nvrtc_static dependencies on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8405
-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) |