HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/self/root/usr/lib/python3.6/site-packages/gyp/__pycache__/MSVSUtil.cpython-36.pyc
3

��S]`%�@s`dZddlZddlZdddddd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dd�Z
dS)z8Utility functions shared amongst the Windows generators.�NZexeZdll�lib�sys)�
executableZloadable_moduleZshared_library�static_libraryZwindows_drivercCsNtjjtjjt��}tjjtjj|dd��}tjj|dd�}tjj|d�}|S)z/Returns the path of the large_pdb_shim.cc file.z..�data�winzlarge-pdb-shim.cc)�os�path�abspath�dirname�__file__�join)Zthis_dirZsrc_dirZwin_data_dir�large_pdb_shim_cc�r�/usr/lib/python3.6/MSVSUtil.py�_GetLargePdbShimCcPaths
rcCs2i}x(|D] }||krq
tj||�||<q
W|S)a-Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|.

  Arguments:
    in_dict: The dictionary to copy.
    keys: The keys to be copied. If a key is in this list and doesn't exist in
        |in_dict| this is not an error.
  Returns:
    The partially deep-copied dictionary.
  )�copy�deepcopy)Zin_dict�keys�d�keyrrr�_DeepCopySomeKeyss

rcCs*|jdd�}d|d|f|d<dj|�S)z�Add a suffix to the end of a target.

  Arguments:
    name: name of the target (foo#target)
    suffix: the suffix to be added
  Returns:
    Target name with suffix added (foo_suffix#target)
  �#�z%s_%sr)�rsplitr
)�name�suffix�partsrrr�_SuffixName0s	rcCst|t|��S)z�Add a shard number to the end of a target.

  Arguments:
    name: name of the target (foo#target)
    number: shard number
  Returns:
    Target name with shard added (foo_1#target)
  )r�str)rZnumberrrr�
_ShardName>s	r cCs�i}x,|D]$}t||jdd��}|r
|||<q
Wg}xF|D]>}||krpx0t||�D]}|jt||��qVWq<|j|�q<Wi}x�|D]�}||k�r2x�t||�D]�}t||�}tj||�||<t||d|�||d<||jdg�}	g}
x,t|t|	�||�D]}|
j|	|��qW|
||d<q�Wq�||||<q�Wx�t|�D]�}x�dD]z}tj||j|g��}
g}xL|
D]D}||k�r�x2t||�D]}|jt||���q�Wn
|j|��qzW||||<�qVW�qLW||fS)aShard some targets apart to work around the linkers limits.

  Arguments:
    target_list: List of target pairs: 'base/base.gyp:base'.
    target_dicts: Dict of target properties keyed on target pair.
  Returns:
    Tuple of the new sharded versions of the inputs.
  Z
msvs_shardr�target_name�sources�dependencies�dependencies_original)r#r$)�int�get�range�appendr r�len�sorted)�target_list�target_dictsZtargets_to_shard�tZshardsZnew_target_list�iZnew_target_dictsrr"Znew_sources�posZdeptyper#Znew_dependenciesrrrr�ShardTargetsJsH








r0c	Cs�|d|}|jdi�}|jdi�}|jd�}|r6|S|jdi�}|jdd�}|rV|S|jd|d	�}d
|t|df}|dd
|}|S)a�Returns the path to the PDB file that will be generated by a given
  configuration.

  The lookup proceeds as follows:
    - Look for an explicit path in the VCLinkerTool configuration block.
    - Look for an 'msvs_large_pdb_path' variable.
    - Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is
      specified.
    - Use '<(PRODUCT_DIR)/<(target_name).(exe|dll).pdb'.

  Arguments:
    target_dict: The target dictionary to be searched.
    config_name: The name of the configuration of interest.
    vars: A dictionary of common GYP variables with generator-specific values.
  Returns:
    The path of the corresponding PDB file.
  �configurations�
msvs_settings�VCLinkerTool�ProgramDatabaseFile�	variablesZmsvs_large_pdb_pathNZproduct_namer!z	%s.%s.pdb�typeZPRODUCT_DIR�/)�
setdefaultr&�TARGET_TYPE_EXT)	�target_dict�config_name�vars�config�msvs�linker�pdb_pathr5Zpdb_baserrr�_GetPdbPath�s
rAcCsg}x0|D](}||}t|jdd��s(q
|j|�q
Wt�}�x�|D�]�}||}|jd�}t|dddg�}d}	|d|	}
t||	�}tjj|�}|d	d
|
}
|
d
|}t	j
|�}|
|d<d|d<|g|d
<|
|gd�g|d<d}|d|}t||�}t	j
|�}||d<d|d<|g|d
<|g|d<x�|jd�j�D]�\}}t|||�}xd D]}|j
|d��qVW|jdi�}|jdi�}d|d<||d<|d|}|jdi�}|jdi�}d|d<||d<�q<W|jd|�|jd|�|||<|||<|jdg�j|�qDW||fS)!a�Insert a shim target that forces the linker to use 4KB pagesize PDBs.

  This is a workaround for targets with PDBs greater than 1GB in size, the
  limit for the 1KB pagesize PDBs created by the linker by default.

  Arguments:
    target_list: List of target pairs: 'base/base.gyp:base'.
    target_dicts: Dict of target properties keyed on target pair.
    vars: A dictionary of common GYP variables with generator-specific values.
  Returns:
    Tuple of the shimmed version of the inputs.
  Zmsvs_large_pdbrr!r1Zdefault_configurationZtoolsetZlarge_pdb_copy�_ZSHARED_INTERMEDIATE_DIRr7Znoner6r")Zdestination�filesZcopiesZlarge_pdb_shimrr#�msvs_precompiled_header�msvs_precompiled_source�testNr2ZVCCLCompilerTool�3ZDebugInformationFormatZProgramDataBaseFileNamer3�trueZGenerateDebugInformationr4)rDrErF)r%r&r(rrrrr	�basenamerr�itemsrA�popr8�insert)r+r,r<Ztargets_to_shimr-r:rr!Z	base_dictZcopy_suffixZcopy_target_nameZfull_copy_target_nameZshim_cc_basenameZshim_cc_dirZshim_cc_pathZ	copy_dictZshim_suffixZshim_target_nameZfull_shim_target_nameZ	shim_dictr;r=r@rr>Zcompilerr?rrr�InsertLargePdbShims�sf









rM)�__doc__rrr9rrrr r0rArMrrrr�<module>s	7(