Slightly cleaner log output.

pull/15/head
Jussi Pakkanen 11 years ago
parent f23a5a1150
commit 44361baff1
  1. 24
      dependencies.py
  2. 4
      interpreter.py

@ -403,6 +403,8 @@ class GMockDependency(Dependency):
def found(self):
return self.is_found
qt5toolinfo_printed = False
class Qt5Dependency(Dependency):
def __init__(self, kwargs):
Dependency.__init__(self)
@ -418,10 +420,11 @@ class Qt5Dependency(Dependency):
raise DependencyException('No Qt5 modules specified.')
mlog.log('Dependency Qt5 tools:')
self.find_exes()
def find_exes(self):
# The binaries have different names on different
# distros. Joy.
global qt5toolinfo_printed
self.moc = ExternalProgram('moc', silent=True)
if not self.moc.found():
self.moc = ExternalProgram('moc-qt5', silent=True)
@ -448,9 +451,11 @@ class Qt5Dependency(Dependency):
else:
raise DependencyException('Moc preprocessor is not for Qt 5. Output:\n%s\n%s' %
(stdout, stderr))
mlog.log(' moc:', mlog.green('YES'), '(%s)' % moc_ver)
if not qt5toolinfo_printed:
mlog.log(' moc:', mlog.green('YES'), '(%s)' % moc_ver)
else:
mlog.log(' moc:', mlog.red('NO'))
if not qt5toolinfo_printed:
mlog.log(' moc:', mlog.red('NO'))
if self.uic.found():
up = subprocess.Popen([self.uic.get_command(), '-v'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@ -464,9 +469,11 @@ class Qt5Dependency(Dependency):
else:
raise DependencyException('Uic compiler is not for Qt 5. Output:\n%s\n%s' %
(stdout, stderr))
mlog.log(' uic:', mlog.green('YES'), '(%s)' % uic_ver)
if not qt5toolinfo_printed:
mlog.log(' uic:', mlog.green('YES'), '(%s)' % uic_ver)
else:
mlog.log(' uic:', mlog.red('NO'))
if not qt5toolinfo_printed:
mlog.log(' uic:', mlog.red('NO'))
if self.rcc.found():
rp = subprocess.Popen([self.rcc.get_command(), '-v'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@ -480,9 +487,12 @@ class Qt5Dependency(Dependency):
else:
raise DependencyException('Rcc compiler is not for Qt 5. Output:\n%s\n%s' %
(stdout, stderr))
mlog.log(' rcc:', mlog.green('YES'), '(%s)' % rcc_ver)
if not qt5toolinfo_printed:
mlog.log(' rcc:', mlog.green('YES'), '(%s)' % rcc_ver)
else:
mlog.log(' rcc:', mlog.red('NO'))
if not qt5toolinfo_printed:
mlog.log(' rcc:', mlog.red('NO'))
qt5toolinfo_printed = True
def get_version(self):
return self.modules[0].get_version()

@ -1052,7 +1052,6 @@ class Interpreter():
except coredata.MesonException as me:
me.file = buildfilename
raise me
mlog.log('Going to subdirectory "%s".' % self.subdir)
self.evaluate_codeblock(codeblock)
self.subdir = prev_subdir
@ -1167,7 +1166,8 @@ class Interpreter():
txt = ' cross build '
else:
txt = ' build '
mlog.log('Creating', txt, 'target "', mlog.bold(name), '" with %d files.' % len(sources), sep='')
displayname = os.path.join(l.held_object.subdir, name)
mlog.log('Creating', txt, 'target ', mlog.bold(displayname), ' with %d files.' % len(sources), sep='')
self.global_flags_frozen = True
return l

Loading…
Cancel
Save