
    擖g?^                        S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
Jr  0 rSrSrSrS rS r0 / SSS	S
4S jrS rS rS rS rS r " S S\R0                  5      rS rS rS r\S:X  a  \R<                  " \" 5       5        gg)    N)GypErrorgeneral	variablesincludesc                 f   S[         R                  ;   d  U [         R                  ;   ay  Sn [        R                  " SS9nU(       a  US   S S nU(       a  X-  n[        SU R                  5       [        R                  R                  US   5      US   US   U4-  5        g g ! [         a     N`f = f)	Nall)unknownr   r	      )limitr      z%s:%s:%d:%s %s   )
gypdebug	tracebackextract_stack	Exceptionprintupperospathbasename)modemessageargsctxfs        ./usr/lib/python3/dist-packages/gyp/__init__.pyDebugOutputr      s    		TSYY.'	''a0Ad2Ah OGzz|RWW--c!f5s1vs1vwOP	
 /  		s   #B# #
B0/B0c                      Sn [         R                  " [         R                  " 5       5      n/ nU H,  nUR                  U 5      (       d  M  UR	                  U5        M.     U$ )N.gyp)r   listdirgetcwdendswithappend)	extensionfilesbuild_filesfiles       r   FindBuildFilesr)   -   sO    IJJryy{#EK==##t$      .FTc                    Uc  0 nSU;   a  UR                  SS5      u  oS'   [        R                  " U5      nXS'   UR                  SS5      US'   UR                  S5      (       a  [        R
                  R                  U5      S	   n[        R
                  R                  U5      u  p[        R
                  R                  U	5      n	U	[        R
                  ;  a   [        R
                  R                  S	U	5        OS
U-   n[        U[        5       [        5       U5      n
U
R                  R                  5        H  u  pUR                  X5        M     US   R                   =(       d    US   R"                  nUS   S:X  aB  UR                  S[        R
                  R%                  USUR                  SS5      5      5        O2UR                  S[        R
                  R%                  XS   5      5        ['        U
SS5      (       a  U
R)                  X%5        ['        U
SS5      (       a  U
R+                  U5        ['        U
S/ 5      ['        U
S/ 5      ['        U
S/ 5      ['        U
SS5      ['        U
SS5      ['        U
SS5      ['        U
SS5      S.n[,        R.                  R1                  U UUSS UUUUUS   US   5	      nU
/U-   $ ) z
Loads one or more specified build files.
default_variables and includes will be copied before use.
Returns the generator for the specified format and the
data returned by loading the specified build files.
N-r   flavor	GENERATOR GENERATOR_FLAVORz.pyr   zgyp.generator.optionsninjaPRODUCT_DIR_ABSout
build_typedefaultCONFIGURATION_NAMECalculateVariablesCalculateGeneratorInputInfo+generator_additional_non_configuration_keys"generator_additional_path_sections!generator_extra_sources_for_rules$generator_supports_multiple_toolsetsF4generator_wants_static_library_dependencies_adjustedT#generator_wants_sorted_dependenciesgenerator_filelist_paths)non_configuration_keyspath_sectionsextra_sources_for_rulesr>   r?   r@   rA   parallelroot_targets)splitcopygetr#   r   r   splitextabspathsysinsert
__import__globalslocalsgenerator_default_variablesitems
setdefaultgenerator_outputtoplevel_dirjoingetattrr9   r:   r   inputLoad)r'   formatdefault_variablesr   depthparamscheckcircular_checkgenerator_namer   	generatorkeyval
output_dirgenerator_input_inforesults                   r   rY   rY   7   s     ~
f}#)<<Q#7 x 		"34
 &,k",2JJx,D() u))&1!4!ww}}^< wwt$sxxHHOOAt$)F2 >79fhOI;;AAC
$$S. D 	"33Uvi7H7U7UJ%0$$GGLLE#4#8#8y#Q	
 	$$GGLL7K%LM	
 y.55$$%6? y7>>--f5 #*Db#
 !,PRTU#*:B$
 18=u1
 AHMtA
 07<e0
 %,14%
#. YY^^z~
F ;r*   c                     0 nU  HC  nUR                  SS5      n[        U5      S:X  a   [        US   5      nXAUS   '   M<  SXS   '   ME     U$ ! [         a    US   n N'f = f)z
Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary
of the pairs.  If a string is simply NAME, then the value in the dictionary
is set to True.  If VALUE can be converted to an integer, it is.
=r   r
   r   T)rG   lenint
ValueError)name_value_listrf   itemtokenstoken_values        r   NameValueListToDictrp      s~     FC#v;!(!&)n !,6!9 !%F!9   M  ($Qi(s   AA A c                     [         R                  R                  U / 5      nU(       a  [        R                  " U5      nU$ N)r   environrI   shlexrG   )env_nameflagss     r   ShlexEnvrw      s,    JJNN8R(EE"Lr*   c                 D    U R                  S5      (       a  U  SU 3$ X-   $ )Nz--rh   )
startswith)optvalues     r   	FormatOptr|      s*    
~~daw;r*   c           	      .   / nUR                   (       aQ  U(       aJ  [        U5       H;  n[        X" U5      5      nXu;   a  UR                  U5        UR	                  U5        M=     U(       a)  U H#  nUR	                  [        X" U5      5      5        M%     U$ )a  Regenerate a list of command line flags, for an option of action='append'.

The |env_name|, if given, is checked in the environment and used to generate
an initial list of options, then the options that were specified on the
command line (given in |values|) are appended.  This matches the handling of
environment variables and command line flags where command line flags override
the environment, while not requiring the environment to be set when the flags
are used again.
)use_environmentrw   r|   remover$   )flagvalues	predicateru   r2   rv   
flag_valuer{   s           r   RegenerateAppendFlagr      s}     E8"8,JdIj$9:E~U#LL	 -
  JLL4:)>?@ !Lr*   c                   ^  U 4S jnS nS/nT R                   R                  5        GH  u  pEUS   n[        T U5      nUS   S:H  =(       a    U=(       d    UnUS   n	US   n
U	S	:X  a  UR                  [	        XgXT 5      5        M_  U	S
;   a  U(       a"  UR                  [        Xh" U5      5      5        M  T R                  (       aq  U
(       ag  [        R                  R                  U
5      (       a@  UR                  [        Xh" [        R                  R                  U
5      5      5      5        GM
  GM  GM  GM  U	S;   as  U	S:X  a  U(       d  U	S:X  a  U(       d  UR                  U5        GMG  T R                  (       a1  U
(       a'  [        SU	< SU< SU
< 3[        R                  S9  GM  GM  GM  [        SU	< SU< 3[        R                  S9  GM     U$ )aq  Given a parsed options object, and taking the environment variables into
account, returns a list of flags that should regenerate an equivalent options
object (even in the absence of the environment variables.)

Any path options will be normalized relative to depth.

The format flag is not included, as it is assumed the calling generator will
set that as appropriate.
c                    > [         R                  R                  U TR                  5      n U (       d  [        R
                  R                  $ U $ rr   )r   commonFixIfRelativePathr\   r   r   curdir)r   r2   s    r   FixPath RegenerateFlags.<locals>.FixPath   s3    zz++D'--@77>>!r*   c                     U $ rr    )r{   s    r   NoopRegenerateFlags.<locals>.Noop   s    r*   --ignore-environmentrz   typer   actionru   r$   )storeN)
store_truestore_falser   r   z4Warning: environment regeneration unimplemented for z flag z
 env_name )r(   z/Warning: regeneration unimplemented for action )_regeneration_metadatarR   rW   extendr   r$   r|   r~   r   rs   rI   r   rL   stderr)r2   r   r   rv   namemetadatarz   r{   value_predicater   ru   s   `          r   RegenerateFlagsr      s   
 $$E!88>>@uo&"6*f4@HD(#J'XLL$SGT &YsOE,BCD((X"**..:R:RYsOBJJNN8<T,UVW ;SX(44,&5-'S!((X4:CK .6( #S*ZZ7 AB Lr*   c                   &    \ rS rSrS rS rS rSrg)RegeneratableOptionParseri!  c                 L    0 U l         [        R                  R                  XS9  g )Nusage)1_RegeneratableOptionParser__regeneratable_optionsargparseArgumentParser__init__)selfr   s     r   r   "RegeneratableOptionParser.__init__"  s!    ')$(((;r*   c                 @   UR                  SS5      nSU;   ab  UR                  SS5      (       aK  US   nUR                  S5      nUS:X  a	  [        US'   UR                  S5      UUUS	   S
.U R                  U'   [        R
                  R                  " U /UQ70 UD6  g)a  Add an option to the parser.

This accepts the same arguments as ArgumentParser.add_argument, plus the
following:
  regenerate: can be set to False to prevent this option from being included
              in regeneration.
  env_name: name of environment variable that additional values for this
            option come from.
  type: adds type='path', to tell the regenerator that the values of
        this option need to be made relative to options.depth
ru   Ndest
regenerateTr   r   r   r   )r   r   ru   rz   )poprI   strr   r   r   add_argument)r   r   kwru   r   r   s         r   r   &RegeneratableOptionParser.add_argument&  s     66*d+R<BFF<66f:D 66&>Dv~ 6
 &&*$Aw	2D((. 	,,T?D?B?r*   c                 p    [         R                  R                  " U /UQ76 u  p!U R                  Ul        X!4$ rr   )r   r   parse_known_argsr   r   )r   r   r   s      r   
parse_args$RegeneratableOptionParser.parse_argsE  s5    ..??LtL(,(D(D%|r*   )__regeneratable_optionsN)__name__
__module____qualname____firstlineno__r   r   r   __static_attributes__r   r*   r   r   r   !  s    <@>r*   r   c                 H   [         R                  R                  [        R                  S   5      nSn[        UR                  SS5      S9nUR                  SSSS	S
9  UR                  SSSSS
9  UR                  SSSSS SS9  UR                  SSSSS/ SS9  UR                  SSSSSSS 9  UR                  S!S"S#S$S%S&9  UR                  S'S(S)SS*S+S,S-9  UR                  S.S/S/ S0S1S2S39  UR                  S4S5SS S6S$S7S8S99  UR                  S:S;S<S=S+S>S?9  UR                  S@SASBSSCS$SDSE9  UR                  SFSGS<S=S+SHS?9  UR                  SISS+SJSK9  UR                  SLSMSNSOSPSQ9  UR                  SRSSSS S6S$STSU9  UR                  SVSWSXSSYSZS[9  UR                  S\S]S^SS_S
9  UR                  U 5      u  pEUR                  (       a,  SS K
n[        S`UR                  R                  Sa5       35        gUnUR                  (       d  S nS n	UR                  (       aF  [         R                  R!                  SS 5      n	U	(       a  [         R                  R#                  U	5      n	U	(       d  Sb/n
[        R$                  Sc;   a  U
R'                  Sd5        U
 Hj  n[         R(                  " U5      nU(       d  M"  [         R                  R+                  USe5      n	[         R                  R-                  U	5      (       d  S n	Mj    O,   O)[         R                  R#                  UR                  5      n	U	(       a&  [         R                  R-                  U	5      (       d  S n	UR.                  (       d  / nUR                  (       a   [         R                  R!                  S*/ 5      nU(       a  [0        R2                  " SfU5      nU(       a  Xl        OB[        R$                  Sg:X  a	  Sh/Ul        O%[        R$                  Si;   a	  Sj/Ul        OSk/Ul        UR4                  (       d=  UR                  (       a,  [         R                  R!                  S75      nU(       a  Xl        UR6                  (       + Ul        UR:                   H  nSl[<        R:                  U'   M     [>        [<        R:                  ;   a  [A        [>        Sm5        [C        URD                  RG                  5       5       HL  u  nnUS   Sn:X  a  M  [I        U[J        5      (       a  [A        [>        SoUU5        M:  [A        [>        SpUU5        MN     U(       d
  [M        5       nU(       d  [O        USq-   X4-  5      eURP                  (       d  U H  n[         R                  RS                  [         R                  RU                  U5      5      nUR3                  [         R                  RV                  5      n[Y        U5      n[[        USl-
  SrSr5       H?  nUU   Ss:X  a0  [         R                  RV                  R+                  U5      Ul(          OUU	 MA     URP                  (       d  M    O   URP                  (       d  [O        St5      eUR\                  (       d  URP                  Ul.        0 n/ nUR                  (       a  U[_        S5      -  nUR`                  (       a  UUR`                  -  n[c        U5      n[>        [<        R:                  ;   a  [A        [>        SuU5        / nU	(       ac  [         R                  R+                  U	Sv5      n[         R                  R-                  U5      (       a  [        SwU-   5        UR'                  U5        URd                  (       a  URg                  URd                  5        / nUR                  (       a  U[_        S15      -  nURh                  (       a  UURh                  -  n[c        U5      n[>        [<        R:                  ;   a  [A        [>        SxU5        [k        UR.                  5       GH  nUUU[         Rl                  " 5       U[        R                  S   U	UR8                  URn                  UR!                  SySO5      Sz.
n[q        UUUUURP                  UURr                  URt                  5      u  nnn n!URw                  UU U!U5        URx                  (       d  M  U US      S{   n"URx                   H  n#U#U";  d  M  [O        S|U#-  5      e   UR{                  U!URx                  U5        GM     g)}Nr   z.usage: %(prog)s [options ...] [build_file ...]z%sz%(prog)sr   z--buildconfigsr$   z0configuration for build after project generation)r   r   helpz--checkr^   r   zcheck format of gyp filesz--config-dir
config_dirr   GYP_CONFIG_DIRz7The location for configuration files like include.gypi.)r   r   ru   r7   r   z-dz--debugr   	DEBUGMODEzturn on a debugging mode for debugging GYP.  Supported modes are "variables", "includes" and "general" or "all" for all of them.)r   metavarr   r7   r   z-DdefineszVAR=VALGYP_DEFINESzsets variable VAR to value VAL)r   r   r   ru   r   z--depthr\   PATHr   z1set DEPTH gyp variable to a relative path to PATH)r   r   r   r   z-fz--formatformatsGYP_GENERATORSFzoutput formats to generate)r   r   ru   r   r   z-Ggenerator_flagszFLAG=VALGYP_GENERATOR_FLAGSzsets generator flag FLAG to VAL)r   r   r7   r   ru   r   z--generator-outputrT   DIRGYP_GENERATOR_OUTPUTz$puts generated build files under DIR)r   r   r7   r   r   ru   r   r   r~   r   Tz.do not read options from environment variables)r   r   r7   r   r   z-Iz	--includer   INCLUDEz)files to include in all loaded .gyp files)r   r   r   r   r   z--no-circular-checkr_   z4don't check for circular relationships between filesz--no-parallelzDisable multiprocessing)r   r7   r   z-Sz--suffixsuffixr0   z suffix to add to generated files)r   r7   r   z--toplevel-dirrU   z/directory to use as the root of the source tree)r   r   r7   r   r   r   z-Rz--root-targetrF   TARGETz-include only TARGET and its deep dependencies)r   r   r   r   z-Vz	--versionversionzShow the version and exit.vzgyp-nextHOME)cygwinwin32USERPROFILEr    z[\s,]darwinxcode)r   r   msvsmaker   zrunning with these options:_z
  %s: '%s'z  %s: %sz

%s: error: no build_filesrczCould not automatically locate src directory.  This isa temporary Chromium feature that will be removed.  Use--depth as a workaround.zcmdline_default_variables: %szinclude.gypizUsing overrides found in zgenerator_flags: %starget_arch)
r2   r'   r   cwdbuild_files_arg
gyp_binaryhome_dot_gyprE   rF   r   configurationsz(Invalid config specified via --build: %s)>r   r   r   rL   argvr   replacer   r   r   importlib.metadatar   r   r   r~   rs   rI   
expanduserplatformr$   getenvrV   existsr   rerG   rT   no_parallelrE   r   r   DEBUG_GENERALr   sorted__dict__rR   
isinstancer   r)   r   r\   rK   dirnamesepri   rangerU   rw   r   rp   r   r   r   setr"   rF   rY   r^   r_   GenerateOutputr   PerformBuild)$r   my_namer   parserr2   r   	importlibr'   homer   	home_varshome_vargenerate_formatsg_or   optionr{   
build_filebuild_file_dirbuild_file_dir_componentscomponents_lenindexcmdline_default_variablesr   r   default_include	gen_flagsr   rZ   r]   ra   	flat_listtargetsdatavalid_configsconfs$                                       r   gyp_mainr	  K  s   ggsxx{+G<E&U]]4-LMF
?	   ;V   !I   =  
 -   @   !)   &.   '3  	 =   8    C   &	   /   >   <   )    &006G!)$$,,Z89:;!K ""::>>*:DAL!ww11,?I||22  /%yy*4#%77<<f#=L77>>,77'+ & ww))'*<*<=BGGNN<88??""!zz~~.>C!xx2BC.O ||x'#*)!44#)(#)(##(?(?jjnn34'*$"...G		$  		!M#@A#G$4$4$:$:$<=MFEayC%%%M<GM:vuE > $& >>7BTTUU ==%JWW__RWW__Z-HIN(6(<(<RWW[[(I% !:;N~12r:,U3u<$&GGKK$4$45N$OGM-e4	 ; }}} & }}+  &}}
 !#G8M**7??" 3G <		!:<U	

 H '',,|^D77>>/**-?@OOO, (() IX344	W,,,	))4O		!M#8/J goo&&.99;.((1+(((#00488K
 15%MMMM""	1
-Iw$ 	  GT6B???#IaL12BCM},"#MPT#TUU ( ""4&AQ 'V r*   c                      [        U 5      $ ! [         a,  n[        R                  R	                  SU-  5         S nAgS nAff = f)Nzgyp: %s
r   )r	  r   rL   r   write)r   es     r   mainr    s:    ~ 

q)s   
 
A">Ac                  :    [        [        R                  SS  5      $ )Nr   )r  rL   r   r   r*   r   script_mainr    s    r*   __main__)rH   	gyp.inputr   r   os.pathr   r   rt   rL   r   
gyp.commonr   r   r   DEBUG_VARIABLESDEBUG_INCLUDESr   r)   rY   rp   rw   r|   r   r   r   r   r	  r  r  r   exitr   r*   r   <module>r     s        	  
   	 
" 

q h..8v' 7 7 'TXv
 zHH[] r*   