diff options
author | RedRuM <44142765+zoj613@users.noreply.github.com> | 2019-11-03 19:53:08 +0200 |
---|---|---|
committer | RedRuM <44142765+zoj613@users.noreply.github.com> | 2019-11-03 19:53:08 +0200 |
commit | 87840dc2f09ebeed12c3b9fef68b94dc04f4d16f (patch) | |
tree | f746eeaa31cb757de6ee7cb5253c6ae4c0b4218c /numpy/distutils/command/build_ext.py | |
parent | 0117379f1c751296c914ffe9547a84380219b588 (diff) | |
parent | 2be03c8d25b14b654064e953feac7d210e6bd44d (diff) | |
download | numpy-87840dc2f09ebeed12c3b9fef68b94dc04f4d16f.tar.gz |
merge latest changes on master branch
Diffstat (limited to 'numpy/distutils/command/build_ext.py')
-rw-r--r-- | numpy/distutils/command/build_ext.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py index ef54fb25e..cd9b1c6f1 100644 --- a/numpy/distutils/command/build_ext.py +++ b/numpy/distutils/command/build_ext.py @@ -33,6 +33,8 @@ class build_ext (old_build_ext): "specify the Fortran compiler type"), ('parallel=', 'j', "number of parallel jobs"), + ('warn-error', None, + "turn all warnings into errors (-Werror)"), ] help_options = old_build_ext.help_options + [ @@ -40,10 +42,13 @@ class build_ext (old_build_ext): show_fortran_compilers), ] + boolean_options = old_build_ext.boolean_options + ['warn-error'] + def initialize_options(self): old_build_ext.initialize_options(self) self.fcompiler = None self.parallel = None + self.warn_error = None def finalize_options(self): if self.parallel: @@ -69,7 +74,10 @@ class build_ext (old_build_ext): self.include_dirs.extend(incl_dirs) old_build_ext.finalize_options(self) - self.set_undefined_options('build', ('parallel', 'parallel')) + self.set_undefined_options('build', + ('parallel', 'parallel'), + ('warn_error', 'warn_error'), + ) def run(self): if not self.extensions: @@ -116,6 +124,11 @@ class build_ext (old_build_ext): force=self.force) self.compiler.customize(self.distribution) self.compiler.customize_cmd(self) + + if self.warn_error: + self.compiler.compiler.append('-Werror') + self.compiler.compiler_so.append('-Werror') + self.compiler.show_customization() # Setup directory for storing generated extra DLL files on Windows |