waf: allow partial builds with new mavlink as submodule

The task generator for the mavlink headers is given a name 'mavlink' and is
added as a dependency to all local static libraries, because all of them use
sources that include mavlink headers. It would be nice to have a good way to
detect sources that use mavlink headers or to declare list of libraries that
use the headers, so that the dependency could be added automatically.

Additionally, there's a minor change in syntax for the task generator: using
strings directly instead of lists.
This commit is contained in:
Gustavo Jose de Sousa 2016-01-13 18:35:37 -02:00 committed by Andrew Tridgell
parent ce294e841c
commit 17e5d99509
5 changed files with 11 additions and 3 deletions

View File

@ -24,6 +24,7 @@ def build(bld):
'AP_ServoRelayEvents',
'PID',
],
use='mavlink',
)
ardupilotwaf.program(

View File

@ -12,6 +12,7 @@ def build(bld):
libraries=ardupilotwaf.COMMON_VEHICLE_DEPENDENT_LIBRARIES + [
'PID',
],
use='mavlink',
)
ardupilotwaf.program(

View File

@ -33,6 +33,7 @@ def build(bld):
'AP_Relay',
'AP_ServoRelayEvents',
],
use='mavlink',
)
ardupilotwaf.program(

View File

@ -34,6 +34,7 @@ def build(bld):
'AP_Motors',
'AC_PID'
],
use='mavlink',
)
ardupilotwaf.program(

10
wscript
View File

@ -120,9 +120,12 @@ def list_boards(ctx):
def build(bld):
#generate mavlink headers
bld(features=['mavgen'],
source=['modules/mavlink/message_definitions/v1.0/ardupilotmega.xml'],
target=['libraries/GCS_MAVLink/include/mavlink/v1.0/'])
bld(
features='mavgen',
source='modules/mavlink/message_definitions/v1.0/ardupilotmega.xml',
target='libraries/GCS_MAVLink/include/mavlink/v1.0/',
name='mavlink',
)
# NOTE: Static library with vehicle set to UNKNOWN, shared by all
# the tools and examples. This is the first step until the
@ -133,6 +136,7 @@ def build(bld):
name='ap',
vehicle='UNKNOWN',
libraries=ardupilotwaf.get_all_libraries(bld),
use='mavlink',
)
# TODO: Currently each vehicle also generate its own copy of the
# libraries. Fix this, or at least reduce the amount of