
    <hM                       S SK J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	r	S SK
rS SKJr  SSKJr  SSKJr  SSKJr  SSKJrJrJr  SS	KJr  S
SKJr  S
SKJr  SSKJr  \R6                  (       a  SSKJr  SSKJr  SSK J!r!  SSK"J#r#  O\$r#\RJ                  " S\RL                  5      r' " S S\RP                  5      r) " S S\#5      r*g)    )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                  z    \ rS rSrSrSrSrSrSrSSS jjr	\
\R                  " SS	9SS
 j5       5       rSS jrSrg)CLikeCompilerArgs2   )-I-L)r   -isystemr   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-dynamicc                   [        U R                  [        R                  5      (       d   S5       eU R	                  5         U(       a  U R                  5       nOU n[        U R                  R                  [        [        [        45      (       av  SnSn[        U5       H-  u  pV[        R                  U5      (       d  M!  UnUS:  d  M+  UnM/     XCs=:  a  S:  a*  O  O'UR                  US-   S5        UR                  US5        U R                  R                  5       nU(       Ga  U Vs/ s H  oPR                  U5      PM     nn/ n	[        U5       H  u  pVUR!                  S5      (       d  M  US:X  a;  U[#        U5      S-
  :  a'  U R                  X%S-      5      U;   a  XUS-   /-  n	MZ  M\  M^  UR!                  S5      (       a!  U R                  US	S  5      U;   a  X/-  n	M  M  U R                  US
S  5      U;   d  M  X/-  n	M     [%        U	5       H  nUR'                  U5        M     U R                  R)                  UR*                  5      $ s  snf )NzHow did you get herer   r   z-Wl,--end-groupz-Wl,--start-groupr   z	-isystem=	      )
isinstancecompilerr   r   flush_pre_postcopy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
             ڂ/mnt/mint/home/seanl/mnt/public/Repos/ladybird/Build/vcpkg/downloads/tools/meson-1.9.0-d1fcc2/mesonbuild/compilers/mixins/clike.py	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   +INmaxsizec                @    [         R                  R                  U 5      $ N)ospathrealpath)args    r?   r/   "CLikeCompilerArgs._cached_realpathq   s     ww$$    c                `    U R                  5         SU R                  < SU R                  < S3$ )NzCLikeCompilerArgs(z, ))r'   r&   r5   r6   s    r?   __repr__CLikeCompilerArgs.__repr__v   s-    #DMM#4Bt6IKKrK    F)r(   boolreturnT.List[str])rI   strrT   rV   rT   rV   )__name__
__module____qualname____firstlineno__prepend_prefixesdedup2_prefixesdedup1_prefixesdedup1_suffixesdedup1_argsr@   staticmethod	functools	lru_cacher/   rO   __static_attributes__rQ   rK   r?   r   r   2   sS    #:O JO=OQK3Aj &% ' %LrK   r   c                  j  ^  \ rS rSr% Sr\R                  (       a  0 rS\S'   0 r	S\S'   0 r
S\S'   \R                  rS_S	 jrS`SaS jjrSbS jrScS jrScS jrScS jrSdS jrSeS jrScS jrScS jrScS jrSfS jrScS jrSgS jrShS jr\R<                  " 5        S`   SiS jj5       r S`   SjS jjr \R<                  " 5       SkS j5       r!SlS jr"ScS jr#SmS jr$SnS jr%ScS  jr&SlS! jr'SoS" jr(      SpS# jr)SqS$ jr*S
S
S%.     SrS& jjr+S
S
S'S(.       SsS) jjr,S
S
S%.       StS* jjr-SuS+ jr.\/R`                  4       SvS, jjr1      SwS- jr2  Sx           SyS. jjr3S
S/.           SyS0 jjr4S
S
S%.     SzS1 jjr5S
S
S%.     S{S2 jjr6S
S
S%.     S|S3 jjr7S
S
S%.     S}S4 jjr8 S~       SS5 jjr9        SS6 jr:\;SS7 j5       r<\;SS8 j5       r=S
S
S%.     SS9 jjr>S
S
S%.         SS: jjr?S
S/.     SS; jjr@SS< jrASS= jrBSS> jrCSS? jrDS~SS@ jjrES~SSA jjrF\;SSB j5       rG\HSSC j5       rI\;SSD j5       rJ\R<                  " 5       SSE j5       rKSSF jrL          SSG jrM\NR                  SHS'4       SSI jjrPSlSJ jrQSSK jrR    SSL jrS S   SSM jjrTSSN jrUSSO jrVSlSP jrWSSQ jrX    SSR jrYSSS jrZSST jr[SSU jr\SSV jr]\;SSW j5       r^SSX jr_SSY jr`SSZ jra\R<                  " S
S[9SU 4S\ jj5       rbSS] jrcS^rdU =re$ )CLikeCompiler{   z(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                H    U R                   R                  S5        S U l        g )Nh)can_compile_suffixesaddpreprocessorrN   s    r?   __init__CLikeCompiler.__init__   s    !!%%c*26rK   Nc                    [        X5      $ rE   )r   r6   argss     r?   compiler_argsCLikeCompiler.compiler_args   s     ,,rK   c                    g)NTrQ   rN   s    r?   needs_static_linker!CLikeCompiler.needs_static_linker   s    rK   c                "    U R                  5       $ )z=
Args that are always-on for all C compilers other than MSVC
)get_largefile_argsrN   s    r?   get_always_argsCLikeCompiler.get_always_args   s     &&((rK   c                    S/$ )Nz	-nostdincrQ   rN   s    r?   get_no_stdinc_args CLikeCompiler.get_no_stdinc_args   
    }rK   c                    S/$ )Nz	-nostdlibrQ   rN   s    r?   get_no_stdlib_link_args%CLikeCompiler.get_no_stdlib_link_args   r   rK   c                     U R                   U   $ rE   )rh   )r6   levels     r?   get_warn_argsCLikeCompiler.get_warn_args   s    ~~e$$rK   c                    g)NdrQ   rN   s    r?   get_depfile_suffix CLikeCompiler.get_depfile_suffix   s    rK   c                
    SS/$ )Nr   z-PrQ   rN   s    r?   get_preprocess_only_args&CLikeCompiler.get_preprocess_only_args   s    d|rK   c                    S/$ )Nr   rQ   rN   s    r?   get_compile_only_args#CLikeCompiler.get_compile_only_args   s	    vrK   c                    S/$ )Nz-O0rQ   rN   s    r?   get_no_optimization_args&CLikeCompiler.get_no_optimization_args   s	    wrK   c                
    SU/$ )Nz-orQ   )r6   
outputnames     r?   get_output_argsCLikeCompiler.get_output_args   s    j!!rK   c                    S/$ Nz-WerrorrQ   rN   s    r?   get_werror_argsCLikeCompiler.get_werror_args   s
    {rK   c                4    US:X  a  SnU(       a  SU/$ SU-   /$ )N .r   r   rQ   )r6   rG   	is_systems      r?   get_include_argsCLikeCompiler.get_include_args   s(    2:D%%t}rK   c                    / $ )z@
Get dirs from the compiler, either `libraries:` or `programs:`
rQ   )r6   envnames      r?   get_compiler_dirsCLikeCompiler.get_compiler_dirs   s	     	rK   c           
        U R                  US5      nUb  US:X  a  U$ / nU GH  n[        R                  " U5       Vs/ s H_  ofR                  S5      (       d  M  [        R                  R                  [        R                  R                  XV5      5      (       d  M]  UPMa     nnU(       d  UR                  U5        M  U Hw  n[        R                  R                  XV5      n [        US5       n	U	R                  S5      n
U
SS S:w  d  [        U
S   5      U:X  a  UR                  U5        S S S 5          GM     GM     U$ s  snf ! , (       d  f       N = f! [         a     M  f = f)	N	librariesr   r   rb   r      s   ELF)r   rF   listdirendswithrG   isfilejoinappendopenreadintOSError)r6   r   	elf_classdirsretvalr   ffilesfile_to_checkfdheaders              r?   _get_library_dirsCLikeCompiler._get_library_dirs   s+    %%c;7	QK !A "

1j1E1BQrww~~VXV]V]VbVbcdVhGiQEja  "Q 2mT2b!# "!A;&0Cq	Ni4O"MM!, 3   0 / k 32  s;   E?EE%E1>E	/E	
EE
E('E(c                @    U R                  X5      R                  5       $ )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   r   s      r?   get_library_dirsCLikeCompiler.get_library_dirs   s    
 %%c5::<<rK   c                &    U R                  US5      $ )zh
Programs used by the compiler. Also where toolchain DLLs such as
libstdc++-6.dll are found with MinGW.
programs)r   r6   r   s     r?   _get_program_dirsCLikeCompiler._get_program_dirs   s     %%c:66rK   c                @    U R                  U5      R                  5       $ rE   )r   r(   r   s     r?   get_program_dirsCLikeCompiler.get_program_dirs   s    %%c*//11rK   c                    S/$ )Nz-fPICrQ   rN   s    r?   get_pic_argsCLikeCompiler.get_pic_args   s
    yrK   c                D    S[         R                  R                  U5      /$ )Nz-include)rF   rG   basename)r6   pch_dirr   s      r?   get_pch_use_argsCLikeCompiler.get_pch_use_args   s    BGG,,V455rK   c                h    [         R                  R                  U5      S-   U R                  5       -   $ )Nr   )rF   rG   r   get_pch_suffixr6   r   s     r?   get_pch_nameCLikeCompiler.get_pch_name  s*    ww%+d.A.A.CCCrK   c                    / $ rE   rQ   rN   s    r?   r.   &CLikeCompiler.get_default_include_dirs  s    	rK   c                8    U R                   R                  U5      $ rE   )r)   export_dynamic_argsr   s     r?   gen_export_dynamic_link_args*CLikeCompiler.gen_export_dynamic_link_args	  s    {{..s33rK   c                8    U R                   R                  U5      $ rE   )r)   import_library_args)r6   
implibnames     r?   gen_import_library_args%CLikeCompiler.gen_import_library_args  s    {{..z::rK   c                    [         R                  " SU R                  5       -   S-   [        R                  " U R
                  5      5        [         R                  " SU R                  < S35        [        R                  R                  X5      nUR                  SS5      S   n[        R                  nU R                  (       a*  US-  nUR                  5       (       d  [        R                  nU R                  X'5      u  pXR!                  U	5      -   n
US-  n[        R                  R                  X5      n[#        US	S
S9 nUR%                  U5        S S S 5        U R
                  U/-   U R'                  U5      -   U
-   n[        R(                  " XS9u  pn[         R                  " S[        R                  " U5      5        [         R                  " S5        [         R                  " U5        [         R                  " S5        [         R                  " U5        [         R                  " S5        UR*                  S:w  a(  [        R,                  " SU R/                  5        S35      eU R1                  X+/U5        g ! , (       d  f       GN0= f)NzSanity testing z
 compiler:zIs cross compiler: r   r   r   _crossz.exewzutf-8)encoding)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_crossrF   rG   r   rsplitr   LINKhas_exe_wrapperCOMPILE_get_basic_compiler_argslinker_to_compiler_argsr   writer   
Popen_safe
returncodeEnvironmentExceptionname_stringrun_sanity_check)r6   work_direnvironmentsnamecode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..00 (//44[G::5AA 	6ggll85+sW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k=(C 65s   I>>
Jc                ,    SnU R                  XSU5      $ )Nz.int main(void) { int class=0; return class; }
zsanitycheckc.c)r
  )r6   r   r   r   s       r?   sanity_checkCLikeCompiler.sanity_check8  s    @&&x>NPTUUrK   
extra_argsdependenciesc               4    U SU S3nU R                  XcUUS9$ )N
        #include <>r  compiles)r6   hnameprefixr   r  r  r   s          r?   check_headerCLikeCompiler.check_header<  s9     8 '}}T:*6  8 	8rK   F)r  r  disable_cachec          	     `    U SU SU SU S3nU R                  XsUU[        R                  US9$ )Nz;
        #ifdef __has_include
         #if !__has_include("z")
          #error "Header 'zG' could not be found"
         #endif
        #else
         #include <z>
        #endif)r  r  r   r  )r  r   
PREPROCESS)r6   r  r  r   r  r  r  r   s           r?   
has_headerCLikeCompiler.has_headerD  sb     8 #W % ' " 7  }}T:*6=M=X=Xhu  w 	wrK   c               @    U SU SU SU S3nU R                  XtUUS9$ )Nr  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   r  symbolr  r   r  r  ts           r?   has_header_symbolCLikeCompiler.has_header_symbolS  sT      '  H   }}Q
*6  8 	8rK   c                b   / n/ nU[         R                  L a^   UR                  R                  R	                  S5      nUR                  R                  R	                  S5      nX0R                  XV5      -  nUR                  R                  U R                  U R                  5      n[        U[        5      (       a  U/nU R                  U5      nX8-  nU[         R                  L a  UR                  U R                  U R                  S-   5      n	U	b!  X@R                  U	S   U R                   5      -  nUR                  R#                  U R                  U R                  5      n
XJ Vs/ s H  oU;  d  M
  UPM     sn-  nX0R%                  U5      -  nX44$ ! [        [        4 a     GN2f = fs  snf )Nb_vscrt	buildtype_ldr   )r   r   coredataoptstore	get_valueget_crt_compile_argsKeyErrorAttributeErrorget_external_argsfor_machinelanguager%   rV   remove_linkerlike_argslookup_binary_entryuse_linker_argsversionget_external_link_argsget_compiler_args_for_mode)r6   r   r   r  r  crt_valr'  sys_argscleaned_sys_argsld_valuesys_ld_argsxs               r?   r   &CLikeCompiler._get_basic_compiler_argsc  s   #(((
,,//99)DLL11;;KH	227FF
 <<11$2B2BDMMRh$$ zH
  66x@!#(((..t/?/?QVAVWH#--hqk4<<HH ,,==d>N>NPTP]P]^K BA0AaBBE0066|5 n- . Cs   AF '	F,4F,F)(F)c           	        Uc  / nO[         R                  " U5      n[         R                  " U Vs/ s H  n[        U5      (       a  U" U5      OUPM     sn5      nUc  / nO,[        U[        R
                  R                  5      (       d  U/nU R                  5       n/ nU H  nXhR                  5       -  nUR                  5       S:H  n	UR                  5        HX  n
U
R                  UR                  5       UR                  5       5       H#  nUR                  U R                  X5      5        M%     MZ     U[         R"                  L d  M  XxR%                  5       -  nM     U R'                  X5      u  pXl-  nX`R)                  U5      -  nXpR+                  U5       Vs/ s H  oS:w  d  M
  UPM     sn-  nU R+                  / 5      S/:X  a#  U/ :w  a  SU;  a  US/-  nU R-                  U5      nXb-   U-   nU$ s  snf s  snf )Nsystemz/link)r   listifycallabler%   collectionsabcIterableru   get_compile_argsget_include_typeget_include_dirsto_string_listget_source_dirget_build_dirextendr   r   r   get_link_argsr   get_compiler_check_argsr   r4   )r6   r   r  r  r   er  r  r   system_incdirr:   idircalalrt   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''),,S-?-?-A3CTCTCVWDLL!6!6t!KL X * ',,,**  ..s9--d33 	99"=N=g!=NN''+y8{wj8wi'
 ,,U3E!E)O 'Z8 Os   $G8	G=+G=c                :    U SU S3nU R                  XcUUS9S   $ )NzI
        #include <stddef.h>
        int main(void) { static int a[1-2*!(z)]; a[0]=0; return 0; }r  r   r  )r6   
expressionr  r   r  r  r"  s          r?   _compile_intCLikeCompiler._compile_int  sE      ..8\9QU }}Q
*6  889; 	;rK   c	                   [        U[        5      (       a  U R                  U SU 3XVXx5      (       a  U$ U R                  UR                  R
                  R                  ;   a   U R                  XXgUS5      u  pSU	 S3nUR                  R
                  R                  U R                     R                  X5      nU(       a]  UR                  (       aL  UR                  S:X  a<  U R                  U SUR                   3XVXx5      (       a  [        UR                  5      $ SnSn[        U[        5      (       a  [        U[        5      (       Gd   U R                  U S3XVXx5      (       at  S=p/U R                  U S	U 3XVXx5      (       aQ  US
-   nX-:  a  [        R                  " S5      e[        US-  S
-   U5      nU R                  U S	U 3XVXx5      (       a  MQ  UnOS=p?U R                  U SU 3XVXx5      (       aN  US
-
  nX>:  a  [        R                  " S5      e[        US-  U5      nU R                  U SU 3XVXx5      (       a  MN  UnOVX2:  a  [        R                  " S5      eU SU SU SU 3nU R                  UXVXx5      (       d  [        R                  " S5      eX#:w  a?  U[        X2-
  S-  5      -   nU R                  U SU 3XVXx5      (       a  UnOUS
-   nX#:w  a  M?  U$ ! [        R                   a     GNf = f)Nz == Fzz
                #include <stdio.h>
                #include <stdint.h>
                int main(void) { int expression = z'; printf("%d", expression); return 0; }r   ii   z >= 0z > r   zCross-compile check overflowedr   r"   z < z!high limit smaller than low limitz <= z && z >= zValue out of given range)r%   r   rY  r1  r)  r   build
get_defineruncompiledr   stdoutr   r   minmax)r6   rX  lowhighguessr  r   r  r  expanded_evaluate_expandedr^  maxintminintcur	conditions                    r?   cross_compute_intCLikeCompiler.cross_compute_int  s   
 eS!!  J<tE7!;V*cc ==CLL22888"ooj#S_afg)4 5=:=e%i! ll,,224==AEEFW]3<<CNNa,?((J<tCJJ<)H&Wapp"3::.
 #s##:dC+@+@  J<u!5vJ]]'':,c#(?jgg'C|&;;<\]]cAgk62C	 '':,c#(?jgg
 '':,c#(?jgg7D}&;;<\]]cAgv.C	 '':,c#(?jgg
  z334WXX%,d4&ZLSEJI$$YZVV334NOO kTZ1,--C  J<tC5!96
aaAg k 
O 00 s   $B;K+ +LL)r  c          
     "   Uc  / nU R                   (       a  U R                  XX4XVXx5      $ U SU S3n	U R                  XUUS9n
U
R                  (       d  gU
R                  S:w  a  [
        R                  " S5      e[        U
R                  5      $ )Nzr
        #include<stddef.h>
        #include<stdio.h>
        int main(void) {
            printf("%ld\n", (long)(z#));
            return 0;
        }r  r"   r   z&Could not run compute_int test binary.)	r   rm  r^  r_  r   r   r   r   r`  )r6   rX  rc  rd  re  r  r   r  r  r"  ress              r?   compute_intCLikeCompiler.compute_int  s     J==))*4U_nn % &0L 1	 hhq*$0  2||>>Q//0XYY3::rK   c          
         Uc  / nU SU S3nU R                  XcUUS9S   (       d  gU R                  SU S3S S S X#XE5      $ )NB
        #include <stddef.h>
        int main(void) {
            + something;
            return 0;
        }r  r   r"   zsizeof(rM   r  rm  r6   typenamer  r   r  r  r"  s          r?   cross_sizeofCLikeCompiler.cross_sizeof  sv     J  J  }}Q
*6  889;%%z&;T4v\fuurK   c               <   Uc  / nU R                   (       a  U R                  XX4US9nUS4$ U SU S3nU R                  XsUUS9nUR                  (       d  gUR                  S:w  a  [
        R                  " S5      e[        UR                  5      UR                  4$ )Nr  Fzy
        #include<stddef.h>
        #include<stdio.h>
        int main(void) {
            printf("%ld\n", (long)(sizeof(z$)));
            return 0;
        })r"   Fr   z!Could not run sizeof test binary.)
r   ry  
cached_runr_  r   r   r   r   r`  cached)	r6   rx  r  r   r  r  rr"  rp  s	            r?   sizeofCLikeCompiler.sizeof,  s     J==!!(C/; " =Ae8O , -5: 6	 ooa+7  9||>>Q//0STT3::

**rK   c          
         Uc  / nU SU S3nU R                  XcUUS9S   (       d  gU SU S3nU R                  SS S S XcXE5      $ )	Nrt  ru  r  r   r"   zR
        #include <stddef.h>
        struct tmp {
            char c;
            z target;
        };zoffsetof(struct tmp, target)rv  rw  s          r?   cross_alignmentCLikeCompiler.cross_alignmentD  s     J  J  }}Q
*6  889;  J 	 %%&DdDRVXY`jyyrK   c                  Uc  / nU R                   (       a  U R                  XX4US9nUS4$ U SU S3nU R                  XsUUS9nUR                  (       d  [        R
                  " S5      eUR                  S:w  a  [        R
                  " S5      e [        UR                  5      n	U	S:X  a  [        R
                  " SU S	35      eXR                  4$ ! [         a    [        R
                  " S5      ef = f)
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.r   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   rx  r  r   r  r  r~  r"  rp  aligns
             r?   	alignmentCLikeCompiler.alignmentZ  s'    J==$$Xs2> % @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 !C6c                n   SnSnSn	SU SU SU SU	 SU U U 3n
U R                  X4U[        R                  S	9R                  5       n[        R
                  " U R                  XR                  U[        R                  S
9nU(       a.  [        R
                  " U R                  X[        R                  S
9nU" 5        nUR                  nUR                  S:w  a  [        R                  " SU< 35      e S S S 5        WR                  R                  U5      nUR                  R                  U5      nUS:X  d  US:X  d  UU:X  a  [        R                   " S5      eUR                  U[#        U5      -   U nUU	:X  a  S nUW4$ U R%                  U5      R'                  5       nUW4$ ! , (       d  f       N= f)Nz#"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   r  r   r   zCould not get define r"   z,Delimiters not found in preprocessor output.)rU  r   r  r@   rb   partialcached_compiler)  compiler}  r   r   r   r`  findrfindMesonBugExceptionr1   _concatenate_string_literalsstrip)r6   dnamer  r   r  r  r  delim_start	delim_endsentinel_undefr   rt   funcpr}  star_idxend_idxdefine_values                     r?   r]  CLikeCompiler.get_define  s    =8	@		  .) *		eWYK+ &&s,<,G,G ' IIR 	  !4!4dLLUY`p`{`{|$$T\\4O_OjOjkDVqXXF||q 336KE94UVV !  88==-((..+N28w3F,,-[\\xx3{+; ;GD>)L
 V##  <<\JPPRLV##% Vs   >7F&&
F4c                   US:X  a  SnSnOUS:X  a  SnSnO[        SU< 35      eU SU S	U S
U S3n	U R                  XXVS9n
U
R                  (       d  [        R                  " SU S35      eUS:X  a  U
R
                  $ US:X  a$   [        U
R
                  R                  5       5      $  S5       e! [         a    [        R                  " SU S35      ef = f)N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   fnamertyper  r   r  r  fmtcastr   rp  s              r?   get_return_valueCLikeCompiler.get_return_value  s   
 HCDe^C$D #<UI!FGG8  U#dV1UG , hhtZhS||//2PQVPWWY0Z[[H::e^`3::++-.. 	$m#u  `336FugM]4^__`s   "B2 2%Cc                     Sn U S-  n SnX4$ )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} ();
        }}rQ   headmains     r?   _no_prototype_templ!CLikeCompiler._no_prototype_templ  s+     	  	 zrK   c                     Sn SnX4$ )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;
        }}rQ   r  s     r?   _have_prototype_templ#CLikeCompiler._have_prototype_templ  s     1

 zrK   c                  Uc  / nSU-   nUR                  SS5      nU R                  (       a\  UR                  R                  R	                  US5      nUb3  [        U[        5      (       a  US4$ [        R                  " SU S35      eX!S.nS	n	S
U;   a  U R                  5       u  pOU R                  5       u  pX-   U-   nU R                  UR                  " S0 UD6X4US9u  pU(       a  SU4$ U R                  5       S;   a  gS
U;  US'   UR                  S5      nXS'   U(       a  SOSUS'   SnU R                  UR                  " S0 UD6X4US9$ )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  rg  FzCross variable z is not a boolean.)r  r  z
        #if defined __stub_{func} || defined __stub___{func}
        fail fail fail this function is not going to work
        #endif
        z#includer  T>   msvcintel-clFF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;
        }}rQ   )replacer   
propertieshostgetr%   rS   r   r   r  r  linksformatget_idr0   )r6   funcnamer  r   r  r  varnamevalfargs
stubs_failr  r  templrp  r}  r  r"  s                    r?   has_functionCLikeCompiler.has_function  s    J "H,//#s+==..%%))'48Cc4((:%33ogYN`4abb BH6Z
 335JD$113JD!D(jj!6!6.: ! << ;;=00  *7m((6
(l$.bLl. zz!((+U+S'3  5 	5rK   c               t    Uc  / nSR                  S U 5       5      nU SU SU S3nU R                  XUUS9$ )Nr   c              3  .   #    U  H  nS U S3v   M     g7f)z(void) ( foo.z );
NrQ   ).0members     r?   	<genexpr>,CLikeCompiler.has_members.<locals>.<genexpr>i  s     RkFM&7ks   z&
        void bar(void) {
            z foo;
            z"
            (void) foo;
        }r  )r   r  )	r6   rx  membernamesr  r   r  r  membersr"  s	            r?   has_membersCLikeCompiler.has_membersb  sg     J''RkRR J I  }}Q
*6  8 	8rK   c               4    U SU S3nU R                  XcUUS9$ )Nz4
        void bar(void) {
            (void) sizeof(z);
        }r  r  rw  s          r?   has_typeCLikeCompiler.has_types  s>      #* % }}Q
*6  8 	8rK   c                
   SnSUR                  5       -   S-   nU R                  [        R                  5      nSnU R	                  X1U[        R                  SS9 nUR
                  S:w  a  [        SU< S	UR                   35      e[        R                  R                  UR                  5      (       d  [        S
U< S35      e[        UR                  S5       nU Ha  nSU-   U;   a(  [        R                  " S5          SSS5        SSS5        gX(;   d  M;  [        R                  " S5          SSS5        SSS5        g   SSS5        SSS5        [        SU< S35      e! , (       d  f       N&= f! , (       d  f       N/= f)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)r  r   want_outputr   z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)decoderN  r   r   _build_wrapperr   RuntimeErrorstderrrF   rG   r   output_namer   r   r   )	r6   r   symbol_namer   rt   nr  olines	            r?   r  7CLikeCompiler._symbols_have_underscore_prefix_searchbin}  se   
 - %%'(+ ++,<,D,DE7  tBRBZBZhl mqr||q "%<QE!((#TUU77>>!--00"%MaURX#YZZammT*aD k)T1

#^_# + nm %,

#bc$ + nm  + n  U1%'RSTT +* nmsC   BE4&E#E4E#E#0E4E#E4#
E1	-E44
Fc                   SnSU S3nU R                  X1[        R                  SS9 nUR                  S:w  a  [	        SUR
                   35      eUR
                  R                  U5      S   R                  5       n[        R                  " S	U< S
35        US:X  a
   SSS5        gUS:X  a
   SSS5        g SSS5        g! , (       d  f       g= f)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  r   zHBUG: Unable to preprocess _symbols_have_underscore_prefix_define check: r"   z@Queried compiler for function prefix: __USER_LABEL_PREFIX__ is ""rg  NTr   )
r  r   r  r   r  r`  	partitionrstripr   r   )r6   r   delimr   r  symbol_prefixs         r?   &_symbols_have_underscore_prefix_define4CLikeCompiler._symbols_have_underscore_prefix_define  s     5	 
 	   1A1L1LZ_ `de||q "%mnonvnvmw#xyyHH..u5b9@@BMJJYZgYjjklm# a` "$ a`  a``s   A7C(C8C
Cc                    UR                   U R                     nUR                  5       (       a  gUR                  5       (       d  UR	                  5       (       a  UR
                  S:H  $ g)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)machinesr0  	is_darwin
is_windows	is_cygwin
cpu_family)r6   r   ms      r?   $_symbols_have_underscore_prefix_list2CLikeCompiler._symbols_have_underscore_prefix_list  sM     LL))*;;==<<>>Q[[]]<<5((rK   c                |    U R                  U5      nUb  U$ U R                  U5      nUb  U$ U R                  U5      $ )zB
Check if the compiler prefixes an underscore to global C symbols
)r  r  r  )r6   r   results      r?   symbols_have_underscore_prefix,CLikeCompiler.symbols_have_underscore_prefix  sO    
 <<SAM ::3?M ==cBBrK   c                    / nU H#  nU H  nUR                  US-   U-   5        M     M%     U(       aI  UR                  U R                     R                  5       (       a  U H  nUR                  US-   5        M     U$ )Nz{}.z{}.so.[0-9]*.[0-9]*)r   r  r0  
is_openbsd)r6   r   prefixessuffixessharedpatternsr  ss           r?   _get_patternsCLikeCompiler._get_patterns  st     "AE	A.   cll4#3#34??AA $9 9: rK   c                `   S/nU(       a  [        U [        5      (       d  S/nOSS/nUR                  U R                     R	                  5       (       a  SS/nOUR                  U R                     R                  5       (       a$  [        U [        5      (       a  S/nO/ SQnUS/-  nOaUR                  U R                     R                  5       (       a  SS/nS	/U-   nO*U R                  R                  5       S
;   a	  SS/nSS/nOS/nU[        R                  L aN  U R                  XUS5      nUR                  U R                  XUS5       Vs/ s H  oU;  d  M
  UPM     sn5        OU[        R                  L aN  U R                  XUS5      nUR                  U R                  XUS5       Vs/ s H  oU;  d  M
  UPM     sn5        OOU[        R                  L a  U R                  XUS5      nO(U[        R                  L d   eU R                  XUS5      n[!        U5      $ s  snf s  snf )zO
Get library prefixes and suffixes for the target platform ordered by
priority
alibr   dylibso)dll.ar  dllr  r  cyg>   tic2000c6000TF)r%   r   r  r0  r  r  r  idlowerr   PREFER_SHAREDr   rL  PREFER_STATICSHAREDSTATICtuple)	r6   r   libtypestrictstlibextr  shlibextr  r=  s	            r?   get_library_naming CLikeCompiler.get_library_naming  s   
 5
 *T+CDDwHr{H<<(()3355H\\$**+6688 $ 899!72H\\$**+5577w'Hw)HWW]]_ 88U|Ht}H vHg+++))#4HHOO(:(:3(TY(Zp(Z1go^oQ(Zpq---))#5IHOO(:(:3(TX(Yo(Y1fn]nQ(Yop&))#4HHgnn,,,))#5IHX q ps   	H&H&1	H+>H+c                   S
S jn/ nU  HZ  nUR                  SSS9n[        U5      S:w  a  M$   [        S US   R                  S5       5       5        UR                  U5        M\     [        X!SS	9$ ! [         a     Mu  f = f)Nc                j    U R                  SSS9S   n[        S UR                  S5       5       5      $ )N.so.r   maxsplitc              3  8   #    U  H  n[        U5      v   M     g 7frE   r   r  r:   s     r?   r  HCLikeCompiler._sort_shlibs_openbsd.<locals>.tuple_key.<locals>.<genexpr>&  s     8AQ   r   )r   r  split)r=  vers     r?   	tuple_key5CLikeCompiler._sort_shlibs_openbsd.<locals>.tuple_key$  s2    ((6A(.q1C83888rK   r  r   r  r   c              3  8   #    U  H  n[        U5      v   M     g 7frE   r   r!  s     r?   r  5CLikeCompiler._sort_shlibs_openbsd.<locals>.<genexpr>/  s     8&7c!ff&7r#  r   T)keyreverse)r=  rV   rT   zT.Tuple[int, ...])r   r1   r  r$  r  r   sorted)libsr&  filteredr  rets        r?   _sort_shlibs_openbsd"CLikeCompiler._sort_shlibs_openbsd"  s    	9 !#C**Va*0C3x1}8c!fll3&788 OOC   ht<<  s   $A22
B ?B c                    [         R                  R                  X!R                  U5      5      nSU;   a%  U R	                  [
        R
                  " U5      5      $ U/$ )N*)rF   rG   r   r  r0  glob)clspattern	directorylibnamer   s        r?   _get_trials_from_pattern&CLikeCompiler._get_trials_from_pattern5  sF    GGLLNN7$;<'> ++DIIaL99s
rK   c           	        U GH  n[         R                  R                  U5      (       d  M*  U R                  R                  R                  5       (       a  U R                  R                  R                  5       (       a  [        R                  " U5      nU(       a$  U R                  R                  R                  U;  a?  [        R                  " SU SU SU R                  R                  R                   35        M  [        U5      s  $    g)z
We just check whether the library exists. We can't do a link check
because the library might have unresolved symbols that require other
libraries. On macOS we check if the library matches our target
architecture.
z	Rejected z, supports z
 but need N)rF   rG   r   r  r  r  r\  r   darwin_get_object_archsr  r   r   r   )r   pathsr  archss       r?   _get_file_from_list!CLikeCompiler._get_file_from_list?  s     Aww~~a  <<$$..00S\\5G5G5Q5Q5S5S$<<Q?E CLL$5$5$@$@$M

YqcUG:cllN_N_NjNjMk#lm Aw  rK   c                4    U R                  SSU5      S   S:H  $ )z@
returns true if the output produced is 64-bit, false if 32-bit
zvoid *r   r   r$   )r  r   s     r?   output_is_64bitCLikeCompiler.output_is_64bitU  s!    
 {{8R-a0A55rK   c                |   U(       d  U[         R                  L d  XR                  ;   ae  SU-   /nU R                  5       U R	                  5       -   n	XR                  U	5      -   n
U R                  XBU
SS9S   (       a  U$ XR                  ;   a  g U R                  X%5      n U R                  U5      (       a  SnOSn [        R                  " X7(       a  / OU R                  X,5      5       H  nU H  nU R                  XU5      nU(       d  M  U R!                  X/5      nU(       d  M8  UR#                  S5      (       aB  UR$                  R#                  U5      (       a"  U(       a  [&        R(                  " SU< S	35        UR+                  5       /s  s  $    M     g ! [        R                  [        4 a    Sn Nf = f)
Nr   Tr  r  r   r   r   r  zfind_library(z>) starting in "lib" only works by accident and is not portable)r   r  internal_libsget_linker_always_argsget_allow_undefined_link_argsr   r  r  rB  r   MesonExceptionr-  	itertoolschainr   r9  r?  r0   r   r   warningas_posix)r6   r8  r   
extra_dirsr   r  lib_prefix_warningignore_system_dirsr  r  r  r  r   r   r  trialstrials                    r?   _find_library_real CLikeCompiler._find_library_real\  s    7+@+@ @---G^$E//1D4V4V4XXE!=!=e!DDJzz$
$zOPQR,,, **38	##C((		 3ER4K`K`adKpqA66qWE00=%%e,,1F1Fw1O1OTfLL=;y!z{())  r  ''2 	I	s   !F :F F;:F;c           	     D   XR                   ;   a  / $ [        U[        5      (       a  U/n[        U R                  5      U[        U5      XEU4nXR
                  ;  a#  U R                  XX4XVU5      n	XR
                  U'   OU R
                  U   n	U	c  g U	R                  5       $ rE   )ignore_libsr%   rV   r  r   ri   rS  r(   )
r6   r8  r   rN  r   r  rO  rP  r*  values
             r?   _find_library_impl CLikeCompiler._find_library_impl  s     &&&Ij#&&$JT\\"GU:->Oab---++G*Gi{|E+0##C(++C0E=zz|rK   Tc           	     .    SnU R                  XX7XEU5      $ Nzint main(void) { return 0; }
)rX  )r6   r8  r   rN  r  rO  rP  r   s           r?   find_libraryCLikeCompiler.find_library  s    /&&wZwdvwwrK   c                j   U R                   S:w  a  [        R                  " S5      eU R                  SS9/ SQ-   nX R	                  5       -  nX!R
                  R                  U R                  U R                  5      -  n[        R                  " SSR                  U5      S5        [        R                  R                  5       nS	US
'   [        R                  " X#[         R"                  S9u    pE/ nUR%                  S5       H-  nSU;  a  M  UR'                  USS R)                  5       5        M/     U$ )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)ccache)z-vr   -z#Finding framework path by running: r  
CLC_ALL)r   stdinz(framework directory)Ni)r  r   rI  get_exelistr|   r)  r/  r0  r1  r   r   r   rF   environr(   r   
subprocessPIPEr$  r   r  )r6   r   commandsos_envrg  r	  r=  r  s           r?   find_framework_paths"CLikeCompiler.find_framework_paths  s    77g))*^__##5#14EE((**LL2243C3CT]]SS

8#((8:LdS"x((Z__U
1JJt$D&d2 LLds))+, % rK   c                    Sn/ nU H  nUSU-   /-  nM     U(       a  / OSS/nUSU/-  nU R                  XRX-   SS9S   (       a  U$ g )	Nzint main(void) { return 0; }z-Fz-Zz
-L/usr/libz
-frameworkTrE  r   )r  )	r6   r   r   rN  allow_systemr   	link_argsr   r  s	            r?   _find_framework_real"CLikeCompiler._find_framework_real  sj    -!#	A$(#I  (RdL-A
lD))	::dZ-CTX:YZ[\rK   c                   [        U[        5      (       a  U/n[        U R                  5      U[        U5      U4nXPR                  ;   a  U R                  U   nO U R                  XX45      nX`R                  U'   Uc  g UR                  5       $ rE   )r%   rV   r  r   rj   rq  r(   )r6   r   r   rN  ro  r*  rW  s          r?   _find_framework_impl"CLikeCompiler._find_framework_impl  s    j#&&$JT\\"D%
*;\J+++--c2E--dRE-2%%c*=zz|rK   c                &    U R                  XX45      $ )z
Finds the framework with the specified name, and returns link args for
the same or returns None when the framework is not found.
)rt  )r6   r   r   rN  ro  s        r?   find_frameworkCLikeCompiler.find_framework  s     ((JMMrK   c                    / $ rE   rQ   r6   r8  r'  s      r?   r,  "CLikeCompiler.get_crt_compile_args      	rK   c                    / $ rE   rQ   rz  s      r?   get_crt_link_argsCLikeCompiler.get_crt_link_args  r|  rK   c                    UR                   U R                     nUR                  5       (       d  UR                  5       (       a  / $ S/$ )Nr    )r  r0  is_haikur  )r6   r   host_ms      r?   thread_flagsCLikeCompiler.thread_flags  s>    d../?? 0 0 2 2I|rK   c                "    UR                  5       $ rE   )r(   rs   s     r?   r   %CLikeCompiler.linker_to_compiler_args  s    yy{rK   c                "    U R                  X2XS9$ )Nr  r  )r6   rt   r   r   r   s        r?   has_argumentsCLikeCompiler.has_arguments  s    }}T4}CCrK   c                   / nU H  nUR                  S5      (       aO  UR                  S5      (       a  O8US;   a  UR                  SUSS  -   S-   5        OUR                  SUSS  -   5        UR                  S5      (       a  [        R                  " U S35        UR                  U5        M     U R	                  XBU[
        R                  S	9$ )
Nz-Wno-z-Wno-attributes=>   -Wno-stack-usage-Wno-vla-larger-than-Wno-frame-larger-than-Wno-alloca-larger-than-Wno-alloc-size-larger-thanz-Wr   z=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  )r0   r   r   rL  r  r   r   )r6   rt   r   r   new_argsrI   s         r?   _has_multi_arguments"CLikeCompiler._has_multi_arguments  s     "C ~~g&&
 >>"455 5 5 OOD3qr7NW$<=OOD3qr7N3~~f%%u %I I J OOC ; < !!(<L<T<T!UUrK   c                &    U R                  XS5      $ )Nzextern int i;
int i;
)r  r6   rt   r   s      r?   has_multi_arguments!CLikeCompiler.has_multi_arguments  s    ((4MNNrK   c                    U R                   R                  5       U-   nU R                  U5      nU R                  XU[        R
                  S9$ )Nr  )r)   fatal_warningsr   r  r   r   )r6   rt   r   r   s       r?   _has_multi_link_arguments'CLikeCompiler._has_multi_link_arguments  sJ     {{))+d2++D1!!$T8H8M8M!NNrK   c                &    U R                  XS5      $ r[  )r  r  s      r?   has_multi_link_arguments&CLikeCompiler.has_multi_link_arguments   s    --d9YZZrK   c                    [         R                  " S5      nU nUR                  U5      nU(       a=  SR                  UR	                  SSSS5      5      nUR                  U5      nU(       a  M=  U$ )NzV(?P<pre>.*([^\\]")|^")(?P<str1>([^\\"]|\\.)*)"\s+"(?P<str2>([^\\"]|\\.)*)(?P<post>".*)r   prestr1str2post)rer  matchr   group)r  r6  r/  r  s       r?   r  *CLikeCompiler._concatenate_string_literals#  s`    **vwMM#''!''%@ACc"A a 
rK   c                    S/$ r   rQ   r   s     r?   !get_has_func_attribute_extra_args/CLikeCompiler.get_has_func_attribute_extra_args-  s     {rK   c                    UR                   U R                     nUR                  5       (       d  UR                  5       (       d  US;   a  gU R	                  U R                  U5      UU R                  U5      S9$ )N>   	dllexport	dllimportr  )r  )r  r0  r  r  r  attribute_check_funcr  )r6   r   r   r  s       r?   has_func_attribute CLikeCompiler.has_func_attribute3  sn     LL))*!++--11#}}T66t<c(,(N(Nt(T  V 	VrK   c                    U(       a  S/$ / $ )Nz-DNDEBUGrQ   )r6   disabler   s      r?   get_assert_argsCLikeCompiler.get_assert_args>  s    <	rK   rB   c                D   > U R                   S:X  a  g[        TU ]	  U5      $ )NPREPROCESSORT)r   supercan_compile)r6   src	__class__s     r?   r  CLikeCompiler.can_compileC  s$     99&w"3''rK   c                6   U R                   (       d}  [        R                  " U 5      U l         U R                  U R                  5       -   U R                   l        SU R                   l        U R
                  R                  U R                   5        U R                   $ )Nr  )ro   r(   r   get_preprocess_to_file_argsr   modesr   rN   s    r?   get_preprocessorCLikeCompiler.get_preprocessorJ  sm       $		$D(,t7W7W7Y(YD%%3D"JJd//0   rK   )ro   )rT   NonerE   )rt   zT.Optional[T.Iterable[str]]rT   r   )rT   rS   )rT   rU   )r   rV   rT   rU   rW   )r   rV   rT   rU   )rG   rV   r   rS   rT   rU   )r   'Environment'r   rV   rT   rU   )r   r  r   T.Optional[int]rT   'ImmutableListProtocol[str]')r   r  r   r  rT   rU   )r   r  rT   r  )r   r  rT   rU   )r   rV   r   rV   rT   rU   )r   rV   rT   rV   )r   rV   rT   rU   )
r   rV   r   r  r   rV   r   rV   rT   r  )r   rV   r   r  rT   r  )r  rV   r  rV   r   r  r  IT.Union[None, T.List[str], T.Callable[['CompileCheckMode'], T.List[str]]]r   T.Optional[T.List['Dependency']]rT   T.Tuple[bool, bool])r  rV   r  rV   r   r  r  r  r  r  r  rS   rT   r  )r  rV   r!  rV   r  rV   r   r  r  GT.Union[None, T.List[str], T.Callable[[CompileCheckMode], T.List[str]]]r  r  rT   r  )r   r  r   r   rT   z!T.Tuple[T.List[str], T.List[str]])
r   r  r  z]T.Union[None, arglist.CompilerArgs, T.List[str], T.Callable[[CompileCheckMode], T.List[str]]]r  r  r   r   rT   zarglist.CompilerArgs)rX  rV   r  rV   r   r  r  r  r  r  rT   rS   )NN)rX  rV   rc  r  rd  r  re  r  r  rV   r   r  r  r  r  r  rT   r   )rx  rV   r  rV   r   r  r  r  r  r  rT   r   )rx  rV   r  rV   r   r  r  r  r  r  rT   T.Tuple[int, bool])rx  rV   r  rV   r   r  r  T.Optional[T.List[str]]r  r  rT   r   )rx  rV   r  rV   r   r  r  r  r  r  rT   r  rR   )r  rV   r  rV   r   r  r  AT.Union[T.List[str], T.Callable[[CompileCheckMode], T.List[str]]]r  r  r  rS   rT   zT.Tuple[str, bool])r  rV   r  rV   r  rV   r   r  r  r  r  r  rT   zT.Union[str, int])rT   zT.Tuple[str, str])r  rV   r  rV   r   r  r  r  r  r  rT   r  )rx  rV   r  rU   r  rV   r   r  r  r  r  r  rT   r  )rx  rV   r  rV   r   r  r  r  r  r  rT   r  )r   r  rT   rS   )r   r  rT   zT.Optional[bool])
r   r  r  rU   r  rU   r  rS   rT   rU   )r   r  r  r   r  rS   rT   zT.Tuple[str, ...])r-  rU   rT   rU   )r6  rV   r7  rV   r8  rV   rT   rU   )r   r   r=  rU   rT   zT.Optional[Path])r8  rV   r   r  rN  rU   r   rV   r  r   rO  rS   rP  rS   rT   r  )r8  rV   r   r  rN  rU   r  r   rO  rS   rP  rS   rT   r  )
r   rV   r   r  rN  rU   ro  rS   rT   r  )T)r8  rV   r'  rV   rT   rU   )rt   rU   rT   rU   )
rt   rU   r   r  r   rV   r   r   rT   r  )rt   rU   r   r  r   rV   rT   r  )rt   rU   r   r  rT   r  )r  rV   rT   rV   )r   rV   rT   rU   )r   rV   r   r  rT   r  )r  rS   r   r  rT   rU   )r  z'mesonlib.FileOrString'rT   rS   )rT   r   )frX   rY   rZ   r[   __doc__TTYPE_CHECKINGrh   __annotations__ri   rj   r   UNIXY_COMPILER_INTERNAL_LIBSrF  rp   ru   rx   r|   r   r   r   r   r   r   r   r   r   r   r   rb   rc   r   r   r   r   r   r   r   r.   r   r   r
  r  r  r  r#  r   r   r   rU  rY  rm  rq  ry  r  r  r  r]  r  ra   r  r  r  r  r  r  r  r  r  r   r  r0  classmethodr9  r?  rB  rS  rX  r   r  r\  rl  rq  rt  rw  r,  r~  r  r   r  r  r  r  r  r  r  r  r  r  r  rd   __classcell__)r  s   @r?   rf   rf   {   s2   2.0	+0 CE  Evxsx88M7-)%" 7;%%4%@\% %P 7;=$3=?J= 7 726D4;'D"%'D-0'D59'DRV
 nrFJ8!j8#C8Ob8 lpDH).whw!Aw #'w 4Gw" quKO8,8&m8 )I8 Uh8 &V 5E4L4L1 (E1)I1 "21 Rf1f;!h;#C;HL; quKO<!0<:=<DQ<&m< )I< UX<B FJ*47>K g #C OR0 lpFJv!hv#CvORv" fj@D+b+=+I[+2 ?CIMz$;z&FzRUz. 9=CG%!5%! @%!L^%!T */$$`$$!A$$ #'$$ 4F$$L$+$9P$'G$L]$>    D  * <@FJb5!8b5#Cb5Obb5L koEI88&38 g8 #C8 Ob8& CG8^8?8K^8 UD<C&"0d = =$    * 6 6*X!$/6LPfj pG$ )0(=(=Z^  |Ax%xSWxtxx F]x
6+/4K -1N%)N5LND,D1DD VDOO[  	V
 &( '(! !rK   rf   )+
__future__r   rC  rb   r4  rJ  rF   r  rh  r(   typingr  pathlibr   r   r   r   r   linkers.linkersr	   r
   r   r   r   r   visualstudior   r  r  r   _typingr   r   r   compilers.compilersr   objectr  Xr+   CompilerArgsr   rf   rQ   rK   r?   <module>r     s    #     	 	        e e   ( 2??*0*/ Hjj %&(dd,FL,, FLRU!H U!rK   