summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
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)