3
\KT ã @ sÎ d Z ddlZddlZddlZddlZddlZddlmZmZm Z m
Z
mZ ddlm
Z
mZ ddlmZ ddlmZ ddlmZ dd „ Zd
d„ Zdd
„ Zdd„ Zddd„ZdddœZedgƒZG dd„ de
ƒZdS )a distutils._msvccompiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.
The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
é N)ÚDistutilsExecErrorÚDistutilsPlatformErrorÚCompileErrorÚLibErrorÚ LinkError)Ú CCompilerÚgen_lib_options)Úlog)Úget_platform)Úcountc $ C sü yt jt jdt jt jB d�} W n tk
r< tjdƒ dS X d}d }| �¤ xœtƒ D ]’}yt j | |ƒ\}}}W n tk
r„ P Y nX |rT|t j
krTtjj
|ƒrTytt|ƒƒ}W n ttfk
rÊ wTY nX |dkrT||krT|| }}qTW W d Q R X ||fS )Nz'Software\Microsoft\VisualStudio\SxS\VC7)ÚaccesszVisual C++ is not registeredr é )NN)ÚwinregZ OpenKeyExÚHKEY_LOCAL_MACHINEZKEY_READZKEY_WOW64_32KEYÚOSErrorr Údebugr Z EnumValueZREG_SZÚosÚpathÚisdirÚintÚfloatÚ
ValueErrorÚ TypeError)ÚkeyÚbest_versionÚbest_dirÚiÚvÚvc_dirZvtÚversion© r ú//usr/lib64/python3.6/distutils/_msvccompiler.pyÚ_find_vc2015 s0
r" c
sü dd l ‰ dd l} d}d }g ‰‡ ‡fdd„}| j|d�}|jƒ |jƒ x†ˆD ]~\}}}}d|krLtjj|dddƒ} tjj| ƒs€qLytd d
„ |j dƒD ƒƒ}
W n t
tfk
r¶ wLY nX |
|krL|
| }}qLW y|d }W n tk
rò d }Y nX ||fS )
Nr c s ˆj ˆ jƒ ƒ d S )N)ÚextendÚfindallr )Ú_distutils_findvsÚall_packagesr r! Ú_getallD s z_find_vc2017.