Skip to content

Commit

Permalink
Merge pull request #715 from JGoutin/patch-1
Browse files Browse the repository at this point in the history
#694 Patch distutils._msvccompiler.library_dir_option
  • Loading branch information
jaraco committed Aug 4, 2016
2 parents aad4a69 + 7b1fa76 commit 07671cd
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions setuptools/msvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ def patch_for_specialized_compiler():
except Exception:
pass

try:
# Patch distutils._msvccompiler.MSVCCompiler.library_dir_option
unpatched['msvc14_library_dir_option'] = msvc14compiler.MSVCCompiler.library_dir_option
msvc14compiler.MSVCCompiler.library_dir_option = msvc14_library_dir_option
except Exception:
pass


def msvc9_find_vcvarsall(version):
"""
Expand Down Expand Up @@ -212,6 +219,26 @@ def msvc14_get_vc_env(plat_spec):
raise


def msvc14_library_dir_option(self, dir):
"""
Patched "distutils._msvccompiler.MSVCCompiler.library_dir_option"
to fix unquoted path in "\LIBPATH" argument when a space is on path.
Parameters
----------
dir: str
Path to convert in "\LIBPATH" argument.
Return
------
"\LIBPATH" argument: str
"""
if ' ' in dir and '"' not in dir:
# Quote if space and not already quoted
dir = '"%s"' % dir
return unpatched['msvc14_library_dir_option'](self, dir)


def _augment_exception(exc, version, arch=''):
"""
Add details to the exception message to help guide the user
Expand Down

0 comments on commit 07671cd

Please sign in to comment.