waf: mavgen: set system env during build instead of configure

By setting env.env during configure time makes changes be for the whole build
system scope and persistently, which may cause problems for other tasks and
tools.
This commit is contained in:
Gustavo Jose de Sousa 2016-01-13 17:05:48 -02:00 committed by Andrew Tridgell
parent e5c66de554
commit 5816dcba03
1 changed files with 5 additions and 3 deletions

View File

@ -37,7 +37,11 @@ def process_mavgen(self):
outputs.append(t)
self.source = []
self.create_task('mavgen', inputs, outputs)
task = self.create_task('mavgen', inputs, outputs)
task.env.env = dict(os.environ)
task.env.env['PYTHONPATH'] = task.env.MAVLINK_DIR
def configure(cfg):
"""
@ -47,7 +51,6 @@ def configure(cfg):
cfg.check_python_version(minver=(2,7,0))
env = cfg.env
cfg.env.env = dict(os.environ)
cfg.start_msg('Checking for message_definitions')
if not cfg.srcnode.find_resource('modules/mavlink/message_definitions/v1.0/ardupilotmega.xml'):
@ -60,6 +63,5 @@ def configure(cfg):
env.MAVLINK_HEADERS = cfg.bldnode.make_node('/libraries/GCS_MAVLink/include/mavlink/v1.0/').abspath()
env.MAVGEN = env.MAVLINK_DIR + '/pymavlink/tools/mavgen.py'
cfg.env.env['PYTHONPATH'] = env.MAVLINK_DIR
env.MAV_MSG_DEFS = cfg.srcnode.find_resource('modules/mavlink/message_definitions/v1.0/ardupilotmega.xml').abspath()