Merge topic 'CheckLanguage-cuda-host'

5b304a7503 CheckLanguage: Fix forwarding of CMAKE_CUDA_HOST_COMPILER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !4711
This commit is contained in:
Brad King 2020-05-06 13:27:02 +00:00 committed by Kitware Robot
commit 1cadb625f2
2 changed files with 10 additions and 10 deletions

View File

@ -43,7 +43,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)
set(extra_compiler_variables "set(CMAKE_CUDA_HOST_COMPILER \\\"\${CMAKE_CUDA_HOST_COMPILER}\\\")")
endif()

View File

@ -18,16 +18,16 @@ if(APPLE)
list(APPEND LANGUAGES OBJC OBJCXX)
endif()
foreach(lang ${LANGUAGES})
check_language(${lang})
if(NOT DEFINED CMAKE_${lang}_COMPILER)
message(FATAL_ERROR "check_language(${lang}) did not set result")
foreach(test_lang ${LANGUAGES})
check_language(${test_lang})
if(NOT DEFINED CMAKE_${test_lang}_COMPILER)
message(FATAL_ERROR "check_language(${test_lang}) did not set result")
endif()
if(DEFINED expect_${lang})
if(expect_${lang} AND NOT CMAKE_${lang}_COMPILER)
message(FATAL_ERROR "check_language(${lang}) should not fail!")
elseif(NOT expect_${lang} AND CMAKE_${lang}_COMPILER)
message(FATAL_ERROR "check_language(${lang}) should not succeed!")
if(DEFINED expect_${test_lang})
if(expect_${test_lang} AND NOT CMAKE_${test_lang}_COMPILER)
message(FATAL_ERROR "check_language(${test_lang}) should not fail!")
elseif(NOT expect_${test_lang} AND CMAKE_${test_lang}_COMPILER)
message(FATAL_ERROR "check_language(${test_lang}) should not succeed!")
endif()
endif()
endforeach()