Skip to content

Commit 13f3d6c

Browse files
richardlauMylesBorins
authored andcommitted
build: log the found compiler version if too old
`configure` will log a warning if the detected compiler is not new enough. Take some of the guesswork out of it by also logging the version of the compiler that was detected. PR-URL: #30028 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
1 parent 35bffcd commit 13f3d6c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

configure.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,8 @@ def check_compiler(o):
775775
if not ok:
776776
warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX)
777777
elif clang_version < (8, 0, 0) if is_clang else gcc_version < (6, 3, 0):
778-
warn('C++ compiler too old, need g++ 6.3.0 or clang++ 8.0.0 (CXX=%s)' % CXX)
778+
warn('C++ compiler (CXX=%s, %s) too old, need g++ 6.3.0 or clang++ 8.0.0' %
779+
(CXX, ".".join(map(str, clang_version if is_clang else gcc_version))))
779780

780781
ok, is_clang, clang_version, gcc_version = try_check_compiler(CC, 'c')
781782
if not ok:
@@ -784,7 +785,8 @@ def check_compiler(o):
784785
# clang 3.2 is a little white lie because any clang version will probably
785786
# do for the C bits. However, we might as well encourage people to upgrade
786787
# to a version that is not completely ancient.
787-
warn('C compiler too old, need gcc 4.2 or clang 3.2 (CC=%s)' % CC)
788+
warn('C compiler (CC=%s, %s) too old, need gcc 4.2 or clang 3.2' %
789+
(CC, ".".join(map(str, gcc_version))))
788790

789791
o['variables']['llvm_version'] = get_llvm_version(CC) if is_clang else '0.0'
790792

0 commit comments

Comments
 (0)