waf: define include path for mavlink only if necessary

By using the export_includes, the include paths for mavlink are enabled only
for libs or programs that depend on it.
This commit is contained in:
Gustavo Jose de Sousa 2016-01-13 18:52:56 -02:00 committed by Andrew Tridgell
parent 17e5d99509
commit 282c254897
1 changed files with 7 additions and 2 deletions

View File

@ -97,8 +97,7 @@ def configure(cfg):
cfg.env.prepend_value('INCLUDES', [ cfg.env.prepend_value('INCLUDES', [
cfg.srcnode.abspath() + '/libraries/', cfg.srcnode.abspath() + '/libraries/',
cfg.bldnode.abspath() +'/' + cfg.env.BOARD + '/libraries/', ])
cfg.bldnode.abspath() +'/' + cfg.env.BOARD + '/libraries/GCS_MAVLink'])
# TODO: Investigate if code could be changed to not depend on the # TODO: Investigate if code could be changed to not depend on the
# source absolute path. # source absolute path.
@ -125,6 +124,12 @@ def build(bld):
source='modules/mavlink/message_definitions/v1.0/ardupilotmega.xml', source='modules/mavlink/message_definitions/v1.0/ardupilotmega.xml',
target='libraries/GCS_MAVLink/include/mavlink/v1.0/', target='libraries/GCS_MAVLink/include/mavlink/v1.0/',
name='mavlink', name='mavlink',
# this below is not ideal, mavgen tool should set this, but that's not
# currently possible
export_includes=[
bld.bldnode.make_node('libraries').abspath(),
bld.bldnode.make_node('libraries/GCS_MAVLink').abspath(),
],
) )
# NOTE: Static library with vehicle set to UNKNOWN, shared by all # NOTE: Static library with vehicle set to UNKNOWN, shared by all