summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-08 11:46:08 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-08 11:46:15 (GMT)
commitc3fab3e62d9cb044c7d716feefb703039ef7715f (patch)
treeef388db8ba4339f73b4fedaee8b609b9bbc780d4 /Modules/Compiler
parent1c3ea347154d06e22f4dee91ba0afe75d9943dc0 (diff)
parent8e38985db7cb2c66f7fe74919e03e3f3ae0d0c41 (diff)
downloadCMake-c3fab3e62d9cb044c7d716feefb703039ef7715f.zip
CMake-c3fab3e62d9cb044c7d716feefb703039ef7715f.tar.gz
CMake-c3fab3e62d9cb044c7d716feefb703039ef7715f.tar.bz2
Merge topic 'cuda-depfile-ccbin'
8e38985db7 Makefiles: Fix dependency extraction with CUDA < 10.2 and host compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Raul Tambre <raul@tambre.ee> Acked-by: Robert Maynard <robertjmaynard@gmail.com> Merge-request: !5992
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake10
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index eb80675..a0f7c05 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -30,7 +30,15 @@ if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89)
# to get header dependency information
set(CMAKE_DEPFILE_FLAGS_CUDA "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
else()
- set(CMAKE_CUDA_DEPENDS_EXTRA_COMMANDS "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_CUDA_FLAG} -M <SOURCE> -MT <OBJECT> -o <DEP_FILE>")
+ if(CMAKE_CUDA_HOST_COMPILER AND NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ # FIXME: Move the main -ccbin= flag from CMakeCUDAInformation to
+ # a block above, remove this copy, and update the VS generator too.
+ set(_CMAKE_CUDA_EXTRA_FLAGS_LOCAL " -ccbin=<CMAKE_CUDA_HOST_COMPILER>")
+ else()
+ set(_CMAKE_CUDA_EXTRA_FLAGS_LOCAL "")
+ endif()
+ set(CMAKE_CUDA_DEPENDS_EXTRA_COMMANDS "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS}${_CMAKE_CUDA_EXTRA_FLAGS_LOCAL} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_CUDA_FLAG} -M <SOURCE> -MT <OBJECT> -o <DEP_FILE>")
+ unset(_CMAKE_CUDA_EXTRA_FLAGS_LOCAL)
endif()
set(CMAKE_CUDA_DEPFILE_FORMAT gcc)
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)