2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 01:46:15 +01:00

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.
This commit is contained in:
Thomas Nagy 2013-05-18 19:31:56 +02:00
parent 8267e7ae97
commit 426637d10a
2 changed files with 13 additions and 5 deletions

View File

@ -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
-----------------

View File

@ -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):
"""