From 819f93b77897e066d12a7e45a2460605e6d9b52d Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Mon, 29 May 2023 18:52:52 -0600 Subject: [PATCH] waf: Enable werror on sitl for gcc Signed-off-by: Ryan Friedman --- Tools/ardupilotwaf/boards.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 3e6985237d..bb03220f70 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -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__