CMakeDetermineCompilerId: Support versioned LLVM for Visual Studio.

Supports versioned LLVM toolsets like LLVM_v142, LLVM_v141,
LLVM_v141_xp, etc. for Visual Studio (2010 and later).

The name for versioned LLVM toolsets has "LLVM_" prefix
plus MSVC toolset name (i.e. v142, v141, v141_xp, etc.).

Fixes: #19203
This commit is contained in:
Zufu Liu
2019-05-02 10:45:53 +08:00
parent fb325daa55
commit c846dbf89e

View File

@@ -189,7 +189,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_platform ${CMAKE_VS_PLATFORM_NAME})
set(id_lang "${lang}")
set(id_PostBuildEvent_Command "")
if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm]$")
if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm](_v[0-9]+(_xp)?)?$")
set(id_cl_var "ClangClExecutable")
elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
set(id_cl clang.exe)