]Zpl d Z ddlZddlZddlZddlmZmZmZmZm Z ddl mZmZ ddl mZ ddlmZ ddlmZ d Zd Zd ddd dZd Zd ZddZd ddddZ G d 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)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 >/opt/alt/python311/lib64/python3.11/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_vc2017rA 8 s :>>-..P"*..2P2PD z &GLL8+}UUL+ ( 8- - - .3UWW )74FG zz 7<<dK99D w}}T 4x:s AB B76B7x86x64armarm64)rB 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)rA r* r r r r r<