diff options
author | Brad King <brad.king@kitware.com> | 2020-05-05 13:31:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-05-05 13:50:29 (GMT) |
commit | 5b304a75033905a33841a396773d356349930030 (patch) | |
tree | 098105d02ec089c4eda0b59b835b01180ea2624f /Tests/CMakeOnly | |
parent | 4c82f309c59d02899145bc25c0e9efc91a6f64ed (diff) | |
download | CMake-5b304a75033905a33841a396773d356349930030.zip CMake-5b304a75033905a33841a396773d356349930030.tar.gz CMake-5b304a75033905a33841a396773d356349930030.tar.bz2 |
CheckLanguage: Fix forwarding of CMAKE_CUDA_HOST_COMPILER
Fix the condition added by commit fada8cbfd6 (CheckLanguage: Report
CMAKE_CUDA_HOST_COMPILER if needed for compilation, 2019-05-31,
v3.15.0-rc1~12^2) to activate CUDA-specific logic. The old condition
had worked in our test suite only by accident because the loop variable
used in the test happened to be the name and value that the old
condition used! Update the test to use a different name.
Fixes: #19013
Diffstat (limited to 'Tests/CMakeOnly')
-rw-r--r-- | Tests/CMakeOnly/CheckLanguage/CMakeLists.txt | 18 |
1 files changed, 9 insertions, 9 deletions
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() |