waf: add support for --enable-stats

This commit is contained in:
Andy Piper 2021-04-15 18:42:13 +01:00 committed by Andrew Tridgell
parent 558631918c
commit 5eca0c61c4
2 changed files with 9 additions and 0 deletions

View File

@ -691,6 +691,13 @@ class chibios(Board):
else:
cfg.msg("Enabling malloc guard", "no")
if cfg.env.ENABLE_STATS:
cfg.msg("Enabling ChibiOS thread statistics", "yes")
env.CFLAGS += [ '-DHAL_ENABLE_THREAD_STATISTICS' ]
env.CXXFLAGS += [ '-DHAL_ENABLE_THREAD_STATISTICS' ]
else:
cfg.msg("Enabling ChibiOS thread statistics", "no")
env.LIB += ['gcc', 'm']
env.GIT_SUBMODULES += [

View File

@ -294,6 +294,8 @@ def load_env_vars(env):
env.CHIBIOS_BUILD_FLAGS += ' ENABLE_ASSERTS=yes'
if env.ENABLE_MALLOC_GUARD:
env.CHIBIOS_BUILD_FLAGS += ' ENABLE_MALLOC_GUARD=yes'
if env.ENABLE_STATS:
env.CHIBIOS_BUILD_FLAGS += ' ENABLE_STATS=yes'
def setup_optimization(env):