+
    UBi                       ^ RI Ht  ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t^ RIHt ^RIHt ^RIHt ^RIHt ^RIHtHtHt ^RIHt ^R	IHt ^R
IHt ^RIHt ]P6                  '       d   ^RIHt ^RIHt ^RI H!t! ^RI"H#t# M]$t#]PJ                  ! R]PL                  4      t' ! R R]PP                  4      t) ! R R]#4      t*R# )    )annotationsN)Path)arglist)mesonlib)mlog)GnuLikeDynamicLinkerMixinSolarisDynamicLinkerCompCertDynamicLinker)LibType)	compilers)CompileCheckMode)VisualStudioLikeCompiler)
Dependency)ImmutableListProtocol)Environment)Compilerz^(?!-Wl,) .*\.so (?:\.[0-9]+)? (?:\.[0-9]+)? (?:\.[0-9]+)?$ |
                             ^(?:-Wl,)?-l |
                             \.a$c                      ] tR t^2tR
tRtRtRtRtRR R llt	]
]P                  ! RR7      R R l4       4       tR R ltR	tR# )CLikeCompilerArgsc                    V ^8  d   QhRRRR/# )   copyboolreturnT.List[str] )formats   "F/usr/lib/python3.14/site-packages/mesonbuild/compilers/mixins/clike.py__annotate__CLikeCompilerArgs.__annotate__<   s     3A 3Ad 3A{ 3A    c                	   \        V P                  \        P                  4      '       g   Q R 4       hV P	                  4        V'       d   V P                  4       pMT p\        V P                  P                  \        \        \        34      '       d   RpRp\        V4       F/  w  rV\        P                  V4      '       g   K"  TpV^ 8  g   K-  TpK1  	  YCu;8  d   ^ 8  d/   M M+VP                  V^,           R4       VP                  VR4       V P                  P                  4       pV'       Ed3   V Uu. uF  qPP                  V4      NK  	  pp. p	\        V4       F  w  rVVP!                  R4      '       g   K  VR8X  dR   V\#        V4      ^,
          8  d9   V P                  W%^,           ,          4      V9   d   WV^,           .,          p	Kr  Kt  Kv  VP!                  R4      '       d+   V P                  VR,          4      V9   d   W.,          p	K  K  V P                  VR,          4      V9   g   K  W.,          p	K  	  \%        V	4       F  pVP'                  V4       K  	  V P                  P)                  VP*                  4      # u upi )zHow did you get herez-Wl,--end-groupz-Wl,--start-group-isystemz	-isystem=:	   NN:   NN)
isinstancecompilerr   r   flush_pre_postr   linkerr   r	   r
   	enumerateGROUP_FLAGSsearchinsertget_default_include_dirs_cached_realpath
startswithlenreversedpopunix_args_to_native
_container)
selfr   newgroup_start	group_endieachdefault_dirsreal_default_dirsbad_idx_lists
   &&        r   	to_nativeCLikeCompilerArgs.to_native<   s   $--););<<T>TT< 	))+CC dmm**-FH\^s,tuuKI$S>"))$//	?"#K * +!+

9q=*;<

;(;<}}==?<CO P<a!6!6q!9< P(*L$S>z22 :%CHqL)d.C.CCAJ.OSd.d$AE
2 /e)__[11,,T"X6:KK$+ L**4848II C'L * l+
 ,}}00@@# !Qs   7J
Nmaxsizec                    V ^8  d   QhRRRR/# )r   argstrr   r   )r   s   "r   r   r   s   s     % %c %c %r    c                	@    \         P                  P                  V 4      # N)ospathrealpath)rD   s   &r   r/   "CLikeCompilerArgs._cached_realpathq   s     ww$$r    c                   V ^8  d   QhRR/# r   r   rE   r   )r   s   "r   r   r   v   s     L L# Lr    c                	`    V P                  4        R V P                  : RV P                  : R2# )zCLikeCompilerArgs(z, ))r(   r'   r5   r6   s   &r   __repr__CLikeCompilerArgs.__repr__v   s-    #DMM#4Bt6IKKr    r   )-I-L)rS   r"   rT   z-Dz-U)-lz-Wl,-lz-Wl,-rpath,z-Wl,-rpath-link,)z.libz.dll.soz.dylibz.a)-cz-S-Ez-pipe-pthreadz-Wl,--export-dynamicF)__name__
__module____qualname____firstlineno__prepend_prefixesdedup2_prefixesdedup1_prefixesdedup1_suffixesdedup1_argsr?   staticmethod	functools	lru_cacher/   rQ   __static_attributes__r   r    r   r   r   2   sY    #:O JO=OQK3Aj &% ' %L Lr    r   c                    a a ] tR t^{t0 o$ Rt]P                  '       d   / tR]R&   / t	R]R&   / t
R]R&   ]P                  tR R	 ltRR R lltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R  ltR! R" ltR# R$ ltR% R& lt]P<                  ! 4       RR' R( ll4       tRR) R* llt ]P<                  ! 4       R+ R, l4       t!R- R. lt"R/ R0 lt#R1 R2 lt$R3 R4 lt%R5 R6 lt&R7 R8 lt'R9 R: lt(R; R< lt)R= R> lt*R?R
R@R
/RA RB llt+R?R
R@R
RCRD/RE RF llt,R?R
R@R
/RG RH llt-RI RJ lt.]/P`                  3RK RL llt1RM RN lt2RRO RP llt3R@R
/RQ RR llt4R?R
R@R
/RS RT llt5R?R
R@R
/RU RV llt6R?R
R@R
/RW RX llt7R?R
R@R
/RY RZ llt8RR[ R\ llt9R] R^ lt:];R_ R` l4       t<];Ra Rb l4       t=R?R
R@R
/Rc Rd llt>R?R
R@R
/Re Rf llt?R@R
/Rg Rh llt@Ri Rj ltARk Rl ltBRm Rn ltCRo Rp ltDRRq Rr lltERRs Rt lltF];Ru Rv l4       tG]HRw Rx l4       tI];Ry Rz l4       tJ]P<                  ! 4       R{ R| l4       tKR} R~ ltLR R ltM]NP                  RRD3R R lltPR R ltQR R ltRR R ltSRR R lltTR R ltUR R ltVR R ltWR R ltXR R ltYR R ltZR R lt[R R lt\R R lt]];R R l4       t^R R lt_R R lt`R R lta]P<                  ! R
R7      R V 3R ll4       tbR R ltcRtdV ;te# )CLikeCompilerz(Shared bits for the C and CPP Compilers.zT.Dict[str, T.List[str]]	warn_argszgT.Dict[T.Tuple[T.Tuple[str, ...], str, T.Tuple[str, ...], str, LibType, bool], T.Optional[T.List[str]]]find_library_cachezYT.Dict[T.Tuple[T.Tuple[str, ...], str, T.Tuple[str, ...], bool], T.Optional[T.List[str]]]find_framework_cachec                   V ^8  d   QhRR/# )r   r   Noner   )r   s   "r   r   CLikeCompiler.__annotate__   s     7 7$ 7r    c                	J    V P                   P                  R 4       RV n        R# )hN)can_compile_suffixesaddpreprocessorrP   s   &r   __init__CLikeCompiler.__init__   s    !!%%c*26r    Nc                    V ^8  d   QhRRRR/# )r   argszT.Optional[T.Iterable[str]]r   r   r   )r   s   "r   r   ro      s     - -"= -IZ -r    c                	    \        W4      # rG   )r   r6   rx   s   &&r   compiler_argsCLikeCompiler.compiler_args   s     ,,r    c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   ro      s      T r    c                	    R # Tr   rP   s   &r   needs_static_linker!CLikeCompiler.needs_static_linker   s    r    c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   ro      s     ) ) )r    c                "    V P                  4       # )z=
Args that are always-on for all C compilers other than MSVC
)get_largefile_argsrP   s   &r   get_always_argsCLikeCompiler.get_always_args   s     &&((r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro      s      K r    c                	    R .# )z	-nostdincr   rP   s   &r   get_no_stdinc_args CLikeCompiler.get_no_stdinc_args   
    }r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro      s       r    c                	    R .# )z	-nostdlibr   rP   s   &r   get_no_stdlib_link_args%CLikeCompiler.get_no_stdlib_link_args   r   r    c                    V ^8  d   QhRRRR/# )r   levelrE   r   r   r   )r   s   "r   r   ro      s     % %3 %; %r    c                	(    V P                   V,          # rG   )rj   )r6   r   s   &&r   get_warn_argsCLikeCompiler.get_warn_args   s    ~~e$$r    c                   V ^8  d   QhRR/# rM   r   )r   s   "r   r   ro      s      C r    c                	    R # )dr   rP   s   &r   get_depfile_suffix CLikeCompiler.get_depfile_suffix   s    r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro      s      + r    c                	
    R R.# )rX   z-Pr   rP   s   &r   get_preprocess_only_args&CLikeCompiler.get_preprocess_only_args   s    d|r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro      s      { r    c                	    R .# )rW   r   rP   s   &r   get_compile_only_args#CLikeCompiler.get_compile_only_args   s	    vr    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro      s      + r    c                	    R .# )z-O0r   rP   s   &r   get_no_optimization_args&CLikeCompiler.get_no_optimization_args   s	    wr    c                    V ^8  d   QhRRRR/# )r   
outputnamerE   r   r   r   )r   s   "r   r   ro      s     " "# "+ "r    c                	
    R V.# )z-or   )r6   r   s   &&r   get_output_argsCLikeCompiler.get_output_args   s    j!!r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro      s       r    c                	    R .# z-Werrorr   rP   s   &r   get_werror_argsCLikeCompiler.get_werror_args   s
    {r    c               $    V ^8  d   QhRRRRRR/# )r   rI   rE   	is_systemr   r   r   r   )r   s   "r   r   ro      s!      S T k r    c                	@    VR 8X  d   RpV'       d   RV.# RV,           .# ) .r"   rS   r   )r6   rI   r   s   &&&r   get_include_argsCLikeCompiler.get_include_args   s(    2:D%%t}r    c                    V ^8  d   QhRRRR/# r   namerE   r   r   r   )r   s   "r   r   ro      s      c k r    c                    . # )z@
Get dirs from the compiler, either `libraries:` or `programs:`
r   r6   r   s   &&r   get_compiler_dirsCLikeCompiler.get_compiler_dirs   s	     	r    c                    V ^8  d   QhRRRR/# )r   	elf_classT.Optional[int]r   'ImmutableListProtocol[str]'r   )r   s   "r   r   ro      s     $ $? $Fb $r    c           
     	   V P                  R 4      pVe   V^ 8X  d   V# . pV EF/  p\        P                  ! V4       Uu. uFa  qUP                  R4      '       g   K  \        P                  P                  \        P                  P                  WE4      4      '       g   K_  VNKc  	  ppV'       g   VP                  V4       K  V F  p\        P                  P                  WE4      p \        VR4      ;_uu_ 4       pVP                  ^4      p	V	R,          R8w  g   \        V	^,          4      V8X  d   VP                  V4       RRR4        EK-  	  EK2  	  V# u upi   + '       g   i     L"; i  \         d     K  i ; i)	librariesNrV   rb:      Ns   ELF)r   rH   listdirendswithrI   isfilejoinappendopenreadintOSError)
r6   r   dirsretvalr   ffilesfile_to_checkfdheaders
   &&        r   _get_library_dirsCLikeCompiler._get_library_dirs   s,    %%k2	QK !A "

1j1E1BQrww~~VXV]V]VbVbcdVhGiQQEja  "Q 2mT22b!# "#;&0Cq	Ni4O"MM!, 3   0 / k 32  s<   E?E E(E1<AE	E1E.)E11F ?F c                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   ro      s     8 8/ 8[ 8r    c                @    V P                  V4      P                  4       # )z^Wrap the lru_cache so that we return a new copy and don't allow
mutation of the cached value.
)r   r   )r6   r   s   &&r   get_library_dirsCLikeCompiler.get_library_dirs   s     %%i05577r    c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   ro      s     2 2#? 2r    c                $    V P                  R4      # )zh
Programs used by the compiler. Also where toolchain DLLs such as
libstdc++-6.dll are found with MinGW.
programs)r   rP   s   &r   _get_program_dirsCLikeCompiler._get_program_dirs   s     %%j11r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro      s     / /+ /r    c                	>    V P                  4       P                  4       # rG   )r   r   rP   s   &r   get_program_dirsCLikeCompiler.get_program_dirs   s    %%',,..r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro      s      k r    c                	    R .# )z-fPICr   rP   s   &r   get_pic_argsCLikeCompiler.get_pic_args   s
    yr    c               $    V ^8  d   QhRRRRRR/# )r   pch_dirrE   r   r   r   r   )r   s   "r   r   ro      s!     6 6 6S 6[ 6r    c                	D    R \         P                  P                  V4      .# )z-include)rH   rI   basename)r6   r   r   s   &&&r   get_pch_use_argsCLikeCompiler.get_pch_use_args   s    BGG,,V455r    c                    V ^8  d   QhRRRR/# )r   r   rE   r   r   )r   s   "r   r   ro     s     D D D Dr    c                	x    \         P                  P                  V4      R ,           V P                  4       ,           # )r   )rH   rI   r   get_pch_suffixr   s   &&r   get_pch_nameCLikeCompiler.get_pch_name  s*    ww%+d.A.A.CCCr    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro     s      + r    c                	    . # rG   r   rP   s   &r   r.   &CLikeCompiler.get_default_include_dirs  s    	r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro     s     1 1k 1r    c                	6    V P                   P                  4       # rG   )r)   export_dynamic_argsrP   s   &r   gen_export_dynamic_link_args*CLikeCompiler.gen_export_dynamic_link_args  s    {{..00r    c                    V ^8  d   QhRRRR/# )r   
implibnamerE   r   r   r   )r   s   "r   r   ro   
  s     ; ;# ;+ ;r    c                	8    V P                   P                  V4      # rG   )r)   import_library_args)r6   r   s   &&r   gen_import_library_args%CLikeCompiler.gen_import_library_args
  s    {{..z::r    c               (    V ^8  d   QhRRRRRRRR/# )r   work_dirrE   snamecoder   rn   r   )r   s   "r   r   ro     s(     &7 &73 &7s &7# &7$ &7r    c                	   \         P                  ! R V P                  4       ,           R,           \        P                  ! V P
                  4      4       \         P                  ! RV P                  : R24       \        P                  P                  W4      pVP                  R^4      ^ ,          p\        P                  pV P                  '       d:   VR,          pV P                  P                  4       '       g   \        P                  pV P!                  V4      w  rxWpP#                  V4      ,           p	VR,          p\        P                  P                  W4      p
\%        VRRR7      ;_uu_ 4       pVP'                  V4       R	R	R	4       V P
                  V.,           V P)                  V4      ,           V	,           p\        P*                  ! WR
7      w  rp\         P                  ! R\        P                  ! V4      4       \         P                  ! R4       \         P                  ! V4       \         P                  ! R4       \         P                  ! V4       \         P                  ! R4       VP,                  ^ 8w  d)   \        P.                  ! RV P1                  4        R24      hV P3                  V
.V4       R	#   + '       g   i     ELC; i)zSanity testing z
 compiler:zIs cross compiler: r   _crossz.exewzutf-8)encodingN)cwdz#Sanity check compiler command line:zSanity check compile stdout:z"-----
Sanity check compile stderr:z-----z	Compiler z cannot compile programs.)r   debugget_display_languager   	join_argsexelistis_crossrH   rI   r   rsplitr   LINKenvironmenthas_exe_wrapperCOMPILE_get_basic_compiler_argslinker_to_compiler_argsr   writer   
Popen_safe
returncodeEnvironmentExceptionname_stringrun_sanity_check)r6   r  r  r  source_namebinnamemodecargslargsextra_flagsbinary_nameofilecmdlistpcstdostdes   &&&&            r   _sanity_check_impl CLikeCompiler._sanity_check_impl  s    

$t'@'@'BB\QS[SeSefjfrfrSst

((9;<ggll83,,sA&q)$$===xG##3355 (//44T:::5AA 	6ggll85+sW55KK 6
 ,,%(4+?+?+HH;V!,,WC$

8(:L:LW:UV

12

4

89

4

7==A//)D<L<L<N;OOh0ijj{mX6 655s   2J>>K	c                    V ^8  d   QhRRRR/# )r   r  rE   r   rn   r   )r   s   "r   r   ro   5  s     I IS IT Ir    c                	,    R pV P                  VRV4      # )z.int main(void) { int class=0; return class; }
zsanitycheckc.c)r,  )r6   r  r  s   && r   sanity_checkCLikeCompiler.sanity_check5  s    @&&x1A4HHr    
extra_argsdependenciesc          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   hnamerE   prefixr2  IT.Union[None, T.List[str], T.Callable[['CompileCheckMode'], T.List[str]]]r3   T.Optional[T.List['Dependency']]r   T.Tuple[bool, bool]r   )r   s   "r   r   ro   9  s9     U U# Us U!jU#CUObUr    c               	8    V R V R2pV P                  WSVR7      # )
        #include <>r2  r3  compiles)r6   r5  r6  r2  r3  r  s   &&&$$ r   check_headerCLikeCompiler.check_header9  s/     8 '}}T|}TTr    disable_cacheFc               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   r5  rE   r6  r2  r7  r3  r8  rB  r   r   r9  r   )r   s   "r   r   ro   @  sG     w w wS whw!Aw #'w 4Gwr    c               	d    V R V RV RV R2pV P                  WcV\        P                  VR7      # )z;
        #ifdef __has_include
         #if !__has_include("z")
          #error "Header 'zG' could not be found"
         #endif
        #else
         #include <z>
        #endif)r2  r3  r"  rB  )r?  r   
PREPROCESS)r6   r5  r6  r2  r3  rB  r  s   &&&$$$ r   
has_headerCLikeCompiler.has_header@  s`     8 #W % ' " 7  }}T*6=M=X=Xhu  w 	wr    c               0    V ^8  d   QhRRRRRRRRRRR	R
/# )r   r5  rE   symbolr6  r2  GT.Union[None, T.List[str], T.Callable[[CompileCheckMode], T.List[str]]]r3  r8  r   r9  r   )r   s   "r   r   ro   O  s9     8 8s 8C 8 8&m8(H8Tg8r    c               	D    V R V RV RV R2pV P                  WdVR7      # )r;  zx>
        int main(void) {
            /* If it's not defined as a macro, try to use as a symbol */
            #ifndef z
                z4;
            #endif
            return 0;
        }r=  r>  )r6   r5  rI  r6  r2  r3  ts   &&&&$$ r   has_header_symbolCLikeCompiler.has_header_symbolO  sR      '  H   }}Q*6  8 	8r    c                    V ^8  d   QhRRRR/# )r   r"  r   r   z!T.Tuple[T.List[str], T.List[str]]r   )r   s   "r   r   ro   ^  s     ) )-= )Bc )r    c                	   . p. pV\         P                  J d    V P                  P                  P                  P                  R 4      pV P                  P                  P                  P                  R4      p\        V\        4      '       g   Q R4       h\        V\        4      '       g   Q R4       hW P                  WE4      ,          pW0P                  WE4      ,          pV P                  P                  P                  V P                  V P                  4      p\        V\        4      '       d   V.pV P                  V4      pW',          pV\         P                  J d   V P                  P!                  V P                  V P                  R,           4      pVe*   W0P#                  V^ ,          V P$                  4      ,          pV P                  P                  P'                  V P                  V P                  4      p	Y9 U
u. uF  qV9  g   K  V
NK  	  up
,          pW P)                  V4      ,          pW#3#   \        \        3 d     ELli ; iu up
i )b_vscrt	buildtypezfor mypy_ld)r   r  r  coredataoptstoreget_value_forr&   rE   get_crt_compile_argsget_crt_link_argsKeyErrorAttributeErrorget_external_argsfor_machinelanguageremove_linkerlike_argslookup_binary_entryuse_linker_argsversionget_external_link_argsget_compiler_args_for_mode)r6   r"  r#  r$  crt_valrR  sys_argscleaned_sys_argsld_valuesys_ld_argsxs   &&         r   r  &CLikeCompiler._get_basic_compiler_args^  s   #(((
**33<<JJ9U ,,55>>LL[Y	!'3//;;/!)S11=:=1227FF//CC
 ##,,>>t?O?OQUQ^Q^_h$$ zH
  66x@!#((('';;D<L<Ldmm^cNcdH#--hqk4<<HH **33JJ4K[K[]a]j]jkK BA0AaaBBE0066|5 n- . Cs   CH8 II8IIc               (    V ^8  d   QhRRRRRRRR/# )	r   r2  z]T.Union[None, arglist.CompilerArgs, T.List[str], T.Callable[[CompileCheckMode], T.List[str]]]r3  r8  r"  r   r   zarglist.CompilerArgsr   )r   s   "r   r   ro     s5     1 1 (E1)I1 "21 Rf1r    c           	     	z   Vf   . pM\         P                  ! V4      p\         P                  ! V Uu. uF  p\        V4      '       d	   V! V4      MTNK   	  up4      pVf   . pM-\        V\        P
                  P                  4      '       g   V.pV P                  4       p. pV F  pWWP                  4       ,          pVP                  4       R8H  pVP                  4        Fl  p	V	P                  V P                  P                  4       V P                  P                  4       4       F#  p
VP                  V P!                  W4      4       K%  	  Kn  	  V\"        P$                  J g   K  WgP'                  4       ,          pK  	  V P)                  V4      w  rW[,          pWPP+                  V4      ,          pY`P-                  V4       Uu. uF  qR8w  g   K  VNK  	  up,          pV P-                  . 4      R.8X  d*   V. 8w  d   RV9  d   VR.,          pV P/                  V4      pWQ,           V,           pV# u upi u upi )Nsystemz/link)r   listifycallabler&   collectionsabcIterabler{   get_compile_argsget_include_typeget_include_dirsto_string_listr  get_source_dirget_build_dirextendr   r   r  get_link_argsr  get_compiler_check_argsr  r4   )r6   r2  r3  r"  er#  r$  r   system_incdirr:   idircalalrx   s   &&&&           r   build_wrapper_args CLikeCompiler.build_wrapper_args  s   
 J "))*5J%%j&Yj(1++qw1'Dj&YZ
LL+//*B*BCC(>L&*&8&8&:A''))E..0H<M''),,T-=-=-L-L-NPTP`P`PnPnPpqDLL!6!6t!KL r * ',,,**  ..t4--d33 	99"=N=g!!=NN''+y8{wj8wi'
 ,,U3E!E)O 'Z8 Os   $H3H8H8c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   
expressionrE   r6  r2  rJ  r3  r8  r   r   r   )r   s   "r   r   ro     s9     U Us UC U!hU#CUHLUr    c                	F    V R V R2pV P                  WSVR7      ^ ,          # )zI
        #include <stddef.h>
        int main(void) { static int a[1-2*!(z)]; a[0]=0; return 0; }r=  r>  )r6   r  r6  r2  r3  rL  s   &&&&& r   _compile_intCLikeCompiler._compile_int  s9      ..8\9QU }}QL}QRSTTr    c               8    V ^8  d   QhRRRRRRRRRRRR	R
RRR/# r   r  rE   lowr   highguessr6  r2  rJ  r3  r8  r   r   r   )r   s   "r   r   ro     sP     < <S < <o <"1<;><'n< *J< VY<r    c                	(   \        V\        4      '       d!   V P                  V R V 2WVV4      '       d   V# V P                  V P                  P
                  P                  P                  9   d    V P                  WWgR4      w  rRV R2p
V P                  P
                  P                  P                  V P                  ,          P                  V
4      pV'       da   VP                  '       dO   VP                  ^ 8X  d>   V P                  V R VP                   2WVV4      '       d   \        VP                  4      # RpRp\        V\        4      '       d   \        V\        4      '       g   V P                  V R2WVV4      '       df   ^ ;r.V P                  V RV 2WVV4      '       dB   V^,           pW,8  d   \        P                  ! R4      h\        V^,          ^,           V4      pK_  TpMR;r>V P                  V RV 2WVV4      '       d;   V^,
          pW=8  d   \        P                  ! R4      h\!        V^,          V4      pKX  TpMWW28  d   \        P                  ! R	4      hV R
V RV RV 2pV P                  WWg4      '       g   \        P                  ! R4      hW#8w  dM   V\        W2,
          ^,          4      ,           pV P                  V R
V 2WVV4      '       d   TpKG  V^,           pKR  V#   \        P                   d     ELi ; i)z == Fzz
                #include <stdio.h>
                #include <stdint.h>
                int main(void) { int expression = z'; printf("%d", expression); return 0; }iz >= 0z > zCross-compile check overflowedz < z!high limit smaller than low limitz <= z && z >= zValue out of given rangei   r%   )r&   r   r  r]  r  rT  r   build
get_defineruncompiledr  stdoutr   r  minmax)r6   r  r  r  r  r6  r2  r3  expanded_evaluate_expandedr  maxintminintcur	conditions   &&&&&&&&        r   _cross_compute_int CLikeCompiler._cross_compute_int  s   
 eS!!  J<tE7!;VQ]^^ ==D,,55??EEE"ooj*\ab)4 5=:=e%i! &&//99??NRRSde3<<<CNNa,?((J<tCJJ<)H&^jkk"3::.
 #s##:dC+@+@  J<u!5v<XX'':,c#(?Uabb'C|&;;<\]]cAgk62C'':,c#(?Uabb7D}&;;<\]]cAgv.C z334WXX%,d4&ZLSEJI$$Y
QQ334NOO kTZ1,--C  J<tC5!96|\\Ag
O 00 s   1A>K8 0AK8 8LLc               8    V ^8  d   QhRRRRRRRRRRRR	R
RRR/# r  r   )r   s   "r   r   ro     sP      c   *47 g #C ORr    c          	     	0   Vf   . pV P                   '       d   V P                  WW4WVV4      # V RV R2pV P                  WVR7      p	V	P                  '       g   R# V	P                  ^ 8w  d   \
        P                  ! R4      h\        V	P                  4      # )Nzr
        #include<stddef.h>
        #include<stdio.h>
        int main(void) {
            printf("%ld\n", (long)(z#));
            return 0;
        }r=  z&Could not run compute_int test binary.r%   )	r  r  r  r  r  r   r  r   r  )
r6   r  r  r  r  r6  r2  r3  rL  ress
   &&&&&&$$  r   compute_intCLikeCompiler.compute_int  s     J===**:D]ijj % &0L 1	 hhq$0  2|||I>>Q//0XYY3::r    c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   typenamerE   r6  r2  rJ  r3  r8  r   r   r   )r   s   "r   r   ro     s9     r rc r3 r"ir$DrPSrr    c          	     	    Vf   . pV RV R2pV P                  WSVR7      ^ ,          '       g   R# V P                  RV R2R R R W#V4      # )NB
        #include <stddef.h>
        int main(void) {
            + something;
            return 0;
        }r=  zsizeof(rO   r%   r?  r  r6   r  r6  r2  r3  rL  s   &&&$$ r   _cross_sizeofCLikeCompiler._cross_sizeof  s|     J  J  }}Q*6  889; ;I&&
!'<dD$PVdpqqr    c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r  rE   r6  r2  rJ  r3  r8  r   T.Tuple[int, bool]r   )r   s   "r   r   ro   )  s2     + +s +C +b+=+I[+r    c               	P   Vf   . pV P                   '       d   V P                  WVVR7      pVR3# V RV R2pV P                  WcVR7      pVP                  '       g   R# VP                  ^ 8w  d   \
        P                  ! R4      h\        VP                  4      VP                  3# )Nr=  Fzy
        #include<stddef.h>
        #include<stdio.h>
        int main(void) {
            printf("%ld\n", (long)(sizeof(z$)));
            return 0;
        }z!Could not run sizeof test binary.)r%   F)
r  r  
cached_runr  r  r   r  r   r  cached)r6   r  r6  r2  r3  rrL  r  s   &&&$$   r   sizeofCLikeCompiler.sizeof)  s     J===""8
0< # >Ae8O , -5: 6	 ooa+7  9|||>>Q//0STT3::

**r    c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r  rE   r6  r2  T.Optional[T.List[str]]r3  r8  r   r   r   )r   s   "r   r   ro   A  s9     v v vc v%<v'GvSVvr    c          	     	    Vf   . pV RV R2pV P                  WSVR7      ^ ,          '       g   R# V RV R2pV P                  RR R R WSV4      # )Nr  r  r=  zR
        #include <stddef.h>
        struct tmp {
            char c;
            z target;
        };zoffsetof(struct tmp, target)r%   r  r  s   &&&$$ r   _cross_alignmentCLikeCompiler._cross_alignmentA  s     J  J  }}Q*6  889; ;I  J 	 &&'EtTSWYZhtuur    c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r  rE   r6  r2  r  r3  r8  r   r  r   )r   s   "r   r   ro   W  s2     %! %!# %!s %!5%! @%!L^%!r    c               	   Vf   . pV P                   '       d   V P                  WVVR7      pVR3# V RV R2pV P                  WcVR7      pVP                  '       g   \        P
                  ! R4      hVP                  ^ 8w  d   \        P
                  ! R4      h \        VP                  4      pT^ 8X  d   \        P
                  ! RT R24      hYP                  3#   \         d    \        P
                  ! R4      hi ; i)	Nr=  Fzm
        #include <stdio.h>
        #include <stddef.h>
        struct tmp {
            char c;
            z target;
        };
        int main(void) {
            printf("%d", (int)offsetof(struct tmp, target));
            return 0;
        }z!Could not compile alignment test.z$Could not run alignment test binary.z!Could not determine alignment of z&. Sorry. You might want to file a bug.)r  r  r  r  r   r  r  r   r  
ValueErrorr  )	r6   r  r6  r2  r3  r  rL  r  aligns	   &&&$$    r   	alignmentCLikeCompiler.alignmentW  s)    J===%%h:3? & AAe8O 
 J 
 ooa+7  9|||//0STT>>Q//0VWW	X

OE
 A://2ST\S]  ^D  1E  F  Fjj    	X //0VWW	Xs   C "Dc               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   dnamerE   r6  r2  AT.Union[T.List[str], T.Callable[[CompileCheckMode], T.List[str]]]r3  r8  rB  r   r   zT.Tuple[str, bool]r   )r   s   "r   r   ro   ~  s?     $$ $$ $$S $$`$$!A$$ #'$$ 4F$$r    c                	   R pRpRpRV RV RV RV RV V V 2p	V P                  W4\        P                  R7      P                  4       p
\        P
                  ! V P                  W\        P                  R	7      pV'       d2   \        P
                  ! V P                  W\        P                  R	7      pV! 4       ;_uu_ 4       pVP                  pVP                  ^ 8w  d   \        P                  ! R
V: 24      h RRR4       XP                  P                  V4      pVP                  P                  V4      pVR8X  g   VR8X  g   W8X  d   \        P                  ! R4      hVP                  V\!        V4      ,           V pVV8X  d   RpVX3# V P#                  V4      P%                  4       pVX3#   + '       g   i     L; i)z#"MESON_GET_DEFINE_DELIMITER_START"
z!
"MESON_GET_DEFINE_DELIMITER_END"z%"MESON_GET_DEFINE_UNDEFINED_SENTINEL"z	
        z
        #ifndef z
        # define  z
        #endif
        r"  r2  r"  zCould not get define Nz,Delimiters not found in preprocessor output.r%   )r  r   rE  r?   re   partialcached_compilecompiler  r  r   r  r  findrfindMesonBugExceptionr1   _concatenate_string_literalsstrip)r6   r  r6  r2  r3  rB  delim_start	delim_endsentinel_undefr  rx   funcpr  star_idxend_idxdefine_values   &&&&&&           r   r  CLikeCompiler.get_define~  s    =8	@		  .) *		eWYK+ &&z,<,G,G ' IIR 	  !4!4dRbRmRmn$$T\\4O_OjOjkDVVqXXF||q 336KE94UVV !  88==-((..+N283F,,-[\\xx3{+; ;GD>)L
 V##  <<\JPPRLV##% Vs   8F44G	c               0    V ^8  d   QhRRRRRRRRRRR	R
/# )r   fnamerE   rtyper6  r2  r  r3  r8  r   zT.Union[str, int]r   )r   s   "r   r   ro     s9     $ $c $# $s $%<$'G$L]$r    c                	   VR 8X  d   RpRpMVR8X  d   RpRpM\        RV: 24      hV RV RV R	V R
2pV P                  WVR7      p	V	P                  '       g   \        P                  ! RV R24      hVR 8X  d   V	P
                  # VR8X  d%    \        V	P
                  P                  4       4      # Q R4       h  \         d    \        P                  ! RT R24      hi ; i)stringz%sz(char*)r   z%lliz(long long int)zBUG: Unknown return type zJ
        #include <stdio.h>
        int main(void) {
            printf ("z", r  z$());
            return 0;
        }r=  zCould not get return value of z()zReturn value of z() is not an intUnreachable)	AssertionErrorr  r  r   r  r  r   r  r  )
r6   r  r  r6  r2  r3  fmtcastr  r  s
   &&&&&&    r   get_return_valueCLikeCompiler.get_return_value  s   
 HCDe^C$D #<UI!FGG8  U#dV1UG , hhthN|||//2PQVPWWY0Z[[H::e^`3::++-.. 	$m#u  `336FugM]4^__`s   "B: :&C c                   V ^8  d   QhRR/# r   r   zT.Tuple[str, str]r   )r   s   "r   r   ro     s        !2  r    c                 "    Rp V R,          p RpW3# )a  
Try to find the function without a prototype from a header by defining
our own dummy prototype and trying to link with the C library (and
whatever else the compiler links in by default). This is very similar
to the check performed by Autoconf for AC_CHECK_FUNCS.
z
        #define {func} meson_disable_define_of_{func}
        {prefix}
        #include <limits.h>
        #undef {func}
        zb
        #ifdef __cplusplus
        extern "C"
        #endif
        char {func} (void);
        zA
        int main(void) {{
          return {func} ();
        }}r   headmains     r   _no_prototype_templ!CLikeCompiler._no_prototype_templ  s+     	  	 zr    c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   ro     s      #4 r    c                     Rp RpW3# )z
Returns a head-er and main() call that uses the headers listed by the
user for the function prototype while checking if a function exists.
z{prefix}
#include <limits.h>
z
int main(void) {{
            void *a = (void*) &{func};
            long long b = (long long) a;
            return (int) b;
        }}r   r  s     r   _have_prototype_templ#CLikeCompiler._have_prototype_templ  s     1

 zr    c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   funcnamerE   r6  r2  r  r3  r8  r   r9  r   )r   s   "r   r   ro     s9     b5 b5S b5# b5!8b5#Cb5Obb5r    c                  Vf   . pRV,           pVP                  RR4      pV P                  '       di   V P                  P                  P                  P                  VR4      pVe5   \        V\        4      '       d   VR3# \        P                  ! RV R24      hRVR	V/pR
pRV9   d   V P                  4       w  rMV P                  4       w  rW,           V
,           pV P                  VP                  ! R/ VB VVR7      w  rV'       d   RV3# V P                  4       R9   d   R# RV9  VR&   VP                  R4      pWR&   V'       d   RMRVR&   RpV P                  VP                  ! R/ VB VVR7      # )aX  Determine if a function exists.

First, this function looks for the symbol in the default libraries
provided by the compiler (stdlib + a few others usually). If that
fails, it checks if any of the headers specified in the prefix provide
an implementation of the function, and if that fails, it checks if it's
implemented as a compiler-builtin.
Nzhas function r  r  FzCross variable z is not a boolean.r6  r  z
        #if defined __stub_{func} || defined __stub___{func}
        fail fail fail this function is not going to work
        #endif
        z#includer=  Tno_includes
__builtin_
is_builtinr   a  {prefix}
        int main(void) {{

        /* With some toolchains (MSYS2/mingw for example) the compiler
         * provides various builtins which are not really implemented and
         * fall back to the stdlib where they aren't provided and fail at
         * build/link time. In case the user provides a header, including
         * the header didn't lead to the function being defined, and the
         * function we are checking isn't a builtin itself we assume the
         * builtin is not functional and we just error out. */
        #if !{no_includes:d} && !defined({func}) && !{is_builtin:d}
            #error "No definition for {__builtin_}{func} found in the prefix"
        #endif

        #ifdef __has_builtin
            #if !__has_builtin({__builtin_}{func})
                #error "{__builtin_}{func} not found"
            #endif
        #elif ! defined({func})
            {__builtin_}{func};
        #endif
        return 0;
        }}r   >   msvcintel-clFF)replacer  r  
propertieshostgetr&   r   r   r  r  r  linksr   get_idr0   )r6   r  r6  r2  r3  varnamevalfargs
stubs_failr  r  templr  r  r  rL  s   &&&$$           r   has_functionCLikeCompiler.has_function  s    J "H,//#s+===""--2266wECc4((:%33ogYN`4abb 8@QY6Z
 335JD$113JD!D(jj!6!6:.: ! << ;;=00  *7m((6
(l$.bLl. zz!((+U+
'3  5 	5r    c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   r  rE   membernamesr   r6  r2  rJ  r3  r8  r   r9  r   )r   s   "r   r   ro   _  sA     R RC Rk R3 R gR"BRNaRr    c               	z    Vf   . pRP                  R V 4       4      pV RV RV R2pV P                  WtVR7      # )Nr   c              3  .   "   T F  pR V R2x  K  	  R# 5i)z(void) ( foo.z );
Nr   ).0members   & r   	<genexpr>,CLikeCompiler.has_members.<locals>.<genexpr>e  s     RkFM&7ks   z&
        void bar(void) {
            z foo;
            z"
            (void) foo;
        }r=  )r   r?  )r6   r  r  r6  r2  r3  membersrL  s   &&&&$$  r   has_membersCLikeCompiler.has_members_  s]     J''RkRR J I  }}QL}QQr    c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r  rE   r6  r2  r  r3  r8  r   r9  r   )r   s   "r   r   ro   n  s9     R R Rc R^R?RK^Rr    c               	8    V R V R2pV P                  WSVR7      # )z4
        void bar(void) {
            (void) sizeof(z);
        }r=  r>  r  s   &&&&$ r   has_typeCLikeCompiler.has_typen  s4      #* % }}QL}QQr    c                   V ^8  d   QhRR/# r~   r   )r   s   "r   r   ro   w  s      U  U4  Ur    c           	     Z   RpRVP                  4       ,           R,           pV P                  \        P                  4      pRpV P	                  W#\        P                  RR7      ;_uu_ 4       pVP
                  ^ 8w  d   \        RV: RVP                   24      h\        P                  P                  VP                  4      '       g   \        R	V: R
24      h\        VP                  R4      ;_uu_ 4       pV Fi  pRV,           V9   d*   \        P                  ! R4        RRR4       RRR4       R# W9   g   KB  \        P                  ! R4        RRR4       RRR4       R# 	  RRR4       RRR4       \        RV: R24      h  + '       g   i     L(; i  + '       g   i     L3; i)zx
Check if symbols have underscore prefix by compiling a small test binary
and then searching the binary for the string,
s   meson_uscore_prefixzD#ifdef __cplusplus
        extern "C" {
        #endif
        void zG (void) {}
        #ifdef __cplusplus
        }
        #endif
        )_symbols_have_underscore_prefix_searchbinT)r2  r"  want_outputzBUG: Unable to compile z check: z'BUG: Can't find compiled test code for z checkr      _z9Underscore prefix check found prefixed function in binaryNz=Underscore prefix check found non-prefixed function in binaryFzBUG: z+ check did not find symbol string in binary)decoder{  r   r  _build_wrapperr  RuntimeErrorstderrrH   rI   r   output_namer   r   r  )r6   symbol_namer  rx   nr  olines   &       r   r  7CLikeCompiler._symbols_have_underscore_prefix_searchbinw  si   
 - %%'(+ ++,<,D,DE7  =M=U=Ucg hhlm||q "%<QE!((#TUU77>>!--00"%MaURX#YZZammT**aD k)T1

#^_# + ih %,

#bc$ + ih  + i  U1%'RSTT +* ihsI   ,AF	.F7+F	"F4F	<F	F%F	'FFFF*	c                   V ^8  d   QhRR/# r   r   zT.Optional[bool]r   )r   s   "r   r   ro     s      8H r    c                   RpRV R2pV P                  V\        P                  RR7      ;_uu_ 4       pVP                  ^ 8w  d   \	        RVP
                   24      hVP
                  P                  V4      R,          P                  4       p\        P                  ! RV: R24       VR	8X  d    R
R
R
4       R# VR8X  d    R
R
R
4       R#  R
R
R
4       R
#   + '       g   i     R
# ; i)a*  
Check if symbols have underscore prefix by querying the
__USER_LABEL_PREFIX__ define that most compilers provide
for this. Return if functions have underscore prefix or None
if it was not possible to determine, like when the compiler
does not set the define or the define has an unexpected value.
z""MESON_HAVE_UNDERSCORE_DELIMITER" z
        #ifndef __USER_LABEL_PREFIX__
        #define MESON_UNDERSCORE_PREFIX unsupported
        #else
        #define MESON_UNDERSCORE_PREFIX __USER_LABEL_PREFIX__
        #endif
        z MESON_UNDERSCORE_PREFIX
        F)r"  r  zHBUG: Unable to preprocess _symbols_have_underscore_prefix_define check: z@Queried compiler for function prefix: __USER_LABEL_PREFIX__ is ""r  NTr   r%   )
r  r   rE  r  r  r  	partitionrstripr   r  )r6   delimr  r  symbol_prefixs   &    r   &_symbols_have_underscore_prefix_define4CLikeCompiler._symbols_have_underscore_prefix_define  s     5	 
 	   ,<,G,GUZ [[_`||q "%mnonvnvmw#xyyHH..u5b9@@BMJJYZgYjjklm# \[ "$ \[  \[[[s   A=C:CCC(	c                   V ^8  d   QhRR/# r$  r   )r   s   "r   r   ro     s      6F r    c                    V P                   P                  4       '       d   R# V P                   P                  4       '       g!   V P                   P                  4       '       d   V P                   P                  R8H  # R# )z
Check if symbols have underscore prefix by consulting a hardcoded
list of cases where we know the results.
Return if functions have underscore prefix or None if unknown.
Tx86N)info	is_darwin
is_windows	is_cygwin
cpu_familyrP   s   &r   $_symbols_have_underscore_prefix_list2CLikeCompiler._symbols_have_underscore_prefix_list  sW     99  99!!TYY%8%8%:%:99''500r    c                   V ^8  d   QhRR/# r~   r   )r   s   "r   r   ro     s     @ @ @r    c                z    V P                  4       pVe   V# V P                  4       pVe   V# V P                  4       # )zB
Check if the compiler prefixes an underscore to global C symbols
)r+  r5  r  )r6   results   & r   symbols_have_underscore_prefix,CLikeCompiler.symbols_have_underscore_prefix  sI    
 <<>M ::<M ==??r    c               (    V ^8  d   QhRRRRRRRR/# )r   prefixesr   suffixessharedr   r   r   )r   s   "r   r   ro     s*      k [ RV cn r    c                	   . pV P                   P                  4       '       dV   V FM  pVP                  R4      '       d   RMRpV F)  pVP                  VR,           V,           V,           4       K+  	  KO  	  V# V F+  pV F"  pVP                  VR,           V,           4       K$  	  K-  	  V'       dB   V P                   P	                  4       '       d"   V F  pVP                  VR,           4       K  	  V# )_dll.r   r   z{}z{}.z{}.so.[0-9]*.[0-9]*)rA  z_s.)r0  is_os2r0   r   
is_openbsd)r6   r=  r>  r?  patternssdotr  s   &&&&    r   _get_patternsCLikeCompiler._get_patterns  s     "99 LL)9::b!AOOAHsNQ$67 "  OAE	A.   dii**,, $9 9: r    c               $    V ^8  d   QhRRRRRR/# )r   libtyper   strictr   r   zT.Tuple[str, ...]r   )r   s   "r   r   ro     s"     4 4' 44 4L] 4r    c                   R.pV'       d;   \        V \        4      '       g%   V P                  P                  4       '       g   R.pMRR.pV P                  P	                  4       '       d   RR.pMV P                  P                  4       '       d*   \        V \        4      '       d   R.pM. ROpVR.,          pMV P                  P                  4       '       d   RR.pR.V,           pMTV P                  P                  4       R9   d
   RR.pRR.pM,V P                  P                  4       '       d
   . ROp. ROpMR.pV\        P                  J dM   V P                  WER	4      pTP                  V P                  WCR
4       Uu. uF  qwV9  g   K  VNK  	  up4       MV\        P                  J dM   V P                  WCR
4      pTP                  V P                  WER	4       Uu. uF  qwV9  g   K  VNK  	  up4       MOV\        P                  J d   V P                  WER	4      pM(V\        P                  J g   Q hV P                  WCR
4      p\!        V4      # u upi u upi )zO
Get library prefixes and suffixes for the target platform ordered by
priority
alibr   dylibsodll.adllcygTF)rQ  rN  rR  >   tic2000c6000)z_s.libz_s.arN  rM  )z_dll.libz_dll.arN  rM  rR  )r&   r   r0  rB  r1  r2  r3  idlowerr   PREFER_SHAREDrG  ry  PREFER_STATICSHAREDSTATICtuple)r6   rJ  rK  stlibextr=  shlibextrD  ri  s   &&&     r   get_library_naming CLikeCompiler.get_library_naming  s   
 5 *T+CDDTYYM]M]M_M_wHr{H99  HYY!!## $ 899!72HYY  ""w'Hw)HWW]]_ 88U|Ht}HYY5H@H vHg+++))(dCHOO(:(:8u(Uk(U1bjYjQQ(Ukl---))(eDHOO(:(:8t(Tj(T1aiXiQQ(Tjk&))(dCHgnn,,,))(eDHX l ks    II I-Ic                    V ^8  d   QhRRRR/# )r   libsr   r   r   )r   s   "r   r   ro   -  s     = =; =; =r    c                	   R  R lp. pV  F  pVP                  R^R7      p\        V4      ^8w  d   K(   \        ;QJ d+    . R V^,          P                  R4       4       F  NK  	  5 M$! R V^,          P                  R4       4       4       VP                  V4       K  	  \        W!RR7      #   \         d     K  i ; i)c                    V ^8  d   QhRRRR/# )r   ri  rE   r   zT.Tuple[int, ...]r   )r   s   "r   r   8CLikeCompiler._sort_shlibs_openbsd.<locals>.__annotate__.  s     	9 	9 	9!2 	9r    c                    V P                  R ^R7      ^,          p\        ;QJ d#    . R VP                  R4       4       F  NK  	  5# ! R VP                  R4       4       4      # ).so.maxsplitc              3  8   "   T F  p\        V4      x  K  	  R # 5irG   r   r	  r:   s   & r   r  HCLikeCompiler._sort_shlibs_openbsd.<locals>.tuple_key.<locals>.<genexpr>0  s     8AQ   r   )r  r]  split)ri  vers   & r   	tuple_key5CLikeCompiler._sort_shlibs_openbsd.<locals>.tuple_key.  sK    ((6A(.q1C583858583888r    rh  ri  c              3  8   "   T F  p\        V4      x  K  	  R # 5irG   rl  rm  s   & r   r  5CLikeCompiler._sort_shlibs_openbsd.<locals>.<genexpr>9  s     8&7c!ff&7ro  r   T)keyreverse)r  r1   r]  rp  r  r   sorted)rc  rr  filteredrN  rets   &    r   _sort_shlibs_openbsd"CLikeCompiler._sort_shlibs_openbsd,  s    	9 !#C**Va*0C3x1}8c!fll3&788c!fll3&788 OOC   ht<<  s   
B/)B/)$B//B>=B>c               (    V ^8  d   QhRRRRRRRR/# )r   patternrE   	directorylibnamer   r   r   )r   s   "r   r   ro   @  s)      s s S U` r    c                	    \         P                  P                  W!P                  V4      4      pR V9   d&   V P	                  \
        P
                  ! V4      4      # V.# )*)rH   rI   r   r   r{  glob)clsr~  r  r  r   s   &&&& r   _get_trials_from_pattern&CLikeCompiler._get_trials_from_pattern?  sF    GGLLNN7$;<'> ++DIIaL99s
r    c               $    V ^8  d   QhRRRRRR/# )r   envr   pathsr   r   zT.Optional[Path]r   )r   s   "r   r   ro   J  s"       [ EU r    c           	     ,   V EF  p\         P                  P                  V4      '       g   K+  V P                  P                  P                  4       '       d   V P                  P                  P                  4       '       d   \        P                  ! V4      pV'       d&   V P                  P                  P                  V9  dA   \        P                  ! RV RV RV P                  P                  P                   24       EK  \        V4      u # 	  R# )zw
Check whether the library exists by filename. On macOS, we also
check if the library matches our target architecture.
z	Rejected z, supports z
 but need N)rH   rI   r   machinesr  r1  r  r   darwin_get_object_archsr4  r   r  r   )r  r  r  archss   &&  r   _get_file_from_list!CLikeCompiler._get_file_from_listI  s     Aww~~a  <<$$..00S\\5G5G5Q5Q5S5S$<<Q?E CLL$5$5$@$@$M

YqcUG:cllN_N_NjNjMk#lm Aw  r    c                   V ^8  d   QhRR/# r~   r   )r   s   "r   r   ro   ^  s     1 1 1r    c                :    V P                  RR4      ^ ,          ^8H  # )z@
returns true if the output produced is 64-bit, false if 32-bit
zvoid *r   )r  rP   s   &r   output_is_64bitCLikeCompiler.output_is_64bit]  s    
 {{8R(+q00r    c               4    V ^8  d   QhRRRRRRRRRR	R
R	RR/# r   r  rE   
extra_dirsr   r  rJ  r   lib_prefix_warningr   ignore_system_dirsr   r  r   )r   s   "r   r   ro   d  sA     6 6# 6; 6c 6\c 6/36IM6Ri6r    c           	     	   V'       g   V\         P                  J g   WP                  9   d{   R V,           .pV P                  4       V P	                  4       ,           pWpP                  V4      ,           p	V P                  W9RR7      ^ ,          '       d   V# WP                  9   d   R# V P                  V4      p
 V P                  4       '       d   ^pM^p V P                  4       V P	                  4       ,           pV P                  V4      p\        P                  ! Y&'       d   . MV P                  V4      4       EF   pV
 F  pV P                  WV4      pV'       g   K  RpV FX  p\         P"                  P%                  V4      '       g   K*  V.V,           p	V P                  W9RR7      ^ ,          '       g   KV  Tp M	  V'       g   K  VP'                  R4      '       d;   VP'                  V4      '       d$   V'       d   \(        P*                  ! RV: R24       \-        V4      P/                  4       .u u # 	  EK  	  R#   \        P                  \        3 d    ^ p ELi ; i)rU   Tr2  rB  Nr   rN  zfind_library(z>) starting in "lib" only works by accident and is not portable)r   rY  internal_libsget_linker_always_argsget_allow_undefined_link_argsr  r  r`  r  r   MesonExceptionrY  	itertoolschainr   r  rH   rI   r   r0   r   warningr   as_posix)r6   r  r  r  rJ  r  r  r#  r$  r2  rD  r   lcargsr   r  trialstrial_resulttrials   &&&&&&&           r   _find_library_real CLikeCompiler._find_library_reald  s    7+@+@ @---G^$E//1D4V4V4XXE!=!=e!DDJzz$TzJ1MM,,, **73	##%%		 ++-0R0R0TT--e43ER4K`K`ajKklA66qWE!#E77>>%00 "'6!1Jzz$TzRSTUU', $ $%%e,,1H1H1Q1QVhLL=;y!z{\*33566%  m( 3 ''2 	I	s   9I I I I"!I"c               4    V ^8  d   QhRRRRRRRRRR	R
R	RR/# r  r   )r   s   "r   r   ro     sA      # ; c \c /3IMRir    c                	T   WP                   9   d   . # \        V\        4      '       d   V.p\        V P                  4      V\        V4      W4V3pWpP
                  9  d#   V P                  WW4WV4      pWP
                  V&   MV P
                  V,          pVf   R # VP                  4       # rG   )ignore_libsr&   rE   r]  r  rk   r  r   )	r6   r  r  r  rJ  r  r  rv  values	   &&&&&&&  r   _find_library_impl CLikeCompiler._find_library_impl  s     &&&Ij#&&$JT\\"GU:->Oab---++GPbwE+0##C(++C0E=zz|r    Tc               0    V ^8  d   QhRRRRRRRRR	RR
R/# )r   r  rE   r  r   rJ  r   r  r   r  r   r  r   )r   s   "r   r   ro     sA     s sC s[ s7 s)-sJNs[rsr    c                	,    R pV P                  WWcWE4      # zint main(void) { return 0; }
)r  )r6   r  r  rJ  r  r  r  s   &&&&&& r   find_libraryCLikeCompiler.find_library  s    /&&wDK]rrr    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro     s      k r    c                   V P                   R8w  d   \        P                  ! R4      hV P                  RR7      . RO,           pWP	                  4       ,          pWP
                  P                  P                  V P                  V P                  4      ,          p\        P                  ! RRP                  V4      R4       \        P                  P                  4       pRVR	&   \        P                   ! W\"        P$                  R
7      w   r4. pVP'                  R4       F.  pRV9  d   K  VP)                  VRR P+                  4       4       K0  	  V# )z
These are usually /Library/Frameworks and /System/Library/Frameworks,
unless you select a particular macOS SDK with the -isysroot flag.
You can also add to this by setting -F in CFLAGS.
clangz2Cannot find framework path with non-clang compilerF)ccachez#Finding framework path by running: r  
CLC_ALL)r  stdinz(framework directory)N)z-vrX   -i)rW  r   r  get_exelistr   r  rT  r[  r\  r]  r   r  r   rH   environr   r  
subprocessPIPErp  r   r  )r6   commandsos_envr  r+  r  r!  s   &      r   find_framework_paths"CLikeCompiler.find_framework_paths  s    77g))*^__##5#14EE((**$$--??@P@PRVR_R_``

8#((8:LdS"x((Z__U
1JJt$D&d2 LLds))+, % r    c               (    V ^8  d   QhRRRRRRRR/# 	r   r   rE   r  r   allow_systemr   r   r  r   )r   s   "r   r   ro     s*       + UY ^u r    c                	    R p. pV F  pVRV,           .,          pK  	  V'       d   . MRR.pVRV.,          pV P                  WGV,           RR7      ^ ,          '       d   V# R# )zint main(void) { return 0; }z-Fz-Zz
-L/usr/libz
-frameworkTr  N)r  )r6   r   r  r  r  	link_argsr   r2  s   &&&&    r   _find_framework_real"CLikeCompiler._find_framework_real  sl    -!#	A$(#I  (RdL-A
lD))	::dY(>t:TUVWWr    c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   ro     s*       + +/4Kr    c                	,   \        V\        4      '       d   V.p\        V P                  4      V\        V4      V3pW@P                  9   d   V P                  V,          pM V P                  WV4      pWPP                  V&   Vf   R # VP                  4       # rG   )r&   rE   r]  r  rl   r  r   )r6   r   r  r  rv  r  s   &&&&  r   _find_framework_impl"CLikeCompiler._find_framework_impl  s    j#&&$JT\\"D%
*;\J+++--c2E--dME-2%%c*=zz|r    c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   ro     s0     I I3 IK I%)I5LIr    c                &    V P                  WV4      # )z
Finds the framework with the specified name, and returns link args for
the same or returns None when the framework is not found.
)r  )r6   r   r  r  s   &&&&r   find_frameworkCLikeCompiler.find_framework  s     ((<HHr    c               $    V ^8  d   QhRRRRRR/# r   rd  rE   rR  r   r   r   )r   s   "r   r   ro     s!      C C K r    c                	    . # rG   r   r6   rd  rR  s   &&&r   rW  "CLikeCompiler.get_crt_compile_args      	r    c               $    V ^8  d   QhRRRRRR/# r  r   )r   s   "r   r   ro     s!         r    c                	    . # rG   r   r  s   &&&r   rX  CLikeCompiler.get_crt_link_args  r  r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro     s      k r    c                	    V P                   P                  4       '       g!   V P                   P                  4       '       d   . # V P                   P                  4       '       d   R .# R.# )z	-lpthreadrY   )r0  is_haikur1  rB  rP   s   &r   thread_flagsCLikeCompiler.thread_flags  sO    99499#6#6#8#8I99= |r    c                    V ^8  d   QhRRRR/# )r   rx   r   r   r   )r   s   "r   r   ro     s      K K r    c                	"    VP                  4       # rG   )r   rz   s   &&r   r  %CLikeCompiler.linker_to_compiler_args  s    yy{r    c               (    V ^8  d   QhRRRRRRRR/# )	r   rx   r   r  rE   r"  r   r   r9  r   )r   s   "r   r   ro     s*     ? ?+ ?S ?,?1D?r    c                	(    V P                  W!VR 7      # )r  r>  )r6   rx   r  r"  s   &&&&r   has_argumentsCLikeCompiler.has_arguments  s    }}T}>>r    c               $    V ^8  d   QhRRRRRR/# r   rx   r   r  rE   r   r9  r   )r   s   "r   r   ro     s'      Q  Q  QC  QDW  Qr    c                	   . pV F  pVP                  R 4      '       df   VP                  R4      '       d   MMVR9   d(   VP                  RVR,          ,           R,           4       MVP                  RVR,          ,           4       VP                  R4      '       d   \        P                  ! V R24       VP                  V4       K  	  V P	                  W2\
        P                  R7      # )	z-Wno-z-Wno-attributes=z-W:   NNz=1000z-Wl,a9   looks like a linker argument, but has_argument and other similar methods only support checking compiler arguments. Using them to check linker arguments are never supported, and results are likely to be wrong regardless of the compiler you are using. has_link_argument or other similar method can be used instead.r  >   -Wno-stack-usage-Wno-vla-larger-than-Wno-frame-larger-than-Wno-alloca-larger-than-Wno-alloc-size-larger-than)r0   r   r   r  r  r   r  )r6   rx   r  new_argsrD   s   &&&  r   _has_multi_arguments"CLikeCompiler._has_multi_arguments  s     "C ~~g&&
 >>"455 5 5 OOD3r7NW$<=OOD3r7N3~~f%%u %I I J OOC ; < !!(7G7O7O!PPr    c                    V ^8  d   QhRRRR/# r   rx   r   r   r9  r   )r   s   "r   r   ro   *  s     J J J8K Jr    c                	&    V P                  VR 4      # )zextern int i;
int i;
)r  rz   s   &&r   has_multi_arguments!CLikeCompiler.has_multi_arguments*  s    ((/HIIr    c               $    V ^8  d   QhRRRRRR/# r  r   )r   s   "r   r   ro   -  s'     J Jk J JI\ Jr    c                	    V P                   P                  4       V,           pV P                  V4      pV P                  W\        P
                  R 7      # )r  )r)   fatal_warningsr  r  r   r  )r6   rx   r  s   &&&r   _has_multi_link_arguments'CLikeCompiler._has_multi_link_arguments-  sF    {{))+d2++D1!!$3C3H3H!IIr    c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   ro   2  s     V V[ V=P Vr    c                	&    V P                  VR 4      # r  )r  rz   s   &&r   has_multi_link_arguments&CLikeCompiler.has_multi_link_arguments2  s    --d4TUUr    c                    V ^8  d   QhRRRR/# )r   rE  rE   r   r   )r   s   "r   r   ro   6  s        r    c                	    \         P                  ! R 4      pT pVP                  V4      pV'       d7   RP                  VP	                  RRRR4      4      pVP                  V4      pK>  V# )zV(?P<pre>.*([^\\]")|^")(?P<str1>([^\\"]|\\.)*)"\s+"(?P<str2>([^\\"]|\\.)*)(?P<post>".*)r   prestr1str2post)rer  matchr   group)rE  r~  rz  ms   &   r   r  *CLikeCompiler._concatenate_string_literals5  sW    **vwMM#''!''%@ACc"A
r    c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   ro   ?  s      c k r    c                	    R .# r   r   r   s   &&r   !get_has_func_attribute_extra_args/CLikeCompiler.get_has_func_attribute_extra_args?  s     {r    c                    V ^8  d   QhRRRR/# )r   r   rE   r   r9  r   )r   s   "r   r   ro   E  s     V Vs V/B Vr    c                	    V P                   P                  4       '       g*   V P                   P                  4       '       g
   VR9   d   R# V P                  V P	                  V4      V P                  V4      R7      # )	dllimport)r2  >   	dllexportr  r  )r0  r2  r3  r?  attribute_check_funcr  r   s   &&r   has_func_attribute CLikeCompiler.has_func_attributeE  sk     		$$&&$))*=*=*?*?11##}}T66t<(,(N(Nt(T  V 	Vr    c                    V ^8  d   QhRRRR/# )r   disabler   r   r   r   )r   s   "r   r   ro   O  s      t  r    c                	    V'       d   R .# . # )z-DNDEBUGr   )r6   r  s   &&r   get_assert_argsCLikeCompiler.get_assert_argsO  s    <	r    rA   c                    V ^8  d   QhRRRR/# )r   srcz'mesonlib.FileOrString'r   r   r   )r   s   "r   r   ro   U  s     ( (6 (4 (r    c                	H   < V P                   R 8X  d   R# \        SV `	  V4      # )PREPROCESSORT)r"  supercan_compile)r6   r  	__class__s   &&r   r#  CLikeCompiler.can_compileT  s$     99&w"3''r    c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   ro   [  s     ! !( !r    c                	@   V P                   '       g   \        P                  ! V 4      V n         V P                  V P                  4       ,           V P                   n        R V P                   n        V P
                  P                  V P                   4       V P                   # )r!  )rt   r   r  get_preprocess_to_file_argsr"  modesr   rP   s   &r   get_preprocessorCLikeCompiler.get_preprocessor[  sp        $		$D(,t7W7W7Y(YD%%3D"JJd//0   r    )rt   rG   )NNrZ   r   )fr[   r\   r]   r^   __doc__TTYPE_CHECKINGrj   __annotations__rk   rl   r   UNIXY_COMPILER_INTERNAL_LIBSr  ru   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   re   rf   r   r   r   r   r   r   r   r.   r   r  r,  r0  r@  rF  rM  r  r   r  r  r  r  r  r  r  r  r  r  r  rd   r  r  r  r  r  r  r+  r5  r:  rG  r`  r{  classmethodr  r  r  r  r  r   rY  r  r  r  r  r  rW  rX  r  r  r  r  r  r  r  r  r  r  r  r#  r*  rg   __classcell__)r$  __conditional_annotations__s   @@r   ri   ri   {   s    2.0	+0 CE  Evxsx88M7-)%" $ $L8 2 2/6D1;&7PIUmqUFJUwkowDHw */w8pt8KO8)\ 5E4L4L1fU<| FJ.rlprGKr +ei+@D+0v?CvJNv,%!8<%!CG%!N$$L$>    D  (b5;?b5FJb5HRjnREIRRBFR UD<@&<4l = =$    & 1 16p" V]UjUj04QVs
6I? QDJJ
V  V
 &( '(! !r    ri   )+
__future__r   rp  re   r  r  rH   r	  r  r   typingr-  pathlibr   r   r   r   r   linkers.linkersr   r	   r
   r   r   r   visualstudior   r.  r3  r   _typingr   r  r   compilers.compilersr   objectr  Xr+   CompilerArgsr   ri   r   r    r   <module>r>     s    #     	 	        e e   ( 2???*0*/ Hjj %&(dd,FL,, FLRf!H f!r    