waf: add --enable-custom-controller build option

This commit is contained in:
esaldiran 2022-08-23 01:52:19 +01:00 committed by Peter Barker
parent 9218cf18ce
commit 661a525dc1
2 changed files with 21 additions and 0 deletions

View File

@ -114,6 +114,23 @@ class Board:
else:
cfg.msg("Enabled firmware ID checking", 'no', color='YELLOW')
# allow enable of custom controller for any board
# enabled on sitl by default
if (cfg.options.enable_custom_controller or self.get_name() == "sitl") and not cfg.options.no_gcs:
env.ENABLE_CUSTOM_CONTROLLER = True
env.DEFINES.update(
AP_CUSTOMCONTROL_ENABLED=1,
)
env.AP_LIBRARIES += [
'AC_CustomControl'
]
cfg.msg("Enabled custom controller", 'yes')
else:
env.DEFINES.update(
AP_CUSTOMCONTROL_ENABLED=0,
)
cfg.msg("Enabled custom controller", 'no', color='YELLOW')
d = env.get_merged_dict()
# Always prepend so that arguments passed in the command line get
# the priority.

View File

@ -238,6 +238,10 @@ submodules at specific revisions.
default=False,
help="Enables firmware ID checking on boot")
g.add_option('--enable-custom-controller', action='store_true',
default=False,
help="Enables custom controller")
g = opt.ap_groups['linux']
linux_options = ('--prefix', '--destdir', '--bindir', '--libdir')