diff options
author | Brad King <brad.king@kitware.com> | 2017-06-13 13:18:13 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-06-13 13:18:19 (GMT) |
commit | 087b8ccda98af32480657d2e54b5395aac3b413f (patch) | |
tree | 786571374c239409b24edfa85c69f00c5e3a60aa /Modules/Platform | |
parent | 4ba2d2e3d76cb1ec04c612f9646c47d3f1231ad2 (diff) | |
parent | 7368ade2502a347b18c47fc175b67c1d0f594744 (diff) | |
download | CMake-087b8ccda98af32480657d2e54b5395aac3b413f.zip CMake-087b8ccda98af32480657d2e54b5395aac3b413f.tar.gz CMake-087b8ccda98af32480657d2e54b5395aac3b413f.tar.bz2 |
Merge topic 'cuda-dlink-no-deprecated-gpu'
7368ade2 CUDA: When linking device code suppress CUDA 8.0+ deprecation warnings
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !951
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Windows-NVIDIA-CUDA.cmake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/Platform/Windows-NVIDIA-CUDA.cmake b/Modules/Platform/Windows-NVIDIA-CUDA.cmake index 845fa4b..970c2c6 100644 --- a/Modules/Platform/Windows-NVIDIA-CUDA.cmake +++ b/Modules/Platform/Windows-NVIDIA-CUDA.cmake @@ -30,10 +30,18 @@ set(CMAKE_CUDA_LINK_EXECUTABLE unset(_CMAKE_VS_LINK_EXE) unset(_CMAKE_VS_LINK_EXE) +if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0") + set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "-Wno-deprecated-gpu-targets") +else() + set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "") +endif() + set(CMAKE_CUDA_DEVICE_LINK_LIBRARY - "<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS") + "<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS") set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE - "<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS") + "<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS") + +unset(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS) string(REPLACE "/D" "-D" _PLATFORM_DEFINES_CUDA "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_CXX}") |