diff options
author | Brad King <brad.king@kitware.com> | 2021-06-21 13:46:24 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-06-21 13:46:30 (GMT) |
commit | 3a66a58fc1f06474741c71d240c6edde1e485ea9 (patch) | |
tree | cbf073981721470c19d0546ee1d326f9a9da62ac | |
parent | d64d2d12c39f54f953fa946cf01fedf33ee2db70 (diff) | |
parent | c8eb35773806174480070c17785e6c8dd5dc1e4c (diff) | |
download | CMake-3a66a58fc1f06474741c71d240c6edde1e485ea9.zip CMake-3a66a58fc1f06474741c71d240c6edde1e485ea9.tar.gz CMake-3a66a58fc1f06474741c71d240c6edde1e485ea9.tar.bz2 |
Merge topic 'compiler-id-lang-vars' into release-3.21
c8eb357738 CompilerId: Tolerate variables named for languages
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6243
-rw-r--r-- | Modules/CMakeCompilerIdDetection.cmake | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake index 2197790..dd70d82 100644 --- a/Modules/CMakeCompilerIdDetection.cmake +++ b/Modules/CMakeCompilerIdDetection.cmake @@ -13,8 +13,8 @@ endfunction() function(compiler_id_detection outvar lang) - if (NOT lang STREQUAL Fortran AND NOT lang STREQUAL CSharp - AND NOT lang STREQUAL ISPC) + if (NOT "x${lang}" STREQUAL "xFortran" AND NOT "x${lang}" STREQUAL "xCSharp" + AND NOT "x${lang}" STREQUAL "xISPC") file(GLOB lang_files "${CMAKE_ROOT}/Modules/Compiler/*-DetermineCompiler.cmake") set(nonlang CXX) @@ -42,7 +42,7 @@ function(compiler_id_detection outvar lang) # Order is relevant here. For example, compilers which pretend to be # GCC must appear before the actual GCC. - if (lang STREQUAL CXX) + if ("x${lang}" STREQUAL "xCXX") list(APPEND ordered_compilers Comeau ) @@ -70,7 +70,7 @@ function(compiler_id_detection outvar lang) Fujitsu GHS ) - if (lang STREQUAL C) + if ("x${lang}" STREQUAL "xC") list(APPEND ordered_compilers TinyCC Bruce @@ -92,13 +92,13 @@ function(compiler_id_detection outvar lang) ADSP IAR ) - if (lang STREQUAL C) + if ("x${lang}" STREQUAL "xC") list(APPEND ordered_compilers SDCC ) endif() - if(lang STREQUAL CUDA) + if("x${lang}" STREQUAL "xCUDA") set(ordered_compilers NVIDIA Clang) endif() |