summaryrefslogtreecommitdiff
path: root/Modules/CMakeCUDAInformation.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-11-29 12:07:31 -0500
committerRobert Maynard <robert.maynard@kitware.com>2019-11-29 14:21:35 -0500
commit5341f5e4a117c7b42f52250b9d66db2f6ca67724 (patch)
treef7d98542e0de55945a9d1a9a14cb28d14d14f999 /Modules/CMakeCUDAInformation.cmake
parent7f15c998519d83d49b16887c4e035336378d854b (diff)
downloadcmake-5341f5e4a117c7b42f52250b9d66db2f6ca67724.tar.gz
CUDA: get header deps from compiler invocation when possible
Before CUDA 10.2 `nvcc` didn't support providing header dependency information while compiling.
Diffstat (limited to 'Modules/CMakeCUDAInformation.cmake')
-rw-r--r--Modules/CMakeCUDAInformation.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index e14080887e..028fa13d10 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -148,11 +148,11 @@ if(NOT CMAKE_CUDA_COMPILE_WHOLE_COMPILATION)
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -c <SOURCE> -o <OBJECT>")
endif()
-if(CMAKE_GENERATOR STREQUAL "Ninja")
+if(CMAKE_GENERATOR STREQUAL "Ninja" AND NOT CMAKE_DEPFILE_FLAGS_CUDA )
set(CMAKE_CUDA_COMPILE_DEPENDENCY_DETECTION
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -M <SOURCE> -MT <OBJECT> -o $DEP_FILE")
#The Ninja generator uses the make file dependency files to determine what
- #files need to be recompiled. Unfortunately, nvcc doesn't support building
+ #files need to be recompiled. Unfortunately, nvcc < 10.2 doesn't support building
#a source file and generating the dependencies of said file in a single
#invocation. Instead we have to state that you need to chain two commands.
#