diff --git a/wscript b/wscript index a8aa3e1f36..8b0d315001 100644 --- a/wscript +++ b/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