summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--autowaf.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/autowaf.py b/autowaf.py
index 0123b1d..3c85399 100644
--- a/autowaf.py
+++ b/autowaf.py
@@ -259,19 +259,13 @@ def configure(conf):
'-Wwrite-strings',
'-fstrict-overflow'])
- if not conf.check_cc(fragment = '''
-#ifndef __clang__
-#error
-#endif
-int main() { return 0; }''',
- features = 'c',
- mandatory = False,
- execute = False,
- define_name = 'CLANG',
- msg = 'Checking for clang'):
- append_cxx_flags(['-Wlogical-op',
- '-Wsuggest-attribute=noreturn',
- '-Wunsafe-loop-optimizations'])
+ # Add less universal flags after checking they work
+ extra_flags = ['-Wlogical-op',
+ '-Wsuggest-attribute=noreturn',
+ '-Wunsafe-loop-optimizations']
+ if conf.check(cflags=['-Werror'] + extra_flags, mandatory=False,
+ msg="Checking for extra warning flags"):
+ append_cxx_flags(extra_flags)
if not conf.env['MSVC_COMPILER']:
append_cxx_flags(['-fshow-column'])