ó
    æ“–g÷'  ã                   óR   • S r SSKrSSKrSSSSSS.rS rS	 rS
 rS rS rS r	S r
g)z8Utility functions shared amongst the Windows generators.é    NÚexeÚdllÚlibÚsys)Ú
executableÚloadable_moduleÚshared_libraryÚstatic_libraryÚwindows_driverc                  ó„  • [         R                  R                  [         R                  R                  [        5      5      n [         R                  R                  [         R                  R                  U SS5      5      n[         R                  R                  USS5      n[         R                  R                  US5      nU$ )z/Returns the path of the large_pdb_shim.cc file.z..ÚdataÚwinzlarge-pdb-shim.cc)ÚosÚpathÚabspathÚdirnameÚ__file__Újoin)Úthis_dirÚsrc_dirÚwin_data_dirÚlarge_pdb_shim_ccs       Ú./usr/lib/python3/dist-packages/gyp/MSVSUtil.pyÚ_GetLargePdbShimCcPathr      sv   € ä�w‰w�‰œrŸw™wŸ™¬xÓ8Ó9€HÜ�g‰g�o‰oœbŸg™gŸl™l¨8°T¸4Ó@ÓA€GÜ—7‘7—<‘< ¨°Ó7€LÜŸ™Ÿ™ \Ð3FÓGÐØÐó    c                 ó^   • 0 nU H$  nX0;  a  M
  [         R                  " X   5      X#'   M&     U$ )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)Úin_dictÚkeysÚdÚkeys       r   Ú_DeepCopySomeKeysr#      s5   € ð 	€AÛˆØÓÙÜ—’˜w™|Ó,ˆ‹ñ ð €Hr   c                 ób   • U R                  SS5      nUS    SU 3US'   SR                  U5      $ )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)
Ú#é   r   Ú_)Úrsplitr   )ÚnameÚsuffixÚpartss      r   Ú_SuffixNamer,   0   s:   € ð �K‰K˜˜QÓ€EØ˜‘(�˜1˜V˜HÐ%€Eˆ!�HØ�8‰8�E‹?Ðr   c                 ó,   • [        U [        U5      5      $ )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)r)   Únumbers     r   Ú
_ShardNamer0   >   s   € ô �tœS ›[Ó)Ð)r   c           
      ó¶  • 0 nU H-  n[        X   R                  SS5      5      nU(       d  M)  XBU'   M/     / nU  HI  nX2;   a0  [        X#   5       H  nUR                  [	        X65      5        M     M8  UR                  U5        MK     0 nU H®  nX2;   a   [        X#   5       H�  n[	        X65      n[
        R
                  " X   5      Xx'   [	        Xx   S   U5      Xx   S'   Xx   R                  S/ 5      n	/ n
[        U[        U	5      X#   5       H  nU
R                  X›   5        M     X§U   S'   M�     M¨  X   Xs'   M°     [        U5       HŒ  nS Hƒ  n[
        R
                  " Xs   R                  U/ 5      5      n/ nU HI  nXò;   a0  [        X/   5       H  nUR                  [	        Xö5      5        M     M8  UR                  U5        MK     XçU   U'   M…     MŽ     XW4$ )zÿ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.
Ú
msvs_shardr   Útarget_nameÚsources)ÚdependenciesÚdependencies_original)ÚintÚgetÚrangeÚappendr0   r   ÚlenÚsorted)Útarget_listÚtarget_dictsÚtargets_to_shardÚtÚshardsÚnew_target_listÚiÚnew_target_dictsr)   r4   Únew_sourcesÚposÚdeptyper5   Únew_dependenciesr!   s                   r   ÚShardTargetsrI   J   sô  € ð ÐÛˆÜ�\‘_×(Ñ(¨°qÓ9Ó:ˆßˆ6Ø"(˜QÓñ ð
 €OÛˆØÓ ÜÐ+Ñ.Ö/�Ø×&Ñ&¤z°!Ó'7Ö8ó 0ð ×"Ñ" 1Ö%ñ ð ÐÛˆØÓ ÜÐ+Ñ.Ö/�Ü! !Ó'�Ü)-¯ª°<±?Ó)CÐ Ñ&Ü8BØ$Ñ*¨=Ñ9¸1ó9Ð Ñ& }Ñ5ð +Ñ0×4Ñ4°YÀÓC�Ø �Ü  ¤C¨£LÐ2BÑ2EÖF�CØ×&Ñ& w¡|Ö4ñ Gà4? Ñ& yÓ1ó 0ð #/¡/ÐÓñ ô  Ð$Ö%ˆÛ@ˆGÜŸ9š9Ð%5Ñ%8×%<Ñ%<¸WÀbÓ%IÓJˆLØ!ÐÛ!�ØÓ(Ü"Ð#3Ñ#6Ö7˜Ø(×/Ñ/´
¸1Ó0@ÖAó 8ð %×+Ñ+¨AÖ.ñ "ð ,<˜QÑ Ó(ó Añ &ð Ð.Ð.r   c                 ód  • U S   U   nUR                  S0 5      nUR                  S0 5      nUR                  S5      nU(       a  U$ U R                  S0 5      nUR                  SS5      nU(       a  U$ U R                  SU S	   5      nS
R                  U[        U S      5      nUS   S-   U-   nU$ )aw  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Ú	variablesÚmsvs_large_pdb_pathNÚproduct_namer3   z	{}.{}.pdbÚtypeÚPRODUCT_DIRÚ/)Ú
setdefaultr8   ÚformatÚTARGET_TYPE_EXT)	Útarget_dictÚconfig_nameÚvarsÚconfigÚmsvsÚlinkerÚpdb_pathrO   Úpdb_bases	            r   Ú_GetPdbPathr`   ‚   sÀ   € ð$ Ð)Ñ*¨;Ñ7€FØ×Ñ˜_¨bÓ1€Dà�X‰X�n bÓ)€Fà�z‰zÐ/Ó0€HÞØˆà—‘ ¨RÓ0€IØ�}‰}Ð2°DÓ9€HÞØˆà�‰˜~¨{¸=Ñ/IÓJ€HØ×!Ñ! (¬O¸KÈÑ<OÑ,PÓQ€HØ�MÑ" SÑ(¨8Ñ3€Hà€Or   c                 óp  • / nU H:  nX   n[        UR                  SS5      5      (       d  M)  UR                  U5        M<     [        5       nU GHá  nX   nUR                  S5      n[	        U/ SQ5      nSn	US-   U	-   n
[        XI5      n[        R                  R                  U5      nUS   S-   U
-   nUS-   U-   n[        R                  " U5      nX¯S'   S	US
'   U/US'   XÖ/S./US'   SnUS-   U-   n[        UU5      n[        R                  " U5      nUUS'   SUS
'   U/US'   U/US'   UR                  S5      R                  5        H’  u  nn[        UUU5      nS H  nUR                  US5        M     UR                  S0 5      nUR                  S0 5      nSUS'   UUS'   US   U   nUR                  S0 5      nUR                  S0 5      nSUS'   UUS'   M”     U R                  SU5        U R                  SU5        XñU'   UUU'   UR                  S/ 5      R                  U5        GMä     X4$ )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.
Úmsvs_large_pdbr   r3   )rK   Údefault_configurationÚtoolsetÚlarge_pdb_copyr'   ÚSHARED_INTERMEDIATE_DIRrT   ÚnonerR   r4   )ÚdestinationÚfilesÚcopiesÚlarge_pdb_shimr
   r5   rK   )Úmsvs_precompiled_headerÚmsvs_precompiled_sourceÚtestNrL   ÚVCCLCompilerToolÚ3ÚDebugInformationFormatÚProgramDataBaseFileNamerM   ÚtrueÚGenerateDebugInformationrN   )r7   r8   r:   r   r#   r,   r   r   Úbasenamer   r   Úitemsr`   ÚpoprU   Úinsert)r=   r>   rZ   Útargets_to_shimr@   rX   r   r3   Ú	base_dictÚcopy_suffixÚcopy_target_nameÚfull_copy_target_nameÚshim_cc_basenameÚshim_cc_dirÚshim_cc_pathÚ	copy_dictÚshim_suffixÚshim_target_nameÚfull_shim_target_nameÚ	shim_dictrY   r[   r^   r"   r\   Úcompilerr]   s                              r   ÚInsertLargePdbShimsr‡   ©   s¸  € ð €OÛˆØ"‘oˆô �;—?‘?Ð#3°QÓ7×8Ñ8Ùð
 	×Ñ˜qÖ!ñ ô /Ó0ÐäˆØ"‘oˆØ!—o‘o mÓ4ˆä%ØÒOó
ˆ	ð 'ˆØ&¨Ñ,¨{Ñ:ÐÜ +¨AÓ ;ÐÜŸ7™7×+Ñ+Ð,=Ó>ÐØÐ4Ñ5¸Ñ;Ð>NÑNˆØ" SÑ(Ð+;Ñ;ˆÜ—M’M )Ó,ˆ	Ø#3�-Ñ Ø"ˆ	�&ÑØ 1Ð2ˆ	�)Ñà'Ð2EÑFð
ˆ	�(Ñð 'ˆØ&¨Ñ,¨{Ñ:ÐÜ +¨A¨{Ó ;ÐÜ—M’M )Ó,ˆ	Ø#3ˆ	�-Ñ Ø,ˆ	�&ÑØ ,˜~ˆ	�)ÑØ%:Ð$;ˆ	�.Ñ!ð $-§=¡=Ð1AÓ#B×#HÑ#HÖ#JÑˆK˜Ü" ;°¸TÓBˆHó V�Ø—
‘
˜3 Ö%ñ Vð ×$Ñ$ _°bÓ9ˆDð —‘Ð'9¸2Ó>ˆHØ14ˆHÐ-Ñ.Ø2:ˆHÐ.Ñ/ð !Ð!1Ñ2°;Ñ?ˆFØ×$Ñ$ _°bÓ9ˆDØ—_‘_ ^°RÓ8ˆFØ17ˆFÐ-Ñ.Ø,4ˆFÐ(Ó)ñ) $Kð0 	×Ñ˜1Ð3Ô4Ø×Ñ˜1Ð3Ô4Ø.7Ð*Ñ+Ø.7ˆÐ*Ñ+ð 	×Ñ˜~¨rÓ2×9Ñ9Ð:O×PñO ðR Ð&Ð&r   )Ú__doc__r   r   rW   r   r#   r,   r0   rI   r`   r‡   © r   r   Ú<module>rŠ      sN   ðñ
 ?ã Û 	ð
 ØØØØñ€òòò$ò	*ò5/òp$óNf'r   