summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeTestCUDACompiler.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-22 11:36:17 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-22 12:15:38 (GMT)
commit16bed00712a01371fd0d871ca8ce786381f457cb (patch)
tree34e6d9d3e825bbff8e7ecd399c50f6c5e6ce6bd3 /Modules/CMakeTestCUDACompiler.cmake
parent5c7ca6f8a87f8c673088103a4d00a176f8cd93fe (diff)
downloadCMake-16bed00712a01371fd0d871ca8ce786381f457cb.zip
CMake-16bed00712a01371fd0d871ca8ce786381f457cb.tar.gz
CMake-16bed00712a01371fd0d871ca8ce786381f457cb.tar.bz2
CUDA: Refactor implicit library filtering
Filter CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES just after it is computed. Re-use the same exclusion list for filtering CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES to avoid duplication.
Diffstat (limited to 'Modules/CMakeTestCUDACompiler.cmake')
-rw-r--r--Modules/CMakeTestCUDACompiler.cmake18
1 files changed, 3 insertions, 15 deletions
diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake
index b3b62bd..6d39d3e 100644
--- a/Modules/CMakeTestCUDACompiler.cmake
+++ b/Modules/CMakeTestCUDACompiler.cmake
@@ -67,21 +67,9 @@ else()
set(CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES "${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES}")
endif()
- # Remove the following libraries from CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES and
- # CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES
- #
- # - cudart
- # - cudart_static
- # - cudadevrt
- #
- # Additionally on Linux:
- # - rt
- # - pthread
- # - dl
- #
- # These are controlled by CMAKE_CUDA_RUNTIME_LIBRARY
- list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES cudart cudart_static cudadevrt rt pthread dl)
- list(REMOVE_ITEM CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES cudart cudart_static cudadevrt rt pthread dl)
+ # Filter out implicit link libraries that should not be passed unconditionally.
+ # See CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES_EXCLUDE in CMakeDetermineCUDACompiler.
+ list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES ${CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES_EXCLUDE})
if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
# Remove the CUDA Toolkit include directories from the set of