Skip to content

Commit a11e3ef

Browse files
richardlautargos
authored andcommitted
build: log detected compilers in --verbose mode
Log the versions of the detected compilers when the configure script is run with `--verbose` to help verify which compiler is being used if multiple toolchains are installed on the system. Signed-off-by: Richard Lau <[email protected]> PR-URL: #32715 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 3907de7 commit a11e3ef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

configure.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -826,21 +826,27 @@ def check_compiler(o):
826826
return
827827

828828
ok, is_clang, clang_version, gcc_version = try_check_compiler(CXX, 'c++')
829+
version_str = ".".join(map(str, clang_version if is_clang else gcc_version))
830+
print_verbose('Detected %sC++ compiler (CXX=%s) version: %s' %
831+
('clang ' if is_clang else '', CXX, version_str))
829832
if not ok:
830833
warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX)
831834
elif clang_version < (8, 0, 0) if is_clang else gcc_version < (6, 3, 0):
832835
warn('C++ compiler (CXX=%s, %s) too old, need g++ 6.3.0 or clang++ 8.0.0' %
833-
(CXX, ".".join(map(str, clang_version if is_clang else gcc_version))))
836+
(CXX, version_str))
834837

835838
ok, is_clang, clang_version, gcc_version = try_check_compiler(CC, 'c')
839+
version_str = ".".join(map(str, clang_version if is_clang else gcc_version))
840+
print_verbose('Detected %sC compiler (CC=%s) version: %s' %
841+
('clang ' if is_clang else '', CC, version_str))
836842
if not ok:
837843
warn('failed to autodetect C compiler version (CC=%s)' % CC)
838844
elif not is_clang and gcc_version < (4, 2, 0):
839845
# clang 3.2 is a little white lie because any clang version will probably
840846
# do for the C bits. However, we might as well encourage people to upgrade
841847
# to a version that is not completely ancient.
842848
warn('C compiler (CC=%s, %s) too old, need gcc 4.2 or clang 3.2' %
843-
(CC, ".".join(map(str, gcc_version))))
849+
(CC, version_str))
844850

845851
o['variables']['llvm_version'] = get_llvm_version(CC) if is_clang else '0.0'
846852

0 commit comments

Comments
 (0)