diff options
-rw-r--r-- | numpy/distutils/command/config.py | 15 | ||||
-rw-r--r-- | numpy/distutils/mingw32ccompiler.py | 13 |
2 files changed, 16 insertions, 12 deletions
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 23985b916..a7952966e 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -12,8 +12,8 @@ from distutils import log from distutils.file_util import copy_file from distutils.msvccompiler import get_build_version as get_build_msvc_version from numpy.distutils.exec_command import exec_command -from numpy.distutils.misc_util import msvc_runtime_library -from numpy.distutils.mingw32compiler import msvc_manifest_xml +from numpy.distutils.mingw32compiler import msvc_manifest_xml, + check_embedded_match_linked LANG_EXT['f77'] = '.f' LANG_EXT['f90'] = '.f90' @@ -117,16 +117,7 @@ class config(old_config): msver = get_build_msvc_version() if msver is not None: if msver >= 8: - # check msvcr major version are the same for linking and - # embedding - msvcv = msvc_runtime_library() - if msvcv: - maj = msvcv[5:6] - if not maj == int(msver): - raise ValueError, - "Dyscrepancy between linked msvcr " \ - "(%f) and the one about to be embedded " \ - "(%f)" % (int(msver), maj) + check_embedded_msvcr_match_linked(msver) return self._wrap_method(old_config._link,lang, (body, headers, include_dirs, diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py index 3027fba9a..a62be27a4 100644 --- a/numpy/distutils/mingw32ccompiler.py +++ b/numpy/distutils/mingw32ccompiler.py @@ -294,3 +294,16 @@ def manifest_rc(name, type='dll'): return """\ #include "winuser.h" %d RT_MANIFEST %s""" % (rctype, name) + +def check_embedded_msvcr_match_linked(msver): + """msver is the ms runtime version used for the MANIFEST.""" + # check msvcr major version are the same for linking and + # embedding + msvcv = msvc_runtime_library() + if msvcv: + maj = msvcv[5:6] + if not maj == int(msver): + raise ValueError, + "Dyscrepancy between linked msvcr " \ + "(%f) and the one about to be embedded " \ + "(%f)" % (int(msver), maj) |