+
    UBi%                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^RIHtH	t	 ^RIH
t
 ^RIHtHt ^RIHt ^RIHtHtHt ^RIHtHtHtHtHt ^R	IHtHt ^R
IHt ]P8                  '       d/   ^RIHt ^RIHt ^RI H!t! ^ RI"H#t#  ! R R]#4      t$ ! R R]#4      t% ! R R]PL                  4      t' ! R R]4      t(R R lt)R# )    )annotationsN)ExtensionModule
ModuleInfo)ModuleReturnValue)mesonlibbuild)mlog)DEPEND_FILES_KW
DEPENDS_KWINCLUDE_DIRECTORIES)ContainerTypeInfo
FeatureNew	KwargInfotyped_kwargstyped_pos_args)MachineChoiceMesonException)ExternalProgram)ModuleState)Compiler)Interpreter)	TypedDictc                  @    ] tR t^t$ R]R&   R]R&   R]R&   R]R&   R	tR
# )CompileResourcesT.List[mesonlib.FileOrString]depend_files6T.List[T.Union[build.BuildTarget, build.CustomTarget]]dependsz'T.List[T.Union[str, build.IncludeDirs]]include_directoriesT.List[str]args N__name__
__module____qualname____firstlineno____annotations____static_attributes__r"       ?/usr/lib/python3.14/site-packages/mesonbuild/modules/windows.pyr   r      s    33GGDDr*   r   c                  T    ] tR t^#t$ R]R&   R]R&   R]R&   R]R&   R	]R
&   R]R&   RtR# )RcKwargsstroutputz?T.List[T.Union[mesonlib.FileOrString, build.CustomTargetIndex]]inputzT.Optional[str]depfiler   r   r   r   z%T.List[T.Union[str, ExternalProgram]]commandr"   Nr#   r"   r*   r+   r-   r-   #   s%    NN  33GG66r*   r-   c                  "    ] tR t^+t^t^t^tRtR# )ResourceCompilerTyper"   N)r$   r%   r&   r'   windresrcwrcr)   r"   r*   r+   r4   r4   +   s    G	
B
Cr*   r4   c                  F  a  ] tR t^0t]! R4      tR V 3R lltR R ltR R lt]	! R]
]P                  ]P                  ]P                  3^R	7      ]! R]P$                  ! R
R7      ]P$                  ! R
R7      ]]! R]! ]]
4      . RR7      4      R R l4       4       tRtV ;t# )WindowsModulewindowsc                   V ^8  d   QhRR/# )   interpreter'Interpreter'r"   )formats   "r+   __annotate__WindowsModule.__annotate__4   s      M r*   c                	   < \         SV `  V4       R V n        V P                  P	                  RV P
                  /4       R # )Ncompile_resources)super__init___rescompmethodsupdaterC   )selfr=   	__class__s   &&r+   rE   WindowsModule.__init__4   s9    %TX!7!7
 	r*   c                    V ^8  d   QhRRRR/# )r<   	compilerszT.Dict[str, 'Compiler']returnz
'Compiler'r"   )r?   s   "r+   r@   rA   ;   s     S S)@ SZ Sr*   c                	J    R F  pW!9   g   K  W,          u # 	  \        R4      h)cz2Resource compilation requires a C or C++ compiler.)rP   cpp)r   )rI   rM   ls   && r+   detect_compilerWindowsModule.detect_compiler;   s'    A~ |#  QRRr*   c                    V ^8  d   QhRRRR/# )r<   state'ModuleState'rN   z.T.Tuple[ExternalProgram, ResourceCompilerType]r"   )r?   s   "r+   r@   rA   A   s     , ,] ,?m ,r*   c                	   \         P                  pV P                  '       d   V P                  # \        P                  ! VP
                  VR 4      pV'       d   VP                  4       '       g   R R lpV P                  VP
                  P                  P                  V,          4      pVP                  R9   g.   VP                  '       d'   VP                  P                  R9   d   V! RR.4      pM
V! R R.4      pV'       g   \        R4      hRR\        P                  3RR	\        P                  3R
R\        P                  3R
R\        P                   33 F  w  rgp\"        P$                  ! VP'                  4       V.,           4      w  rp\(        P*                  ! Wz\(        P,                  4      pV'       g   Kd  \.        P0                  ! RVP3                  4       ,          4       W83V n         V P                  # 	  \        R4      h)r5   c                    V ^8  d   QhRRRR/# )r<   namesr    rN   zT.Optional[ExternalProgram]r"   )r?   s   "r+   r@   ;WindowsModule._find_resource_compiler.<locals>.__annotate__N   s      { 7R r*   c                f    V  F*  p\        VR R7      pVP                  4       '       g   K(  Vu # 	  R# )T)silentN)r   found)rZ   nameprograms   &  r+   search_programs>WindowsModule._find_resource_compiler.<locals>.search_programsN   s-    !D-d4@G}}& " r*   r6   zllvm-rczllvm-windresz(Could not find Windows resource compilerz/?z"^.*Microsoft.*Resource Compiler.*$zLLVM Resource Converter.*$z	--versionz^.*GNU windres.*$z^.*Wine Resource Compiler.*$zWindows resource compiler: %sz5Could not determine type of Windows resource compiler>   msvcclang-clintel-cl>   linklld-link)r   HOSTrF   r   from_bin_listenvironmentr^   rS   coredatarM   idlinkerr   r4   r6   r5   r7   r   
Popen_safeget_commandresearch	MULTILINEr	   loggroup)rI   rV   for_machinerescompra   compargmatchrc_typepoems   &&           r+   _find_resource_compiler%WindowsModule._find_resource_compilerA   s    $((=====  "//0A0A;PYZgmmoo ''(9(9(B(B(L(L[(YZDww::t{{{t{{~~auOu)4*;<)9n*EF !KLL ;=Q=T=TU35I5L5LM13G3O3OP<>R>V>VW	&
!S ))'*=*=*?3%*GHGA!		%BLL1Aq81779DE!( 2 }}&
 !!XYYr*   zwindows.compile_resources)varargsmin_varargsz0.47.0)sincer!   T)defaultlistifyc               (    V ^8  d   QhRRRRRRRR/# )	r<   rV   rW   r!   zYT.Tuple[T.List[T.Union[str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex]]]kwargsz'CompileResources'rN   r   r"   )r?   s   "r+   r@   rA   w   s1     Y= Y=} Y= yY="4Y=9JY=r*   c                	  aa VR ,          P                  4       pVR,          pVR,          pV F  p\        V\        P                  4      '       g   K%  VSP	                  \        P
                  ! R. R\        P                  P                  RV P                  P                  P                  V4      4      .4      .4      ,          pK  	  VSP	                  VR,          4      ,          pV P                  S4      w  rV	\        P                  8X  d   Rp
V. RO,           pMkV	\        P                  8X  dJ   R	p
VRR
.,           pRpV F3  pRV9   g   K  \         P"                  ! VP%                  V4      RR7       K5  	  MR	p
V. RO,           p. pR VV3R llpV! 4        EF  w  pppVP'                  RR4      P'                  RR4      P'                  RR4      pVP'                  RR4      P'                  RR4      P'                  RR4      pV RV
 2p. pVP)                  V4       VP+                  V4       RpV	\        P                  8X  d   V R2pVP+                  . RO4       VP)                  \        P                  ! VSP,                  SP.                  SP0                  VV.V.VVVRR7      4       EK  	  \3        W.4      # )r!   r   r    Fz@BUILD_ROOT@r   res@INPUT@r|   @OUTPUT@zArgument {!r} has a space which may not work with windres due to a MinGW bug: https://sourceware.org/bugzilla/show_bug.cgi?id=4933 )fatalc                   V ^8  d   QhRR/# )r<   rN   zST.Iterable[T.Tuple[str, str, T.Union[str, mesonlib.File, build.CustomTargetIndex]]]r"   )r?   s   "r+   r@   5WindowsModule.compile_resources.<locals>.__annotate__   s     	d 	dn 	dr*   c               3    <"   S^ ,           EF  p \        V \        4      '       d1   \        P                  P	                  SP
                  V 4      W 3x  KJ  \        V \        P                  4      '       d"   V P                  4       V P                  V 3x  K  \        V \        P                  4      '       d   \        P                  ! RRSP                  SP                  R7       V P!                  4        RV P"                  P%                  4       P'                  V P(                  4       2RV P+                  4        2V 3x  EK8  \-        V P%                  4       4      ^8  d/   \        P                  ! RRSP                  SP                  R7       \/        V P%                  4       4       F+  w  rV P!                  4        RV 2RV RV 2W,          3x  K-  	  EK  	  R# 5i)r   zBwindows.compile_resource CustomTargetIndex in positional argumentsz0.61.0)location_windows_compile_resources_zSwindows.compile_resource CustomTarget with multiple outputs in positional argumentsN)
isinstancer.   ospathjoinsubdirr   Filerelative_namefnamer   CustomTargetIndexr   
single_use
subprojectcurrent_nodeget_idtargetget_outputsindexr/   get_filenamelen	enumerate)srcioutr!   rV   s      r+   	get_names2WindowsModule.compile_resources.<locals>.get_names   s    Awwc3'''',,u||S93CCX]]33++-syy#==U%<%<==))*npx*/*:*:UEWEWY "jjl^1SZZ-C-C-E-K-KCJJ-W,XY78H8H8J7KLcS S 3??,-1"--  /D.68H8HSXSeSeg"+COO,="> "%as37QRSQTTUVYUZ5[]`]ccc #?! s   GG /r   \:z_@BASENAME@.Nz.dzCompiling Windows resource {})r1   r   extra_dependsdescription)z/nologoz/fo@OUTPUT@r   )r   z-or   )z--preprocessor-arg=-MDz--preprocessor-arg=-MQ@OUTPUT@z--preprocessor-arg=-MF@DEPFILE@)copyr   r   CustomTargetget_include_argsIncludeDirsr   r   r   r=   backendget_target_dirr   r4   r6   r5   r	   warningr?   replaceappendextendr   r   rj   r   )rI   rV   r!   r   
extra_argswrc_depend_fileswrc_dependsdrv   rescomp_typesuffixres_argsr~   rx   res_targetsr   r_   name_formattedr   r/   r2   r1   s   &ff&                  r+   rC   WindowsModule.compile_resourceso   s    F^((*
!.1Y'A!U//00e44%%b"ebggll>SWScScSkSkSzSz{|S}6~5  A6  
 
 	e,,V4I-JKK
 $ < <U C/222 F!$IIH1999 F!Y
$;;HTA!#:LL#e< " F!$AAH24	d 	d, *3%D.#<<S)11$<DDS#ND+33C=EEdCPXXY\^abNv\&2F=?GNN7#NN8$'+G3;;;#HB-  C D u11  !!-);  ! *5< !m<<r*   )rF   )r$   r%   r&   r'   r   INFOrE   rS   r   r   r.   r   r   r   r   r   r   r
   evolver   r   r   r   listrC   r)   __classcell__)rJ   s   @r+   r9   r9   0   s    i D S,\ /#x}}eN`N`bgbyby9z  IJ  K#X.)&+D#6DQY= KY=r*   r9   c                    V ^8  d   QhRRRR/# )r<   interpr>   rN   r9   r"   )r?   s   "r+   r@   r@      s     ! !} ! !r*   c                    \        V 4      # )N)r9   )r   s   &r+   
initializer      s      r*   )*
__future__r   enumr   rp   typingTr   r   r   r   r   r   r	   interpreter.type_checkingr
   r   r   interpreterbase.decoratorsr   r   r   r   r   r   r   programsr   TYPE_CHECKINGr   rM   r   r=   r   typing_extensionsr   r   r-   Enumr4   r9   r   r"   r*   r+   <module>r      s    #  	 	  *    X X o o 4 &???$)+9 79 7499 
`=O `=D!r*   