summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-02-27 12:54:56 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-02-27 12:55:13 (GMT)
commit72a630645417dd19afeb621af6d64dcd71862065 (patch)
tree0e43461969091d8e1529f15059efa79340c4933f /Modules/CMakeDetermineCompilerId.cmake
parent2645839a83b96b43bb692f542b214ebee6a2245d (diff)
parent8375c303e272fd7d20383a86d0c99433b7e0da67 (diff)
downloadCMake-72a630645417dd19afeb621af6d64dcd71862065.zip
CMake-72a630645417dd19afeb621af6d64dcd71862065.tar.gz
CMake-72a630645417dd19afeb621af6d64dcd71862065.tar.bz2
Merge topic 'vs-llvm-extension'
8375c303e2 VS: Fix detection of clang-cl with -T llvm Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3024
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 8ba4246..59dab6d 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -181,7 +181,10 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(vs_version ${CMAKE_MATCH_1})
set(id_platform ${CMAKE_VS_PLATFORM_NAME})
set(id_lang "${lang}")
- if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
+ set(id_PostBuildEvent_Command "")
+ if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm]$")
+ set(id_cl_var "ClangClExecutable")
+ elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
set(id_cl clang.exe)
else()
set(id_cl cl.exe)
@@ -268,7 +271,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
set(id_src "${src}")
set(id_compile "ClCompile")
- set(id_PostBuildEvent_Command "for %%i in (${id_cl}) do %40echo CMAKE_${lang}_COMPILER=%%~$PATH:i")
+ if(id_cl_var)
+ set(id_PostBuildEvent_Command "echo CMAKE_${lang}_COMPILER=$(${id_cl_var})")
+ else()
+ set(id_PostBuildEvent_Command "for %%i in (${id_cl}) do %40echo CMAKE_${lang}_COMPILER=%%~$PATH:i")
+ endif()
set(id_Import_props "")
set(id_Import_targets "")
set(id_ItemDefinitionGroup_entry "")