File: //lib/python3.8/site-packages/setuptools/__pycache__/msvc.cpython-38.pyc
U
Qab @ sX d Z ddlZddlmZ ddlmZmZ ddlmZm Z m
Z
mZ ddlZddl
Z
ddlZddlZddlmZ ddlmZ dd lmZ e
d
krddlmZ ddlmZ nG d
d dZe ZeejjfZzddlm Z W n ek
r Y nX dd Z!d$ddZ"dd Z#dd Z$d%ddZ%G dd dZ&G dd dZ'G d d! d!Z(G d"d# d#Z)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.X:
Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)
Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64)
This may also support compilers shipped with compatible Visual Studio versions.
N)open)listdirpathsep)joinisfileisdirdirname)
LegacyVersion)filterfalse )
get_unpatchedWindows)winreg)environc @ s e Zd ZdZdZdZdZdS )r N)__name__
__module____qualname__
HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOT r r 3/usr/lib/python3.8/site-packages/setuptools/msvc.pyr * s r )Regc C s d}|d| f }zt |d}W nJ tk
rj z|d| f }t |d}W n tk
rd d}Y nX Y nX |rt|d}t|r|S tt| S )a
Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone
compiler build for Python
(VCForPython / Microsoft Visual C++ Compiler for Python 2.7).
Fall back to original behavior when the standalone compiler is not
available.
Redirect the path of "vcvarsall.bat".
Parameters
----------
version: float
Required Microsoft Visual C++ version.
Return
------
str
vcvarsall.bat path
z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1f
installdirzWow6432Node\Nz
vcvarsall.bat)r Z get_valueKeyErrorr r r msvc9_find_vcvarsall)versionZvc_basekey
productdir vcvarsallr r r r A s
r x86c
O s zt t}|| |f||W S tjjk
r4 Y n tk
rF Y nX zt|| W S tjjk
r } zt|| | W 5 d}~X Y nX dS )ao
Patched "distutils.msvc9compiler.query_vcvarsall" for support extra
Microsoft Visual C++ 9.0 and 10.0 compilers.
Set environment without use of "vcvarsall.bat".
Parameters
----------
ver: float
Required Microsoft Visual C++ version.
arch: str
Target architecture.
Return
------
dict
environment
N) r msvc9_query_vcvarsall distutilserrorsDistutilsPlatformError
ValueErrorEnvironmentInfo
return_env_augment_exception)verarchargskwargsZorigexcr r r r# k s r# c
C sr zt t| W S tjjk
r& Y nX zt| dd W S tjjk
rl } zt|d W 5 d}~X Y nX dS )a*
Patched "distutils._msvccompiler._get_vc_env" for support extra
Microsoft Visual C++ 14.X compilers.
Set environment without use of "vcvarsall.bat".
Parameters
----------
plat_spec: str
Target architecture.
Return
------
dict
environment
,@)
vc_min_verN)r msvc14_get_vc_envr$ r% r&