From 3ed837e27fcfa06fb83f60858aafa174e7904c15 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 14 Oct 2019 11:06:31 +0200 Subject: Add error configuration option --- extras/autowaf.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'extras') diff --git a/extras/autowaf.py b/extras/autowaf.py index abcdc49..e81f5d7 100644 --- a/extras/autowaf.py +++ b/extras/autowaf.py @@ -78,6 +78,8 @@ def set_options(opt, debug_by_default=False): help="use extremely strict compiler flags (likely noisy)") opts.add_option('--docs', action='store_true', default=False, dest='docs', help="build documentation (requires doxygen)") + opts.add_option('-w', '--werror', action='store_true', dest='werror', + help="Treat warnings as errors") # Test options if hasattr(Context.g_module, 'test'): @@ -345,6 +347,12 @@ def configure(conf): if not conf.env['MSVC_COMPILER']: append_cxx_flags(['-fshow-column']) + if Options.options.werror: + if conf.env.MSVC_COMPILER: + append_cxx_flags('/WX') + else: + append_cxx_flags('-Werror') + conf.env.NO_COVERAGE = True conf.env.BUILD_TESTS = False try: -- cgit v1.2.1