diff options
author | Nikita Sirgienko <nikita.sirgienko@intel.com> | 2020-12-06 11:03:49 (GMT) |
---|---|---|
committer | Nikita Sirgienko <warquark@gmail.com> | 2020-12-06 11:20:21 (GMT) |
commit | 7808cbd6443133b095cf7a87081cb8aa9d44a243 (patch) | |
tree | d23a06674a1c321348f998a6a327cb2ed1121ad0 /Modules | |
parent | 0ab0fe64acccdb8c8258b9887001da574441fb40 (diff) | |
download | CMake-7808cbd6443133b095cf7a87081cb8aa9d44a243.zip CMake-7808cbd6443133b095cf7a87081cb8aa9d44a243.tar.gz CMake-7808cbd6443133b095cf7a87081cb8aa9d44a243.tar.bz2 |
CMakeDetermineCompilerId: support Intel DPC++ compiler toolset for VS gen
Before Intel have only one compiler icl (Intel(R) C++ compiler) and
CMakeDetermineCompilerId has considered, that all toolchains with a word
"Intel" in the toolchain name is a icl compiler. But now Intel have also other
compiler - Intel(R) DPC++ compiler, which haven't working with cmake on
Visual Studio Generator because cmake try to use icl compiler, which cmake
can't found and because of this fails the configuration. This commit fix
this problem, and both compilers start to work correctly with
Visual Studio generator.
Fixes: #21546
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index b296ba7..8cf161f 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -279,6 +279,16 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_cl "$(CLToolExe)") elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*") set(id_cl clang.exe) + # Executable names have choosen according documentation + # URL: (https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-dpcpp-compiler/top.html#top_GUID-A9B4C91D-97AC-450D-9742-9D895BC8AEE1) + elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "Intel") + if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "DPC\\+\\+ Compiler") + set(id_cl dpcpp.exe) + elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "C\\+\\+ Compiler 2021") + set(id_cl icx.exe) + elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "C\\+\\+ Compiler") + set(id_cl icl.exe) + endif() else() set(id_cl cl.exe) endif() @@ -313,9 +323,6 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_toolset "<NdkToolchainVersion>${CMAKE_VS_PLATFORM_TOOLSET}</NdkToolchainVersion>") else() set(id_toolset "<PlatformToolset>${CMAKE_VS_PLATFORM_TOOLSET}</PlatformToolset>") - if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "Intel") - set(id_cl icl.exe) - endif() if(CMAKE_VS_PLATFORM_TOOLSET_VERSION) set(id_sep "\\") if(CMAKE_VS_PLATFORM_TOOLSET_VERSION VERSION_GREATER_EQUAL "14.20") |