HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1991111/cwd/usr/lib/python3/dist-packages/gyp/__pycache__/
Upload File :
Current File : //proc/1991111/cwd/usr/lib/python3/dist-packages/gyp/__pycache__/MSVSVersion.cpython-311.pyc
�

�"Kb|R���dZddlZddlZddlZddlZddlZddlZddlZd�Zd�Z	Gd�de
��Zd�Zdd�Z
d	�Zd
�Zdd�Zd
�Zd�Zdd�ZdS)z3Handle version information related to Visual Stuio.�Nc�b�tj�tjj|���S�N��os�path�normpath�join)�argss �1/usr/lib/python3/dist-packages/gyp/MSVSVersion.py�JoinPathrs!��	��	�	�"�'�,��-�	.�	.�.�c�Z�td�|�d��D����S)Nc3�4K�|]}t|��V��dSr)�int)�.0�xs  r�	<genexpr>z#version_to_tuple.<locals>.<genexpr>s(����6�6�!�s�1�v�v�6�6�6�6�6�6r
�.)�tuple�split)�version_strs r�version_to_tuplers-��	�6�6�{�0�0��5�5�6�6�6�	6�	6�6r
c�d�eZdZdZ	dd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�ZdS)�VisualStudioVersionz1Information regarding a version of Visual Studio.Nc���||_||_||_||_||_||_||_||_|	|_|
pg}
|
�	d�d���|
|_
dS)Nc�H�t|�dd����S)N�v�)�float�replace)rs r�<lambda>z.VisualStudioVersion.__init__.<locals>.<lambda>(s��u�Q�Y�Y�s�B�-?�-?�'@�'@�r
T)�key�reverse)�
short_name�description�solution_version�project_version�flat_sln�uses_vcxprojr�	sdk_based�default_toolset�sort�compatible_sdks)�selfr$r%r&r'r(r)rr*r+r-s           r�__init__zVisualStudioVersion.__init__s}��!�D�O�"�D��,�D��*�D���D�M�$�D���D�I��D�N�*�D��%�+��O����@�@�$��O�O�O�*�D���r
c��|jSr)r$�r.s r�	ShortNamezVisualStudioVersion.ShortName+s
���?�r
c��|jS)z(Get the full description of the version.)r%r1s r�DescriptionzVisualStudioVersion.Description.s����r
c��|jS)z(Get the version number of the sln files.)r&r1s r�SolutionVersionz#VisualStudioVersion.SolutionVersion2s��� � r
c��|jS)z6Get the version number of the vcproj or vcxproj files.)r'r1s r�ProjectVersionz"VisualStudioVersion.ProjectVersion6s����r
c��|jSr)r(r1s r�FlatSolutionz VisualStudioVersion.FlatSolution:s
���=�r
c��|jS)z1Returns true if this version uses a vcxproj file.�r)r1s r�UsesVcxprojzVisualStudioVersion.UsesVcxproj=s����r
c��|jrdpdS)z+Returns the file extension for the project.z.vcxprojz.vcprojr<r1s r�ProjectExtensionz$VisualStudioVersion.ProjectExtensionAs����+��8�y�8r
c��|jS)z/Returns the path to Visual Studio installation.)rr1s r�PathzVisualStudioVersion.PathEs
���9�r
c��tj�tj�|jd|����S)z+Returns the path to a given compiler tool. zVC/binr)r.�tools  r�ToolPathzVisualStudioVersion.ToolPathIs,��
�7���B�G�L�L���H�d�C�C�D�D�Dr
c��|jS)z\Returns the msbuild toolset version that will be used in the absence
    of a user override.)r+r1s r�DefaultToolsetz"VisualStudioVersion.DefaultToolsetMs
����r
c���|dvs
Jd���tj�dd��}t|dd��}|jr(|r&tj�|��r|d|zgStj�d��d	kp"tj�d
��d	k}|jdkr<t|jdd
dd��}|rdnd}|dkrdnd}|}||kr|d|zz
}||gSt|jdd��}	|dkr:|jdkr|jddkr|r|	dgSt|jddd��gS|dkrd}|jddkr|rd}|	|gSdS)zLReturns a command (with arguments) to be used to set up the
    environment.)�x86�x64ztarget_arch not supported�
WindowsSDKDirr�Binz
SetEnv.Cmd�/�PROCESSOR_ARCHITECTURE�AMD64�PROCESSOR_ARCHITEW6432�2017�VC�	Auxiliary�Buildz
vcvarsall.bat�amd64rHrI�_�2013����e�	amd64_x86�Common7�Toolszvsvars32.bat�	x86_amd64N)r�environ�getrr*r�existsr$)
r.�target_arch�sdk_dir�
setup_path�is_host_arch_x64�script_path�	host_arch�msvc_target_arch�arg�	vcvarsalls
          r�_SetupScriptInternalz(VisualStudioVersion._SetupScriptInternalSs����.�(�(�(�*E�(�(�(�
�j�n�n�_�b�1�1�G��'�5�,�7�7�J��~�-�'�-�b�g�n�n�Z�&@�&@�-��#��+�
,�,�	�j�n�n�-�.�.�'�9�:��j�n�n�-�.�.�'�9����&� � ��T�Y�!�;���J�J�k�.�8�'�'�5�i�$/�5�$8�$8���e���c�	�&�	&�	&��s�%�%�%���3�
�����D�/�:�:�I��e���	
��F�	"�	"�t��r�':�c�'A�'A�	�(B��;�'�'�
���I�w��G�G�H�H�	��	�	��c�
���	��	#�	#�(8�	#�����
��

�	r
c��|�|��}|d}tj�|��st	d|z���|S)Nrz3%s is missing - make sure VC++ tools are installed.)rirrr_�	Exception)r.r`�script_datards    r�SetupScriptzVisualStudioVersion.SetupScript�sW���+�+�K�8�8�K��a�.�K�
�7�>�>�+�&�&�#��K�!�"�
#�
#�#��r
)NN)�__name__�
__module__�__qualname__�__doc__r/r2r4r6r8r:r=r?rArDrFrirm�r
rrrs�������9�9�GK�+�+�+�+� ������!�!�!� � � �������9�9�9����E�E�E� � � �3�3�3�j����r
rc�x�tjdvrdStj�tj�dd��|d��d|g}|r|�d|g��tj	|tj
tj
���}|���d	}|jrdS|S)
a�Use reg.exe to read a particular key.

  While ideally we might use the win32 module, we would like gyp to be
  python neutral, so for instance cygwin python lacks this module.

  Arguments:
    sysdir: The system subdirectory to attempt to launch reg.exe from.
    key: The registry key to read from.
    value: The particular value to read.
  Return:
    stdout from reg.exe, or None for failure.
  )�win32�cygwinN�WINDIRrzreg.exe�queryz/v)�stdout�stderrr)
�sys�platformrrr	r]r^�extend�
subprocess�Popen�PIPE�communicate�
returncode)�sysdirr"�value�cmd�p�texts      r�_RegistryQueryBaser��s���	�\�,�,�,��4�	����b�j�n�n�X�r�2�2�F�I�	F�	F�	�#�	�#�
���J�J��e�}������s�:�?�:�?�K�K�K�!�
������	�$��\���4�	
�+r
c��d}	td||��}n?#t$r2}|jtjkrtd||��}n�Yd}~nd}~wwxYw|S)a�Use reg.exe to read a particular key through _RegistryQueryBase.

  First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If
  that fails, it falls back to System32.  Sysnative is available on Vista and
  up and available on Windows Server 2003 and XP through KB patch 942589. Note
  that Sysnative will always fail if using 64-bit python due to it being a
  virtual directory and System32 will work correctly in the first place.

  KB 942589 - http://support.microsoft.com/kb/942589/en-us.

  Arguments:
    key: The registry key.
    value: The particular registry value to read (optional).
  Return:
    stdout from reg.exe, or None for failure.
  N�	Sysnative�System32)r��OSError�errno�ENOENT)r"r�r�rXs    r�_RegistryQueryr��sy��"
�$���k�3��6�6�D�D��	�����w�%�,���
�
�C��
7�
7�d�d���d�d�d�d���������

�+s��
A�(A
�
Ac�>�	ddl}n#t$rddl}YnwxYw	|�dd��\}}|dksJ�|�|j|��5}|�||��dcddd��S#1swxYwYdS#t$rYdSwxYw)aUse the _winreg module to obtain the value of a registry key.

  Args:
    key: The registry key.
    value: The particular registry value to read.
  Return:
    contents of the registry key's value, or None on failure.  Throws
    ImportError if _winreg is unavailable.
  rN�\��HKLM)�_winreg�ImportError�winregr�OpenKey�HKEY_LOCAL_MACHINE�QueryValueEx�WindowsError)r"r�r��root�subkey�hkeys      r�_RegistryGetValueUsingWinRegr��s���������	�����M�M�M�M�M�������9�9�T�1�%�%�L�D�&��6�>�>�>�>�	����1�6�	:�	:�1�d�
�
 �
 ��u�
-�
-�a�
0�1�1�1�1�1�1�1�1�1�1�1�1����1�1�1�1�1�1��	�����4�4����sA����<B�B�4B�B�B�B�	B�
B�Bc���	t||��S#t$rYnwxYwt||��}|sdStjd|��}|sdS|�d��S)a�Use _winreg or reg.exe to obtain the value of a registry key.

  Using _winreg is preferable because it solves an issue on some corporate
  environments where access to reg.exe is locked down. However, we still need
  to fallback to reg.exe for the case where the _winreg module is not available
  (for example in cygwin python).

  Args:
    key: The registry key.
    value: The particular registry value to read.
  Return:
    contents of the registry key's value, or None on failure.
  NzREG_\w+\s+([^\r]+)\r\nr�)r�r�r��re�search�group)r"r�r��matchs    r�_RegistryGetValuer��s���	�'��U�3�3�3��	�	�	�	��D�	����
��U�	#�	#�$�	
���4�
�)�-�t�
4�
4�%�	���4�	���Q���s��
�Fc��|rtj�|��}tdddddd||ddd	g�
�
�
tdddd
dd||ddd	g�
�
�
tdddddd||ddd	g�
�
�
tdddddd||d��	�	tdddddd||d��	�	tdddddd||d��	�	tdddddd||d ��	�	td!ddddd||d ��	�	td"d#d$ddd||�%��td&d'd$ddd||�%��td(d)d*d+dd||�%��td,d)d*d+dd||�%��td-d.d+d/dd||�%��td0d.d+d/dd||�%��d1�}|t	|��S)2aSets up MSVS project generation.

  Setup is based off the GYP_MSVS_VERSION environment variable or whatever is
  autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is
  passed in that doesn't match a value in versions python will throw a error.
  �2022zVisual Studio 2022z12.00�17.0FT�v143zv8.1zv10.0)r&r'r(r)rr*r+r-�2019zVisual Studio 2019�16.0�v141rPzVisual Studio 2017�15.0�2015zVisual Studio 2015�14.0�v140)r&r'r(r)rr*r+rVzVisual Studio 2013z13.00�12.0�v120�2013e�2012zVisual Studio 2012z4.0�v110�2012e�2010zVisual Studio 2010z11.00)r&r'r(r)rr*�2010ezVisual C++ Express 2010�2008zVisual Studio 2008z10.00z9.00�2008e�2005zVisual Studio 2005z8.00�2005e)r�r�rPr�rVr�r�r�r�r�r�r�r�r�)rrrr�str)�namerr*�versionss    r�_CreateVersionr�s���
�"�
�7���D�!�!�D�!�&�"6�3:�28�+0�/3�'+�,5�28�39�7�2C�	E�	E�	E�"�&�"6�3:�28�+0�/3�'+�,5�28�39�7�2C�	E�	E�	E�"�&�"6�3:�28�+0�/3�'+�,5�28�39�7�2C�	E�	E�	E�"�&�"6�3:�28�+0�/3�'+�,5�28�:�:�:�"�&�"6�3:�28�+0�/3�'+�,5�28�:�:�:�#�7�#7�4;�39�,0�04�(,�-6�39�;�;�;�"�&�"6�3:�27�+0�/3�'+�,5�28�:�:�:�#�7�#7�4;�38�,0�04�(,�-6�39�;�;�;�"�&�"6�3:�27�+0�/3�'+�,5�7�7�7�#�7�#<�4;�38�,0�04�(,�-6�8�8�8�"�&�"6�3:�28�+0�/4�'+�,5�7�7�7�#�7�#7�4;�39�,0�05�(,�-6�8�8�8�"�&�"6�39�28�+0�/4�'+�,5�7�7�7�#�7�#7�4:�39�,0�05�(,�-6�8�8�8�i|�|�(�z
�#�d�)�)�	�r
c���tjdkrNtjd|gtj���}|���d���}|S)z.Convert to cygwin path if we are using cygwin.ru�cygpath)rxr)rzr{r}r~rr��strip)rr�s  r�_ConvertToCygpathr��sN���\�X�����)�T�*�:�?�C�C�C�A��=�=�?�?�1��#�#�%�%�D�	
�+r
c��ddddddddd	d
�	}g}tjd��}tjd��}|D�]�}d
|zd|zd|zd|zg}tt|����D�]4}t	||d��}	|	s�t|	��}	tj�|	d��}
tj�|	d��}|shtj�|
��rI|�	t||tj�|	dd��������tj|��rK|�	t||dztj�|	dd��������6gd�}tt|����D]�}t	|||��}	|	s�t|	��}	t|��dkrItj�|	��r)|�	t|||	������|dkrL|�	t||dztj�|	d��d�������|r1|r/||kr)|�	t|||�������|S)a�Collect the list of installed visual studio versions.

  Returns:
    A list of visual studio versions installed in descending order of
    usage preference.
    Base this on the registry and a quick check if devenv.exe exists.
    Possibilities are:
      2005(e) - Visual Studio 2005 (8)
      2008(e) - Visual Studio 2008 (9)
      2010(e) - Visual Studio 2010 (10)
      2012(e) - Visual Studio 2012 (11)
      2013(e) - Visual Studio 2013 (12)
      2015    - Visual Studio 2015 (14)
      2017    - Visual Studio 2017 (15)
      2019    - Visual Studio 2019 (16)
      2022    - Visual Studio 2022 (17)
    Where (e) is e for express editions of MSVS and blank otherwise.
  r�r�r�r�rVr�rPr�r�)	�8.0�9.0�10.0�11.0r�r�r�r�r��VSINSTALLDIRrz'HKLM\Software\Microsoft\VisualStudio\%sz3HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%sz$HKLM\Software\Microsoft\VCExpress\%sz0HKLM\Software\Wow6432Node\Microsoft\VCExpress\%s�
InstallDirz
devenv.exez*express.exez..rX)z,HKLM\Software\Microsoft\VisualStudio\SxS\VC7z8HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7z,HKLM\Software\Microsoft\VisualStudio\SxS\VS7z8HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VS7)�rr�T�r*)
r�getenv�range�lenr�r�rr	r_�appendr��globr)�versions_to_check�
force_express�version_to_yearr��env_vs_path�env_vs_version�version�keys�indexr�	full_path�express_paths            r�_DetectVisualStudioVersionsr��s��(�
��������
�
�/��(�
�	�.�)�)�+��9�2�3�3�.�"�-3�-3�g�
7��@�B�W�L�3�g�=�?�'�I�K�D��s�4�y�y�!�!�-�-��
�t�E�{�L�
9�
9�d�
���
�t�
$�
$�d��'�,�,�t�\�2�2�i��W�\�\�$��7�7�l�
�-�r�w�~�~�i�8�8�-������w�'?��G�L�L��t�T�*�*�,�,�	-�	-�	-�	-��9�\�"�"�-������w�'?�#�'E��G�L�L��t�T�*�*�,�,�	-�	-�	-��I�I�I�D��s�4�y�y�!�!�
7�
7��
�t�E�{�G�
4�
4�d�
���
�t�
$�
$�d�	�'�	"�	"�g�	-�	-�
�7�>�>�$���	J�
�/�/�.���)A�4�H�H�
I�
I�
I���f��������w�'?�#�'E��G�L�L��t�$�$��6�6�6�	7�	7�	7���3�+�3�.�G�*C�*C��o�o�n�_�^�%D�%0�2�2�3�3�3��
�/r
�autoTc��|dkr tj�dd��}dddddddddddd	d
ddd
�}tj�d��}|rBtj�d��}|std���t	||d���St|��}t
||d|v��}|s7|std���|dkrt	dd��St	|d��S|dS)z�Select which version of Visual Studio projects to generate.

  Arguments:
    version: Hook to allow caller to force a particular version (vs auto).
  Returns:
    An object representing a visual studio project format version.
  r��GYP_MSVS_VERSION)	r�r�r�r�r�r�r�r�r�)r�)r�)r�)r�)r�)r�)r�)r�)r�)r�r�r�r�r�r�r�r�r�rVr�r�rPr�r��GYP_MSVS_OVERRIDE_PATHz`GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be set to a particular version (e.g. 2010e).Tr�rXz,Could not locate Visual Studio installation.r�Nr)rr]r^�
ValueErrorr�r�r�)r��allow_fallback�version_map�
override_path�msvs_versionr�s      r�SelectVisualStudioVersionr��sD��
�����j�n�n�/��8�8�G�
��
��
��
��
��
�����!��+�$�*�.�.�!9�:�:�-��G��:�>�>�"4�5�5�L��D��C�
D�
D�D��,�
��F�F�F�F���L�L�'�
(��W�)=�s�g�~�
N�
N�(�	�+��G��E�F�F�F��&���
�F�D�
)�
)�)�
�G�T�
*�
*�*�	�!��r
r)F)r�T)rqr�rr�r}rz�gypr�rr�objectrr�r�r�r�r�r�r�r�rrr
r�<module>r�s:��
:�9�����	�	�	�	�	�	�	�	�����
�
�
�
�
�
�
�
�����/�/�/�7�7�7�v�v�v�v�v�&�v�v�v�r���>����8���.���<F�F�F�F�R���V�V�V�r.�.�.�.�.�.r