diff options
author | Brad King <brad.king@kitware.com> | 2020-11-25 07:52:53 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-25 09:11:21 -0500 |
commit | f3d4254b3d2437938440257cd989cb87da517e01 (patch) | |
tree | 8e71b84d4ad76e9ec895dd37f8f57f9fb5e08cc5 /Modules/Internal/CheckSourceCompiles.cmake | |
parent | 01d91ae5f26c25fe11e4eedd16ed8d8163636015 (diff) | |
download | cmake-f3d4254b3d2437938440257cd989cb87da517e01.tar.gz |
Check*: Tolerate variables set with names of languages
Fix the language checks added by commit 90dead024c (CheckCompilerFlag:
unified way to check compiler flags per language, 2020-09-25,
v3.19.0-rc1~88^2), commit 10ae907de0 (CheckSoureCompiles: Add a unified
way to check if a source compiles, 2020-09-14, v3.19.0-rc1~118^2~1), and
commit 357e2ef429 (CheckSoureRuns: Add a unified way to check if a
source runs, 2020-09-14, v3.19.0-rc1~118^2) to work when variables of
the language names are set.
Fixes: #21500
Diffstat (limited to 'Modules/Internal/CheckSourceCompiles.cmake')
-rw-r--r-- | Modules/Internal/CheckSourceCompiles.cmake | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/Internal/CheckSourceCompiles.cmake b/Modules/Internal/CheckSourceCompiles.cmake index 91c89640f3..3b2152ae54 100644 --- a/Modules/Internal/CheckSourceCompiles.cmake +++ b/Modules/Internal/CheckSourceCompiles.cmake @@ -10,25 +10,25 @@ cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var) if(NOT DEFINED "${_var}") - if(_lang STREQUAL C) + if(_lang STREQUAL "C") set(_lang_textual "C") set(_lang_ext "c") - elseif(_lang STREQUAL CXX) + elseif(_lang STREQUAL "CXX") set(_lang_textual "C++") set(_lang_ext "cxx") - elseif(_lang STREQUAL CUDA) + elseif(_lang STREQUAL "CUDA") set(_lang_textual "CUDA") set(_lang_ext "cu") - elseif(_lang STREQUAL Fortran) + elseif(_lang STREQUAL "Fortran") set(_lang_textual "Fortran") set(_lang_ext "F90") - elseif(_lang STREQUAL ISPC) + elseif(_lang STREQUAL "ISPC") set(_lang_textual "ISPC") set(_lang_ext "ispc") - elseif(_lang STREQUAL OBJC) + elseif(_lang STREQUAL "OBJC") set(_lang_textual "Objective-C") set(_lang_ext "m") - elseif(_lang STREQUAL OBJCXX) + elseif(_lang STREQUAL "OBJCXX") set(_lang_textual "Objective-C++") set(_lang_ext "mm") else() |