summaryrefslogtreecommitdiffstats
path: root/extras/autowaf.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-10-14 11:06:31 +0200
committerDavid Robillard <d@drobilla.net>2019-10-14 11:06:31 +0200
commit3ed837e27fcfa06fb83f60858aafa174e7904c15 (patch)
tree6bdb4c6a4e2e6814e90fef86b0f02a4b18974a0e /extras/autowaf.py
parentfa87543e7d6bb243ff068c64069fc43342041073 (diff)
downloadautowaf-3ed837e27fcfa06fb83f60858aafa174e7904c15.tar.gz
autowaf-3ed837e27fcfa06fb83f60858aafa174e7904c15.tar.bz2
autowaf-3ed837e27fcfa06fb83f60858aafa174e7904c15.zip
Add error configuration option
Diffstat (limited to 'extras/autowaf.py')
-rw-r--r--extras/autowaf.py8
1 files changed, 8 insertions, 0 deletions
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: