aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-03-24 18:37:00 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-03-27 11:25:22 +0530
commit996af2556726383449036ab0512029ead3a3f18f (patch)
tree65ae966a3f9f2528c94272943a32e88f96c6cf55
parent14d0f381580222f4b4eac376f514fcfcfdb6ee4c (diff)
downloadmeson-996af2556726383449036ab0512029ead3a3f18f.zip
meson-996af2556726383449036ab0512029ead3a3f18f.tar.gz
meson-996af2556726383449036ab0512029ead3a3f18f.tar.bz2
compilers: Implement __repr__ for easier debugging
-rw-r--r--mesonbuild/compilers.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 7f1897c..22fb522 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -514,6 +514,11 @@ class Compiler:
self.version = version
self.base_options = []
+ def __repr__(self):
+ repr_str = "<{0}: v{1} `{2}`>"
+ return repr_str.format(self.__class__.__name__, self.version,
+ ' '.join(self.exelist))
+
def can_compile(self, src):
if hasattr(src, 'fname'):
src = src.fname