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', 'AP_ServoRelayEvents',
'PID', 'PID',
], ],
use='mavlink',
) )
ardupilotwaf.program( ardupilotwaf.program(

View File

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

View File

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

View File

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

10
wscript
View File

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