summaryrefslogtreecommitdiff
path: root/Modules/FindCUDA.cmake
diff options
context:
space:
mode:
authorWill Feng <willfeng@fb.com>2018-05-07 14:34:32 -0400
committerBrad King <brad.king@kitware.com>2018-05-09 08:24:22 -0400
commit53ffff2277c4d37380d4a55d4e251face8766d14 (patch)
tree4bb40985b13ea36624a4c069535ce8e775af2b48 /Modules/FindCUDA.cmake
parentdd3e1a737216b7c9bfb6c7569685b36a1bff9cba (diff)
downloadcmake-53ffff2277c4d37380d4a55d4e251face8766d14.tar.gz
FindCUDA: Add support for sccache
When `CMAKE_C_COMPILER` is `sccache`, pass plain `cl` as the host compiler to `nvcc`. Otherwise, `nvcc` does not accept it.
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r--Modules/FindCUDA.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index a0e4aa9b6e..82c44fc4f6 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -557,10 +557,10 @@ else()
set(c_compiler_realpath "")
endif()
set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC")
- elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache")
- # NVCC does not think it will work if it is passed clcache.exe as the host
- # compiler, which means that builds with CC=cl.exe won't work. Best to just
- # feed it whatever the actual cl.exe is as the host compiler.
+ elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache")
+ # NVCC does not think it will work if it is passed clcache.exe or sccache.exe
+ # as the host compiler, which means that builds with CC=cl.exe won't work.
+ # Best to just feed it whatever the actual cl.exe is as the host compiler.
set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC")
else()
set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}"