@Mf0* 6 d Z ddlZddlZddlZddlZddlmZ ej e 5 ddl Z ddd n# 1 swxY w Y ddl
mZmZm
Z
mZmZ ddlmZmZ ddlmZ ddlmZ ddlmZ d Zd
Zddd
ddZd Zd ZddZdddddZ G d de Z dS )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 )DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError LinkError) CCompilergen_lib_options)log)get_platform)countc j t j t j dt j t j z } n%# t
$ r t
j d Y dS w xY wd}d }| 5 t D ]} t j | | \ }}}n# t
$ r Y n{w xY w|rt|t j
k rdt j
| rE t t | }n# t t" f$ r Y w xY w|dk r
||k r||}}d d d n# 1 swxY w Y ||fS )Nz'Software\Microsoft\VisualStudio\SxS\VC7)accesszVisual C++ is not registeredNNr )winreg OpenKeyExHKEY_LOCAL_MACHINEKEY_READKEY_WOW64_32KEYOSErrorr debugr
EnumValueREG_SZospathisdirintfloat
ValueError TypeError)keybest_versionbest_dirivvc_dirvtversions /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el9.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/_msvccompiler.py_find_vc2015r+ ' s %6?V%;;
0111zz LH = = = =A
& 0a 8 8
622
=R6=((RW]]6-B-B(!%((mmGG"I. Hb==W|%;%;-4f(L= = = = = = = = = = = = = = = !!si 8; AA&D&8BD&
B D&B 4D&C21D&2DD&DD&&D*-D*c t j d pt j d } | sdS t j t j | ddd ddd d
ddd
dg dd }n## t j t t f$ r Y dS w xY wt j |ddd }t j | rd|fS dS )aJ Returns "15, path" based on the result of invoking vswhere.exe
If no install is found, returns "None, None"
The version is returned to avoid unnecessarily changing the function
result. It may be ignored when the path is not None.
If vswhere.exe is not available, by definition, VS 2017 is not
installed.
zProgramFiles(x86)ProgramFilesr zMicrosoft Visual Studio Installerzvswhere.exez-latestz-prereleasez -requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z -propertyinstallationPathz -products*mbcsstrict)encodingerrorsVC AuxiliaryBuild )r environget
subprocesscheck_outputr joinstripCalledProcessErrorr UnicodeDecodeErrorr )rootr s r* _find_vc2017rB D s :>>-..P"*..2P2PD z&3[- C"
%''!
"
)74FG zz 7<<dK99D w}}T 4x:s AB B76B7x86x64armarm64)rC x86_amd64x86_arm x86_arm64c . t \ }}|st \ }}|st j d dS t j |d }t j | st j d| dS |d fS )Nz$No suitable Visual C++ version foundr z
vcvarsall.batz%s cannot be found)rB r+ r r r r r= isfile) plat_spec_r$ r# vcvarsalls r* _find_vcvarsallrO v s ..KAx 0!-h 8999zX77I
7>>)$$ & 222zd? c t j d r(d t j D S t | \ }}|st d t
j d| d| dt j dd
}nG# t j
$ r5}t j |j
t d|j d }~ww xY wd d
| D D }|S )NDISTUTILS_USE_SDKc > i | ]\ }}| |S lower).0r" values r*