CheckLanguage: Don't pass CMAKE_CUDA_HOST_COMPILER for Visual Studio

Visual Studio doesn't support specifying it and if we do we get a warning.

Fixes: #22712
This commit is contained in:
Raul Tambre
2021-10-17 20:18:00 +03:00
committed by Brad King
parent 9b29cfd21f
commit 7123c8fdbf

View File

@@ -46,7 +46,7 @@ macro(check_language lang)
file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang})
set(extra_compiler_variables)
if(${lang} STREQUAL CUDA)
if(${lang} STREQUAL CUDA AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
set(extra_compiler_variables "set(CMAKE_CUDA_HOST_COMPILER \\\"\${CMAKE_CUDA_HOST_COMPILER}\\\")")
endif()