diff options
author | Brad King <brad.king@kitware.com> | 2020-05-05 14:00:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-05-05 14:00:54 (GMT) |
commit | f9283f005b021cc8356aa15d02644c15ca88f030 (patch) | |
tree | 2af8b41f794047f8f3d7603ec78c4746a79b3f6b | |
parent | a9490db79894f08cdff1e7e5c1a393c4a72631b2 (diff) | |
parent | 5b304a75033905a33841a396773d356349930030 (diff) | |
download | CMake-f9283f005b021cc8356aa15d02644c15ca88f030.zip CMake-f9283f005b021cc8356aa15d02644c15ca88f030.tar.gz CMake-f9283f005b021cc8356aa15d02644c15ca88f030.tar.bz2 |
Merge branch 'CheckLanguage-cuda-host' into release-3.16
Merge-request: !4711
-rw-r--r-- | Modules/CheckLanguage.cmake | 2 | ||||
-rw-r--r-- | Tests/CMakeOnly/CheckLanguage/CMakeLists.txt | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index a1a3a7a..95e4fbe 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -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() diff --git a/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt b/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt index 90aa921..1570c37 100644 --- a/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt @@ -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() |