From 426637d10af6eb369ea8d115b97ec68988309c4f Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sat, 18 May 2013 19:31:56 +0200 Subject: [PATCH] Prevent unnecessary rebuilds in the qt processing A list was changed during iteration, causing an unnecessary dependency to be kept, and triggering subsequent rebuilds. This only occured with multiple .moc included. --- ChangeLog | 1 + waflib/Tools/qt4.py | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c496a3e..cf9ef39f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ NEW IN WAF 1.7.11 * Redundant check_dir call causing random uninstall failures #1313 * Append to moc flags instead of replacing them #1317 * Share moc tasks in the Qt processing #1318 +* Fixed a source of unnecessary rebuilds in the Qt processing NEW IN WAF 1.7.10 ----------------- diff --git a/waflib/Tools/qt4.py b/waflib/Tools/qt4.py index f8ebcc98..195532ca 100644 --- a/waflib/Tools/qt4.py +++ b/waflib/Tools/qt4.py @@ -115,14 +115,21 @@ class qxx(Task.classes['cxx']): self.moc_done = 0 def scan(self): - """Re-use the C/C++ scanner, but remove the moc files from the dependencies""" + """ + Re-use the C/C++ scanner, but remove the moc files from the dependencies + since the .cpp file already depends on all the headers + """ (nodes, names) = c_preproc.scan(self) - # for some reasons (variants) the moc node may end in the list of node deps + lst = [] for x in nodes: + # short lists, no need to use sets if x.name.endswith('.moc'): - nodes.remove(x) - names.append(x.path_from(self.inputs[0].parent.get_bld())) - return (nodes, names) + s = x.path_from(self.inputs[0].parent.get_bld()) + if s not in names: + names.append(s) + else: + lst.append(x) + return (lst, names) def runnable_status(self): """