mirror of https://github.com/ArduPilot/ardupilot
waf: use pre_build hook for ChibiOS
this fixes dynamic uavcan building
This commit is contained in:
parent
2476a51908
commit
2075a3da7d
|
@ -189,6 +189,10 @@ class Board:
|
|||
cfg.define('__STDC_FORMAT_MACROS', 1)
|
||||
|
||||
|
||||
def pre_build(self, bld):
|
||||
'''pre-build hook that gets called before dynamic sources'''
|
||||
pass
|
||||
|
||||
def build(self, bld):
|
||||
bld.ap_version_append_str('GIT_VERSION', bld.git_head_hash(short=True))
|
||||
import time
|
||||
|
@ -366,6 +370,14 @@ class chibios(Board):
|
|||
super(chibios, self).build(bld)
|
||||
bld.load('chibios')
|
||||
|
||||
def pre_build(self, bld):
|
||||
'''pre-build hook that gets called before dynamic sources'''
|
||||
from waflib.Context import load_tool
|
||||
module = load_tool('chibios', [], with_sys_path=True)
|
||||
fun = getattr(module, 'pre_build', None)
|
||||
if fun:
|
||||
fun(bld)
|
||||
|
||||
class skyviper_f412(chibios):
|
||||
name = 'skyviper-f412'
|
||||
def configure_env(self, cfg, env):
|
||||
|
|
|
@ -225,12 +225,13 @@ def configure(cfg):
|
|||
if env.HAL_WITH_UAVCAN:
|
||||
setup_can_build(cfg)
|
||||
|
||||
def build(bld):
|
||||
def pre_build(bld):
|
||||
'''pre-build hook to change dynamic sources'''
|
||||
load_env_vars(bld.env)
|
||||
|
||||
if bld.env.HAL_WITH_UAVCAN:
|
||||
bld.get_board().with_uavcan = True
|
||||
|
||||
|
||||
def build(bld):
|
||||
bld(
|
||||
# build hwdef.h and apj.prototype from hwdef.dat. This is needed after a waf clean
|
||||
source=bld.path.ant_glob('libraries/AP_HAL_ChibiOS/hwdef/%s/hwdef.dat' % bld.env.get_flat('BOARD')),
|
||||
|
|
Loading…
Reference in New Issue