summaryrefslogtreecommitdiffstats
path: root/Modules/FindCUDAToolkit.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-18 14:23:27 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-11-18 14:23:36 (GMT)
commit66b64b59849c6948d976ee36e78cb03efa5bbed4 (patch)
tree5bdafdc74b0b9d0289cc0a5569e8142f2c325be3 /Modules/FindCUDAToolkit.cmake
parent572679a62e835833e7989630d77ab2e9802b1485 (diff)
parentc7ece269daaaa2275c29c99f97c6e13999ec2fc2 (diff)
downloadCMake-66b64b59849c6948d976ee36e78cb03efa5bbed4.zip
CMake-66b64b59849c6948d976ee36e78cb03efa5bbed4.tar.gz
CMake-66b64b59849c6948d976ee36e78cb03efa5bbed4.tar.bz2
Merge topic 'FindCUDAToolkit_handle_nvptxcompiler_static_not_existing'
c7ece269da FindCUDAToolkit: Handle toolkits that don't provide nvptxcompiler Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7932
Diffstat (limited to 'Modules/FindCUDAToolkit.cmake')
-rw-r--r--Modules/FindCUDAToolkit.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 365b72a..62e54c8 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -1060,7 +1060,9 @@ if(CUDAToolkit_FOUND)
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.1.0)
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)
+ if(TARGET CUDA::nvptxcompiler_static)
+ target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads)
+ endif()
endif()
endif()