diff options
author | mattip <matti.picus@gmail.com> | 2019-10-25 13:24:23 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-10-25 13:24:23 +0300 |
commit | 3cf96c801745a608714e5235e97f5880824234b0 (patch) | |
tree | 814ebde72405222b24c660c7ceed47b02a316786 /numpy/distutils/system_info.py | |
parent | 4c2b4d8fb2d1b37df621433fbb2f0e3dabb82058 (diff) | |
download | numpy-3cf96c801745a608714e5235e97f5880824234b0.tar.gz |
BUILD: cache c-compiler for system_info stage
Diffstat (limited to 'numpy/distutils/system_info.py')
-rw-r--r-- | numpy/distutils/system_info.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index 96d06f654..c2b3e118b 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -156,7 +156,7 @@ from numpy.distutils.misc_util import (is_sequence, is_string, get_shared_lib_extension) from numpy.distutils.command.config import config as cmd_config from numpy.distutils.compat import get_exception -from numpy.distutils import customized_ccompiler +from numpy.distutils import customized_ccompiler as _customized_ccompiler from numpy.distutils import _shell_utils import distutils.ccompiler import tempfile @@ -169,6 +169,15 @@ _bits = {'32bit': 32, '64bit': 64} platform_bits = _bits[platform.architecture()[0]] +global_compiler = None + +def customized_ccompiler(): + global global_compiler + if not global_compiler: + global_compiler = _customized_ccompiler() + return global_compiler + + def _c_string_literal(s): """ Convert a python string into a literal suitable for inclusion into C code |