mirror of https://github.com/ArduPilot/ardupilot
waf: added --enable-asserts option for ChibiOS
This commit is contained in:
parent
c63414442d
commit
c5f3beb297
|
@ -405,6 +405,13 @@ class chibios(Board):
|
|||
'-g',
|
||||
]
|
||||
|
||||
if cfg.env.ENABLE_ASSERTS:
|
||||
cfg.msg("Enabling ChibiOS asserts", "yes")
|
||||
env.CFLAGS += [ '-DHAL_CHIBIOS_ENABLE_ASSERTS' ]
|
||||
env.CXXFLAGS += [ '-DHAL_CHIBIOS_ENABLE_ASSERTS' ]
|
||||
else:
|
||||
cfg.msg("Enabling ChibiOS asserts", "no")
|
||||
|
||||
env.LIB += ['gcc', 'm']
|
||||
|
||||
env.GIT_SUBMODULES += [
|
||||
|
|
|
@ -215,6 +215,8 @@ def load_env_vars(env):
|
|||
else:
|
||||
env[k] = v
|
||||
print("env set %s=%s" % (k, v))
|
||||
if env.ENABLE_ASSERTS:
|
||||
env.CHIBIOS_BUILD_FLAGS += ' ENABLE_ASSERTS=yes'
|
||||
|
||||
def configure(cfg):
|
||||
cfg.find_program('make', var='MAKE')
|
||||
|
@ -294,6 +296,7 @@ def pre_build(bld):
|
|||
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(bld.env.HWDEF),
|
||||
|
|
6
wscript
6
wscript
|
@ -67,6 +67,11 @@ def options(opt):
|
|||
default=False,
|
||||
help='Configure as debug variant.')
|
||||
|
||||
g.add_option('--enable-asserts',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='enable OS level asserts.')
|
||||
|
||||
g.add_option('--bootloader',
|
||||
action='store_true',
|
||||
default=False,
|
||||
|
@ -176,6 +181,7 @@ def configure(cfg):
|
|||
|
||||
cfg.env.BOARD = cfg.options.board
|
||||
cfg.env.DEBUG = cfg.options.debug
|
||||
cfg.env.ENABLE_ASSERTS = cfg.options.enable_asserts
|
||||
cfg.env.BOOTLOADER = cfg.options.bootloader
|
||||
|
||||
# Allow to differentiate our build from the make build
|
||||
|
|
Loading…
Reference in New Issue