mirror of https://github.com/ArduPilot/ardupilot
waf: Enable Werror by default and add option to disable it
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
This commit is contained in:
parent
17ba7180d1
commit
ae20754ab9
13
wscript
13
wscript
|
@ -143,8 +143,13 @@ def options(opt):
|
|||
|
||||
g.add_option('--Werror',
|
||||
action='store_true',
|
||||
default=False,
|
||||
default=True,
|
||||
help='build with -Werror.')
|
||||
|
||||
g.add_option('--disable-Werror',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='Disable -Werror.')
|
||||
|
||||
g.add_option('--toolchain',
|
||||
action='store',
|
||||
|
@ -584,6 +589,12 @@ def configure(cfg):
|
|||
# Always use system extensions
|
||||
cfg.define('_GNU_SOURCE', 1)
|
||||
|
||||
if cfg.options.Werror:
|
||||
if cfg.options.disable_Werror:
|
||||
raise ValueError("Cannot enable and disable Werror at the same time")
|
||||
else:
|
||||
cfg.options.Werror = not cfg.options.disable_Werror
|
||||
|
||||
cfg.write_config_header(os.path.join(cfg.variant, 'ap_config.h'), guard='_AP_CONFIG_H_')
|
||||
|
||||
# add in generated flags
|
||||
|
|
Loading…
Reference in New Issue