waf: Enable werror on sitl for gcc

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
This commit is contained in:
Ryan Friedman 2023-05-29 18:52:52 -06:00 committed by Andrew Tridgell
parent 33c1e23e55
commit 819f93b778
1 changed files with 12 additions and 0 deletions

View File

@ -775,6 +775,18 @@ class sitl(Board):
'-m32',
]
# whitelist of compilers which we should build with -Werror
gcc_whitelist = frozenset([
('11','3','0'),
])
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")
def get_name(self):
return self.__class__.__name__