waf: enable -Werror for whitelisted compilers on ChibiOS builds

This commit is contained in:
Andrew Tridgell 2020-09-14 12:05:48 +10:00
parent 4bfdd973a4
commit 3da00b482e
1 changed files with 13 additions and 0 deletions

View File

@ -624,6 +624,19 @@ class chibios(Board):
cfg.srcnode.find_dir('libraries/AP_GyroFFT/CMSIS_5/include').abspath()
]
# whitelist of compilers which we should build with -Werror
gcc_whitelist = [
('4','9','3'),
('6','3','1'),
]
if cfg.options.Werror or cfg.env.CC_VERSION in gcc_whitelist:
cfg.msg("Enabling -Werror", "yes")
if '-Werror' not in env.CXXFLAGS:
env.CXXFLAGS += [ '-Werror' ]
else:
cfg.msg("Enabling -Werror", "no")
try:
import intelhex
env.HAVE_INTEL_HEX = True