summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCCompiler.cmake
diff options
context:
space:
mode:
authorThomas Bernard <thomas@famillebernardgouriou.fr>2020-12-11 21:51:11 (GMT)
committerBrad King <brad.king@kitware.com>2021-01-11 16:33:37 (GMT)
commitb12aec6c8daa3e087e6d0fa0441f59622251eb46 (patch)
treec42489408f58377d7d0c5a7e99cd6e3465909395 /Modules/CMakeDetermineCCompiler.cmake
parent06dfa5a7b6c0174bfcb4691a9aaf00809bd7271d (diff)
downloadCMake-b12aec6c8daa3e087e6d0fa0441f59622251eb46.zip
CMake-b12aec6c8daa3e087e6d0fa0441f59622251eb46.tar.gz
CMake-b12aec6c8daa3e087e6d0fa0441f59622251eb46.tar.bz2
BinUtils: prefer bin utils matching the compiler version extension
Diffstat (limited to 'Modules/CMakeDetermineCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index ae3abe9..ab33b40 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -161,9 +161,10 @@ if (NOT _CMAKE_TOOLCHAIN_PREFIX)
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|QCC")
get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
- if (COMPILER_BASENAME MATCHES "^(.+-)(clang|g?cc)(-[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$")
+ if (COMPILER_BASENAME MATCHES "^(.+-)?(clang|g?cc)(-cl)?(-[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
- set(_CMAKE_COMPILER_SUFFIX ${CMAKE_MATCH_5})
+ set(_CMAKE_TOOLCHAIN_SUFFIX ${CMAKE_MATCH_4})
+ set(_CMAKE_COMPILER_SUFFIX ${CMAKE_MATCH_6})
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(CMAKE_C_COMPILER_TARGET)
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-)