diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2018-07-23 05:47:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-23 05:47:48 -0700 |
commit | 3c92ddf8f6ff47f61b41d9810f046d4a04550f09 (patch) | |
tree | b8bb992acc9f3511416140f36015c5f30d58ce4b /runtests.py | |
parent | 083aedba2f49e1b490d3e122f5927f0718cf202c (diff) | |
parent | f8a4bb568d08636433c295b3afc8429a3ec4604a (diff) | |
download | numpy-3c92ddf8f6ff47f61b41d9810f046d4a04550f09.tar.gz |
Merge pull request #11566 from danielballan/skip-gcc-warnings-on-clang
BLD: Do not use gcc warnings flags when 'gcc' is actually clang.
Diffstat (limited to 'runtests.py')
-rwxr-xr-x | runtests.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/runtests.py b/runtests.py index 9166b0afe..388b911a1 100755 --- a/runtests.py +++ b/runtests.py @@ -329,18 +329,20 @@ def build_project(args): env['PATH'] = os.pathsep.join(EXTRA_PATH + env.get('PATH', '').split(os.pathsep)) cvars = distutils.sysconfig.get_config_vars() if 'gcc' in cvars.get('CC', ''): - # add flags used as werrors - warnings_as_errors = ' '.join([ - # from tools/travis-test.sh - '-Werror=declaration-after-statement', - '-Werror=vla', - '-Werror=nonnull', - '-Werror=pointer-arith', - '-Wlogical-op', - # from sysconfig - '-Werror=unused-function', - ]) - env['CFLAGS'] = warnings_as_errors + ' ' + env.get('CFLAGS', '') + # Check that this isn't clang masquerading as gcc. + if sys.platform != 'darwin' or 'gnu-gcc' in cvars.get('CC', ''): + # add flags used as werrors + warnings_as_errors = ' '.join([ + # from tools/travis-test.sh + '-Werror=declaration-after-statement', + '-Werror=vla', + '-Werror=nonnull', + '-Werror=pointer-arith', + '-Wlogical-op', + # from sysconfig + '-Werror=unused-function', + ]) + env['CFLAGS'] = warnings_as_errors + ' ' + env.get('CFLAGS', '') if args.debug or args.gcov: # assume everyone uses gcc/gfortran env['OPT'] = '-O0 -ggdb' |