aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-09-21 15:56:01 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2019-04-12 11:47:28 +0100
commit3fc3695624f8929bc137a3e81558da2822c74784 (patch)
tree35bc33ebbb0af7c6d7a291920ba60ff503c6b23c
parent0a0b473e840ccee3b3d1353902010bc84c2ca96f (diff)
downloadmeson-3fc3695624f8929bc137a3e81558da2822c74784.zip
meson-3fc3695624f8929bc137a3e81558da2822c74784.tar.gz
meson-3fc3695624f8929bc137a3e81558da2822c74784.tar.bz2
Push formatting of compiler version string down into Compiler class
-rw-r--r--mesonbuild/compilers/compilers.py6
-rw-r--r--mesonbuild/interpreter.py9
2 files changed, 8 insertions, 7 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index e29ca55..ed158b6 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -914,6 +914,12 @@ class Compiler:
def get_id(self):
return self.id
+ def get_version_string(self):
+ details = [self.id, self.version]
+ if self.full_version:
+ details += ['"%s"' % (self.full_version)]
+ return '(%s)' % (' '.join(details))
+
def get_language(self):
return self.language
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 1cf56a2..79da399 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2704,17 +2704,12 @@ external dependencies (including libraries) must go to "dependencies".''')
continue
else:
raise
- if comp.full_version is not None:
- version_string = '(%s %s "%s")' % (comp.id, comp.version, comp.full_version)
- else:
- version_string = '(%s %s)' % (comp.id, comp.version)
mlog.log('Native', comp.get_display_language(), 'compiler:',
- mlog.bold(' '.join(comp.get_exelist())), version_string)
+ mlog.bold(' '.join(comp.get_exelist())), comp.get_version_string())
self.build.ensure_static_linker(comp)
if need_cross_compiler:
- version_string = '(%s %s)' % (cross_comp.id, cross_comp.version)
mlog.log('Cross', cross_comp.get_display_language(), 'compiler:',
- mlog.bold(' '.join(cross_comp.get_exelist())), version_string)
+ mlog.bold(' '.join(cross_comp.get_exelist())), cross_comp.get_version_string())
self.build.ensure_static_cross_linker(cross_comp)
langs = self.coredata.compilers.keys()