Skip to content

Commit 546880c

Browse files
tpwrulestridge
authored andcommitted
ardupilotwaf: rerun mavgen if pymavlink sources change
If the C header files or the Python generator sources change, then this causes the generator to rerun, fixed headers to get copied again, and dependent files to be rebuilt.
1 parent f75f801 commit 546880c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Tools/ardupilotwaf/mavgen.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ def process_mavgen(self):
7979
self.bld.fatal('mavgen: missing option output_dir')
8080

8181
inputs = self.to_nodes(self.bld.srcnode.find_node(self.source))
82+
# depend on fixed headers so a rebuild occurs if they change
83+
mavlink_dir = self.env.get_flat('MAVLINK_DIR')
84+
headers_dir = mavlink_dir+"/pymavlink/generator/C/include_v2.0"
85+
headers = self.bld.root.find_node(headers_dir) # expected to be absolute
86+
inputs.extend(headers.ant_glob("*.h"))
87+
# also depend on the generator source itself
88+
gen_src_dir = mavlink_dir+"/pymavlink/"
89+
gen_src = self.bld.root.find_node(gen_src_dir)
90+
inputs.extend(gen_src.ant_glob("__init__.py generator/*.py"))
91+
8292
outputs = []
8393

8494
self.source = []

0 commit comments

Comments
 (0)