mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
waf: tidy interpretation of -Werror
This commit is contained in:
parent
09a59bc934
commit
46b262cb32
@ -774,21 +774,30 @@ class sitl(Board):
|
|||||||
# whitelist of compilers which we should build with -Werror
|
# whitelist of compilers which we should build with -Werror
|
||||||
gcc_whitelist = frozenset([
|
gcc_whitelist = frozenset([
|
||||||
('11','3','0'),
|
('11','3','0'),
|
||||||
|
('12','1','0'),
|
||||||
])
|
])
|
||||||
|
|
||||||
werr_enabled_default = bool('g++' == cfg.env.COMPILER_CXX and cfg.env.CC_VERSION in gcc_whitelist)
|
# initialise werr_enabled from defaults:
|
||||||
|
werr_enabled = bool('g++' in cfg.env.COMPILER_CXX and cfg.env.CC_VERSION in gcc_whitelist)
|
||||||
|
|
||||||
if werr_enabled_default or cfg.options.Werror:
|
# now process overrides to that default:
|
||||||
if not cfg.options.disable_Werror:
|
if (cfg.options.Werror is not None and
|
||||||
cfg.msg("Enabling -Werror", "yes")
|
cfg.options.Werror == cfg.options.disable_Werror):
|
||||||
if '-Werror' not in env.CXXFLAGS:
|
cfg.fatal("Asked to both enable and disable Werror")
|
||||||
env.CXXFLAGS += [ '-Werror' ]
|
|
||||||
else:
|
if cfg.options.Werror is not None:
|
||||||
cfg.msg("Enabling -Werror", "no")
|
werr_enabled = cfg.options.Werror
|
||||||
if '-Werror' in env.CXXFLAGS:
|
elif cfg.options.disable_Werror is not None:
|
||||||
env.CXXFLAGS.remove('-Werror')
|
werr_enabled = not cfg.options.disable_Werror
|
||||||
else:
|
|
||||||
|
if werr_enabled:
|
||||||
cfg.msg("Enabling -Werror", "yes")
|
cfg.msg("Enabling -Werror", "yes")
|
||||||
|
if '-Werror' not in env.CXXFLAGS:
|
||||||
|
env.CXXFLAGS += [ '-Werror' ]
|
||||||
|
else:
|
||||||
|
cfg.msg("Enabling -Werror", "no")
|
||||||
|
if '-Werror' in env.CXXFLAGS:
|
||||||
|
env.CXXFLAGS.remove('-Werror')
|
||||||
|
|
||||||
def get_name(self):
|
def get_name(self):
|
||||||
return self.__class__.__name__
|
return self.__class__.__name__
|
||||||
|
4
wscript
4
wscript
@ -143,12 +143,12 @@ def options(opt):
|
|||||||
|
|
||||||
g.add_option('--Werror',
|
g.add_option('--Werror',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=None,
|
||||||
help='build with -Werror.')
|
help='build with -Werror.')
|
||||||
|
|
||||||
g.add_option('--disable-Werror',
|
g.add_option('--disable-Werror',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
default=True,
|
default=None,
|
||||||
help='Disable -Werror.')
|
help='Disable -Werror.')
|
||||||
|
|
||||||
g.add_option('--toolchain',
|
g.add_option('--toolchain',
|
||||||
|
Loading…
Reference in New Issue
Block a user