diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/distutils/command/autodist.py | 7 | ||||
-rw-r--r-- | numpy/distutils/command/config.py | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/numpy/distutils/command/autodist.py b/numpy/distutils/command/autodist.py index 5602f3857..1c0dc7db1 100644 --- a/numpy/distutils/command/autodist.py +++ b/numpy/distutils/command/autodist.py @@ -58,3 +58,10 @@ main() if not ret or len(output) > 0: return False return True + +def check_compile_without_warning(cmd, body): + cmd._check_compiler() + ret, output = cmd.try_output_compile(body, None, None) + if not ret or len(output) > 0: + return False + return True diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 0334f342c..512471d7f 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -17,7 +17,9 @@ import distutils from numpy.distutils.exec_command import exec_command from numpy.distutils.mingw32ccompiler import generate_manifest from numpy.distutils.command.autodist import (check_gcc_function_attribute, - check_inline, check_compiler_gcc4) + check_inline, + check_compiler_gcc4, + check_compile_without_warning) from numpy.distutils.compat import get_exception LANG_EXT['f77'] = '.f' @@ -426,6 +428,10 @@ int main () def check_gcc_function_attribute(self, attribute, name): return check_gcc_function_attribute(self, attribute, name) + def check_compile_without_warning(self, code): + """Returns True if the given code may be compiled without warning.""" + return check_compile_without_warning(self, code) + def get_output(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang="c", use_tee=None): |