mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
BinUtils: Restore toolchain prefix detection from compiler name 'c++'
Since commit b12aec6c8d
(BinUtils: prefer bin utils matching the
compiler version extension, 2020-12-11, v3.20.0-rc1~171^2) we recognize
`clangg++` and `g++` but not `c++`. Restore `[gc]` in place of `g`
in the regex, as we had before that change.
Fixes: #22069
This commit is contained in:
@@ -161,7 +161,7 @@ if (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|QCC")
|
||||
get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
|
||||
if (COMPILER_BASENAME MATCHES "^(.+-)?(clang\\+\\+|g\\+\\+|clang-cl)(-[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$")
|
||||
if (COMPILER_BASENAME MATCHES "^(.+-)?(clang\\+\\+|[gc]\\+\\+|clang-cl)(-[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$")
|
||||
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||
set(_CMAKE_TOOLCHAIN_SUFFIX ${CMAKE_MATCH_3})
|
||||
set(_CMAKE_COMPILER_SUFFIX ${CMAKE_MATCH_5})
|
||||
|
Reference in New Issue
Block a user