From 17e5d99509caafa2a0af015fe31e8bf3e557238b Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Wed, 13 Jan 2016 18:35:37 -0200 Subject: [PATCH] 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. --- APMrover2/wscript | 1 + AntennaTracker/wscript | 1 + ArduCopter/wscript | 1 + ArduPlane/wscript | 1 + wscript | 10 +++++++--- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/APMrover2/wscript b/APMrover2/wscript index 74bcc5ba51..0ad5e7eec3 100644 --- a/APMrover2/wscript +++ b/APMrover2/wscript @@ -24,6 +24,7 @@ def build(bld): 'AP_ServoRelayEvents', 'PID', ], + use='mavlink', ) ardupilotwaf.program( diff --git a/AntennaTracker/wscript b/AntennaTracker/wscript index 330ea5e52b..cee72049f2 100644 --- a/AntennaTracker/wscript +++ b/AntennaTracker/wscript @@ -12,6 +12,7 @@ def build(bld): libraries=ardupilotwaf.COMMON_VEHICLE_DEPENDENT_LIBRARIES + [ 'PID', ], + use='mavlink', ) ardupilotwaf.program( diff --git a/ArduCopter/wscript b/ArduCopter/wscript index 037716ab1e..b97621dd94 100644 --- a/ArduCopter/wscript +++ b/ArduCopter/wscript @@ -33,6 +33,7 @@ def build(bld): 'AP_Relay', 'AP_ServoRelayEvents', ], + use='mavlink', ) ardupilotwaf.program( diff --git a/ArduPlane/wscript b/ArduPlane/wscript index 1aacbdfe55..42ae4f4285 100644 --- a/ArduPlane/wscript +++ b/ArduPlane/wscript @@ -34,6 +34,7 @@ def build(bld): 'AP_Motors', 'AC_PID' ], + use='mavlink', ) ardupilotwaf.program( diff --git a/wscript b/wscript index c1e02ce668..cf6ab01cb9 100644 --- a/wscript +++ b/wscript @@ -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