summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCXXCompiler.cmake
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2018-12-11 08:08:42 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2019-02-06 16:43:55 (GMT)
commit42825fc220f9d05c8db629709a94deeced42be7a (patch)
tree8a3d02d7d0ab2d7335d7d3dc37f6961db50b21ed /Modules/CMakeDetermineCXXCompiler.cmake
parent062cfd991faac000d484c74e5af7d65726c655dc (diff)
downloadCMake-42825fc220f9d05c8db629709a94deeced42be7a.zip
CMake-42825fc220f9d05c8db629709a94deeced42be7a.tar.gz
CMake-42825fc220f9d05c8db629709a94deeced42be7a.tar.bz2
MinGW: Fix locating BinUtils when compiler has a suffix
While all executables from a mingw toolchain share a common prefix, only the ones provided with the compiler have a suffix, the binutils do not. Fixes: #18879
Diffstat (limited to 'Modules/CMakeDetermineCXXCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index bd878b2..68cb9fe 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -136,8 +136,9 @@ if (CMAKE_CROSSCOMPILING AND 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 "^(.+-)(clan)?[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+ if (COMPILER_BASENAME MATCHES "^(.+-)(clan)?[gc]\\+\\+(-[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+ set(_CMAKE_COMPILER_SUFFIX ${CMAKE_MATCH_5})
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
if(CMAKE_CXX_COMPILER_TARGET)
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-)