ÿØÿà JFIF      ÿÛ C      

!"$"$ÿÛ C  ÿÂ p " ÿÄ              ÿÄ             ÿÚ    ÕÔË®
(%	aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥	BQ¤¢ X«)X…€¤   @  

  ..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ C      

!"$"$ÿÛ C  ÿÂ p " ÿÄ              ÿÄ             ÿÚ    ÕÔË®
(%	aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥	BQ¤¢ X«)X…€¤   @  

  ..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     o
    p.a`%                     @   s`   d Z ddlZddlZddddddZdd	 Zd
d Zdd Zdd Zdd Zdd Z	dd Z
dS )z8Utility functions shared amongst the Windows generators.    NexeZdlllibsys)
executableZloadable_moduleZshared_librarystatic_libraryZwindows_driverc                  C   sN   t jt jt} t jt j| dd}t j|dd}t j|d}|S )z/Returns the path of the large_pdb_shim.cc file.z..datawinzlarge-pdb-shim.cc)ospathabspathdirname__file__join)Zthis_dirZsrc_dirZwin_data_dirlarge_pdb_shim_cc r   ./usr/lib/python3/dist-packages/gyp/MSVSUtil.py_GetLargePdbShimCcPath   s
   r   c                 C   s.   i }|D ]}|| vrqt | | ||< q|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)Zin_dictkeysdkeyr   r   r   _DeepCopySomeKeys   s   
r   c                 C   s*   |  dd}d|d |f |d< d|S )zAdd 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partsr   r   r   _SuffixName0   s   	
r   c                 C   s   t | t|S )zAdd 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)r   Znumberr   r   r   
_ShardName>   s   	r!   c              	   C   s  i }|D ]}t || dd}|r|||< qg }| D ]}||v r3t|| D ]
}|t|| q'q|| qi }|D ]U}||v rt|| D ]A}t||}t|| ||< t|| d ||| d< || dg }	g }
t|t|	|| D ]	}|
|	|  qz|
|| d< qIq=|| ||< q=t|D ]:}dD ]5}t|| |g }g }|D ]}||v rt|| D ]
}|t|| qq|| q||| |< qq||fS )a  Shard 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)dependenciesZdependencies_original)intgetrangeappendr!   r   lensorted)target_listtarget_dictsZtargets_to_shardtZshardsZnew_target_listiZnew_target_dictsr   r#   Znew_sourcesposZdeptyper$   Znew_dependenciesr   r   r   r   ShardTargetsJ   sT   

r0   c           	      C   s   | d | }| di }|di }|d}|r|S | di }|dd}|r+|S | d| d	 }d
|t| d  f }|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	variablesZmsvs_large_pdb_pathNZproduct_namer"   z	%s.%s.pdbtypeZPRODUCT_DIR/)
setdefaultr&   TARGET_TYPE_EXT)	target_dictconfig_namevarsconfigmsvslinkerpdb_pathr5   Zpdb_baser   r   r   _GetPdbPath   s   
rA   c                 C   s  g }|D ]}|| }t |ddsq|| qt }|D ]}|| }|d}t|g d}d}	|d |	 }
t||	}tj|}|d d |
 }|d | }t	
|}|
|d< d	|d
< |g|d< ||gdg|d< d}|d | }t||}t	
|}||d< d|d
< |g|d< |g|d< |d D ]C\}}t|||}dD ]}||d q|di }|di }d|d< ||d< |d | }|di }|di }d|d< ||d< q| d| | d| |||< |||< |dg | q| |fS )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.
  Zmsvs_large_pdbr   r"   )r1   Zdefault_configurationZtoolsetZlarge_pdb_copy_ZSHARED_INTERMEDIATE_DIRr7   Znoner6   r#   )ZdestinationfilesZcopiesZlarge_pdb_shimr   r$   r1   )Zmsvs_precompiled_headerZmsvs_precompiled_sourcetestNr2   ZVCCLCompilerTool3ZDebugInformationFormatZProgramDataBaseFileNamer3   trueZGenerateDebugInformationr4   )r%   r&   r(   r   r   r   r	   r
   basenamer   r   itemsrA   popr8   insert)r+   r,   r<   Ztargets_to_shimr-   r:   r   r"   Z	base_dictZcopy_suffixZcopy_target_nameZfull_copy_target_nameZshim_cc_basenameZshim_cc_dirZshim_cc_pathZ	copy_dictZshim_suffixZshim_target_nameZfull_shim_target_nameZ	shim_dictr;   r=   r@   r   r>   Zcompilerr?   r   r   r   InsertLargePdbShims   sj   
	







rK   )__doc__r   r	   r9   r   r   r   r!   r0   rA   rK   r   r   r   r   <module>   s    		7(