waf: use ardupilotwaf as a Waf tool

That will make it possible to replace calls of the form
`ardupilotwaf.<method>(bld, <keyword-args...>)` with
`bld.<method>(<keyword-args...>)` in the wscripts.

Advantages of that approach:
 - there is no need to import ardupilotwaf in every single wscript
 - it follows the same standard used by c and cxx tools (like bld.program,
   bld.stlib etc)
 - semantically, ap_program, ap_stlib, example etc are all build related
   methods, so it makes sense to bind them to the build context
 - from the wscripts' perspective, the code is cleaner, since ardupilotwaf,
   which is not specific to just build contexts, isn't *explictly* used
This commit is contained in:
Gustavo Jose de Sousa 2016-01-21 11:47:10 -02:00 committed by Lucas De Marchi
parent 12cfe222eb
commit a89a1a8a8a
1 changed files with 3 additions and 3 deletions

View File

@ -117,6 +117,7 @@ def list_boards(ctx):
print(*boards.get_boards_names())
def build(bld):
bld.load('ardupilotwaf')
bld.load('gtest')
#generate mavlink headers
@ -137,11 +138,10 @@ def build(bld):
# the tools and examples. This is the first step until the
# dependency on the vehicles is reduced. Later we may consider
# split into smaller pieces with well defined boundaries.
ardupilotwaf.ap_stlib(
bld,
bld.ap_stlib(
name='ap',
vehicle='UNKNOWN',
libraries=ardupilotwaf.get_all_libraries(bld),
libraries=bld.get_all_libraries(),
use='mavlink',
)
# TODO: Currently each vehicle also generate its own copy of the