Skip to content

Commit 9915774

Browse files
committed
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 Backport-PR-URL: #32820 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 5436569 commit 9915774

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

configure.py

+6
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,9 @@ def check_compiler(o):
750750
return
751751

752752
ok, is_clang, clang_version, gcc_version = try_check_compiler(CXX, 'c++')
753+
version_str = ".".join(map(str, clang_version if is_clang else gcc_version))
754+
print_verbose('Detected %sC++ compiler (CXX=%s) version: %s' %
755+
('clang ' if is_clang else '', CXX, version_str))
753756
if not ok:
754757
warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX)
755758
elif sys.platform.startswith('aix') and gcc_version < (6, 3, 0):
@@ -758,6 +761,9 @@ def check_compiler(o):
758761
warn('C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=%s)' % CXX)
759762

760763
ok, is_clang, clang_version, gcc_version = try_check_compiler(CC, 'c')
764+
version_str = ".".join(map(str, clang_version if is_clang else gcc_version))
765+
print_verbose('Detected %sC compiler (CC=%s) version: %s' %
766+
('clang ' if is_clang else '', CC, version_str))
761767
if not ok:
762768
warn('failed to autodetect C compiler version (CC=%s)' % CC)
763769
elif not is_clang and gcc_version < (4, 2, 0):

0 commit comments

Comments
 (0)