From c9ca75e2cbf412bb16853662780729acffdb3b08 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Wed, 13 Jan 2016 16:28:26 -0200 Subject: [PATCH] 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. --- Tools/ardupilotwaf/mavgen.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tools/ardupilotwaf/mavgen.py b/Tools/ardupilotwaf/mavgen.py index 687a2533bb..095163c95c 100644 --- a/Tools/ardupilotwaf/mavgen.py +++ b/Tools/ardupilotwaf/mavgen.py @@ -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')