3
Q'íc ã @ s d Z ddlZddlZddlZddlZddlZddlmZ ddl m
Z
ddlmZ ej
dkrpddl mZ ejZnG d d
d
Ze ZeejjfZyddlmZ W n ek
r´ Y nX dd
Zd ddZdd Zdd Zd!ddZG dd dZG dd dZG dd dZG dd dZ dS )"a@
Improved support for Microsoft Visual C++ compilers.
Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
Microsoft Windows SDK 6.1 (x86, x64, ia64)
Microsoft Windows SDK 7.0 (x86, x64, ia64)
Microsoft Visual C++ 10.0:
Microsoft Windows SDK 7.1 (x86, x64, ia64)
Microsoft Visual C++ 14.0:
Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
Microsoft Visual Studio 2017 (x86, x64, arm, arm64)
Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)
é N)Ú
LegacyVersion)Úfilterfalseé )Ú
get_unpatchedÚWindows)Úwinregc @ s e Zd ZdZdZdZdZdS )r N)Ú__name__Ú
__module__Ú__qualname__Ú
HKEY_USERSÚHKEY_CURRENT_USERÚHKEY_LOCAL_MACHINEÚHKEY_CLASSES_ROOT© r r ú5/tmp/pip-build-l_bcah40/setuptools/setuptools/msvc.pyr ( s r )ÚRegc C s d}|d| f }yt j|d}W nJ tk
rj y|d| f }t j|d}W n tk
rd d}Y nX Y nX |rtjjjj|d}tjj|r|S tt| S )a+
Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone
compiler build for Python (VCForPython). Fall back to original behavior
when the standalone compiler is not available.
Redirect the path of "vcvarsall.bat".
Known supported compilers
-------------------------
Microsoft Visual C++ 9.0:
Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
Parameters
----------
version: float
Required Microsoft Visual C++ version.
Return
------
vcvarsall.bat path: str
z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1fÚ Ú
installdirzWow6432Node\Nz
vcvarsall.bat) r Ú get_valueÚKeyErrorÚosÚpathÚjoinÚisfiler Úmsvc9_find_vcvarsall)ÚversionZVC_BASEÚkeyÚ
productdirÚ vcvarsallr r r r ? s r Úx86c O s yt t}|| |f||S tjjk
r2 Y n tk
rD Y nX yt|| j S tjjk
r } zt|| | W Y dd}~X nX dS )a
Patched "distutils.msvc9compiler.query_vcvarsall" for support extra
compilers.
Set environment without use of "vcvarsall.bat".
Known supported compilers
-------------------------
Microsoft Visual C++ 9.0:
Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
Microsoft Windows SDK 6.1 (x86, x64, ia64)
Microsoft Windows SDK 7.0 (x86, x64, ia64)
Microsoft Visual C++ 10.0:
Microsoft Windows SDK 7.1 (x86, x64, ia64)
Parameters
----------
ver: float
Required Microsoft Visual C++ version.
arch: str
Target architecture.
Return
------
environment: dict
N) r Úmsvc9_query_vcvarsallÚ distutilsÚerrorsÚDistutilsPlatformErrorÚ
ValueErrorÚEnvironmentInfoÚ
return_envÚ_augment_exception)ÚverÚarchÚargsÚkwargsÚorigÚexcr r r r j s r c C sn yt t| S tjjk
r$ Y nX yt| ddj S tjjk
rh } zt|d W Y dd}~X nX dS )a'
Patched "distutils._msvccompiler._get_vc_env" for support extra
compilers.
Set environment without use of "vcvarsall.bat".
Known supported compilers
-------------------------
Microsoft Visual C++ 14.0:
Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
Microsoft Visual Studio 2017 (x86, x64, arm, arm64)
Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)
Parameters
----------
plat_spec: str
Target architecture.
Return
------
environment: dict
g ,@)Ú
vc_min_verN)r Úmsvc14_get_vc_envr! r"