Skip to content

BinUtils: Restore toolchain prefix detection from compiler name 'c++'

Lihua Zhao requested to merge lzhao/cmake:cxxprefix into master

!5606 (merged) modified Modules/CMakeDetermineCXXCompiler.cmake file with following changes:

-    if (COMPILER_BASENAME MATCHES "^(.+-)(clan)?[gc]\\+\\+(-[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$")
+    if (COMPILER_BASENAME MATCHES "^(.+-)?(clang\\+\\+|g\\+\\+|clang-cl)(-[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$")

The old logic accept clang++ g++ c++ The new logic doesn't accept c++

It block our product, c++ should be add:

if (COMPILER_BASENAME MATCHES "^(.+-)?(clang\\+\\+|[gc]\\+\\+|clang-cl)(-[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$")

Fixes: #22069 (closed)
Backport: release

Edited by Brad King

Merge request reports