mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
waf: explicitly distinct routines in build
That enhances readability and defines a clear separation of responsibilities of build routines.
This commit is contained in:
parent
1d92a54429
commit
f13e71a80c
26
wscript
26
wscript
@ -119,15 +119,18 @@ def collect_dirs_to_recurse(bld, globs, **kw):
|
|||||||
def list_boards(ctx):
|
def list_boards(ctx):
|
||||||
print(*boards.get_boards_names())
|
print(*boards.get_boards_names())
|
||||||
|
|
||||||
def build(bld):
|
def _build_cmd_tweaks(bld):
|
||||||
bld.load('ardupilotwaf')
|
|
||||||
bld.load('gtest')
|
|
||||||
|
|
||||||
if bld.cmd == 'check-all':
|
if bld.cmd == 'check-all':
|
||||||
bld.options.all_tests = True
|
bld.options.all_tests = True
|
||||||
bld.cmd = 'check'
|
bld.cmd = 'check'
|
||||||
|
|
||||||
#generate mavlink headers
|
if bld.cmd == 'check':
|
||||||
|
bld.options.clear_failed_tests = True
|
||||||
|
if not bld.env.HAS_GTEST:
|
||||||
|
bld.fatal('check: gtest library is required')
|
||||||
|
bld.add_post_fun(ardupilotwaf.test_summary)
|
||||||
|
|
||||||
|
def _create_common_taskgens(bld):
|
||||||
bld(
|
bld(
|
||||||
features='mavgen',
|
features='mavgen',
|
||||||
source='modules/mavlink/message_definitions/v1.0/ardupilotmega.xml',
|
source='modules/mavlink/message_definitions/v1.0/ardupilotmega.xml',
|
||||||
@ -152,6 +155,7 @@ def build(bld):
|
|||||||
use='mavlink',
|
use='mavlink',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def _build_recursion(bld):
|
||||||
common_dirs_patterns = [
|
common_dirs_patterns = [
|
||||||
# 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
|
||||||
@ -195,11 +199,13 @@ def build(bld):
|
|||||||
for d in dirs_to_recurse:
|
for d in dirs_to_recurse:
|
||||||
bld.recurse(d)
|
bld.recurse(d)
|
||||||
|
|
||||||
if bld.cmd == 'check':
|
def build(bld):
|
||||||
bld.options.clear_failed_tests = True
|
bld.load('ardupilotwaf')
|
||||||
if not bld.env.HAS_GTEST:
|
bld.load('gtest')
|
||||||
bld.fatal('check: gtest library is required')
|
|
||||||
bld.add_post_fun(ardupilotwaf.test_summary)
|
_build_cmd_tweaks(bld)
|
||||||
|
_create_common_taskgens(bld)
|
||||||
|
_build_recursion(bld)
|
||||||
|
|
||||||
ardupilotwaf.build_command('check',
|
ardupilotwaf.build_command('check',
|
||||||
program_group_list='all',
|
program_group_list='all',
|
||||||
|
Loading…
Reference in New Issue
Block a user