From 2476a51908037243a0f665f7d0ef619b2f5b57a2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 1 Mar 2018 18:26:28 +1100 Subject: [PATCH] waf: allow for pre_build hook in board modules --- wscript | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index 8c0dac799b..5ebb370fcd 100644 --- a/wscript +++ b/wscript @@ -272,7 +272,7 @@ def _build_dynamic_sources(bld): ], ) - if bld.get_board().with_uavcan: + if bld.get_board().with_uavcan or bld.env.HAL_WITH_UAVCAN==True: bld( features='uavcangen', source=bld.srcnode.ant_glob('modules/uavcan/dsdl/uavcan/**/*.uavcan'), @@ -370,6 +370,12 @@ def _build_post_funs(bld): if bld.env.SUBMODULE_UPDATE: bld.git_submodule_post_fun() +def load_pre_build(bld): + '''allow for a pre_build() function in build modules''' + brd = bld.get_board() + if getattr(brd, 'pre_build', None): + brd.pre_build(bld) + def build(bld): config_hash = Utils.h_file(bld.bldnode.make_node('ap_config.h').abspath()) bld.env.CCDEPS = config_hash @@ -383,7 +389,9 @@ def build(bld): use=['mavlink'], cxxflags=['-include', 'ap_config.h'], ) - + + load_pre_build(bld) + if bld.get_board().with_uavcan: bld.env.AP_LIBRARIES_OBJECTS_KW['use'] += ['uavcan']