waf: mavgen: set task signature for dynamic output

Since the output list for mavgen is dynamic, in the sense that we don't have
the information of what files will be generated by the task, that is not
captured by default by waf and post_run can't save the task signature for those
files. Although that doesn't cause build errors, the build time increase
significantly for when tasks that use the generate files are included (for
example, vehicles builds).

This patch search for the headers that were created by the task and set the
task signature for them. Using ant_glob isn't a very good solution, since there
may be stray file in the local build directory, but let's use that for now
until we find a better approach.
This commit is contained in:
Gustavo Jose de Sousa 2016-01-13 16:28:26 -02:00 committed by Andrew Tridgell
parent b3c1c2efd9
commit c9ca75e2cb
1 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,11 @@ class mavgen(Task.Task):
color = 'GREEN'
run_str = '${PYTHON} ${MAVGEN} --lang=C --wire-protocol=1.0 --output ${TGT} ${SRC}'
def post_run(self):
super(mavgen, self).post_run()
for header in self.generator.output_dir.ant_glob("*.h **/*.h", remove=False):
header.sig = header.cache_sig = self.cache_sig
def options(opt):
opt.load('python')