
    <h                       % 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JrJ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JrJrJr  SS
KJr  SSKJr  \
R:                  (       aI  SSKJr  SSKJ r J!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*  SSKJ+r+  SSK,J-r-  \
R\                  " SSS9r/\
R\                  " S5      r0 1 Skr11 Skr21 Skr30 SS_SS_S S!_S"S#_S$S%_S&S'_S(S)_S*S+_S,S-_S.S/_S0S1_S2S3_S4S5_S6S7_S8S9_S:S;_r4S<\5S='   \4Rm                  5       r7S>1r8\9" \4S   5      \8-  r:\9" \4S   5      \8-  r;1 S?kr<S@1r=\9" \R|                  " / \4R                  5       Q\<P\=P\8P76 5      r@\@\1-
  rASArBSB\B-   rC\D" \R|                  " SC \4R                  5        5       6 5      rF1 SDkrG1 SEkrH\R                  " SF5      rJSGSHSISJSKSLSMSNSOSPSQSR.rKSS\5ST'   SSU jrLSSV jrMSSW jrN\" SSX9SSY j5       rOSSZ jrPSS[ jrQSS\ jrRSS] jrSSS^ jrT\" SSX9SS_ j5       rUSS` jrVSSa jrWSSb jrX " Sc Sd\R                  5      rZ/ SeQr[/ SfQr\/ / / Sg/Sh/Si/Sj/Sk.r]Sl\5Sm'   / Sn/So.r^Sp\5Sq'           SSr jr_SSs jr`SSt jraSSu jrbSSv jrc      SSw jrd " Sx Sy\5      re\ " Sz S{\5      5       rf\ " S| S}\5      5       rg " S~ S\\R                  S9rig)    )annotationsN)	dataclassfield)	lru_cache   )mlog)mesonlib)options)HoldableObjectEnvironmentExceptionMesonExceptionPopen_safe_loggedLibTypeTemporaryDirectoryWinProof)	OptionKeyCompilerArgs)coredata)BuildTarget	DFeatures)MutableKeyedOptionDictType)MachineInfo)Environment)RSPFileSyntax)DynamicLinker)MachineChoice)
DependencyCompilerTypeCompiler)bound_T>   Hhdihhhpphxxippmocpxdpxivapi>   oobjres>   ajssodlllibdylibdll.ac)r7   cpp)r8   cppmcccpcxxzc++r%   hpr&   r(   r'   zh++inoixxCPPCHPPr"   cuda)cufortran)f90f95f03f08fforftnfppd)rN   r$   objc)mobjcpp)mmrust)rsvala)rU   r,   gscs)rW   swift)rX   java)rY   cython)pyxnasm)asmr\   masm)r^   	linearasm)saz!T.Mapping[str, T.Tuple[str, ...]]lang_suffixesr#   >   Sssxr]   r^   ll)rQ   r8   rO   r7   r\   rE   )rS   rN   rC   c              #  X   #    U  H  u  pU Vs/ s H  o3U4PM     snv   M     g s  snf 7fN ).0langvsuffixs       /mnt/mint/home/seanl/mnt/public/Repos/ladybird/Build/vcpkg/downloads/tools/meson-1.9.0-d1fcc2/mesonbuild/compilers/compilers.py	<genexpr>rn   Y   s+      (K4I!$!d^!$4I$s   *%*>   r7   rN   r8   rC   rO   rQ   rE   >   r7   r8   rO   rQ   z(.*\.so(\.[0-9]+)?(\.[0-9]+)?(\.[0-9]+)?$CFLAGSCXXFLAGSCUFLAGS	OBJCFLAGSOBJCXXFLAGSFFLAGSDFLAGS	VALAFLAGS	RUSTFLAGSCYTHONFLAGSCSFLAGS)r7   r8   rC   rO   rQ   rE   rN   rU   rS   rZ   rW   zT.Mapping[str, str]CFLAGS_MAPPINGc                D    U [         ;  a  g[         R                  U 5      * $ )a  
Sorting function to sort the list of languages according to
reversed(compilers.clink_langs) and append the unknown langs in the end.
The purpose is to prefer C over C++ for files that can be compiled by
both such as assembly, C, etc. Also applies to ObjC, ObjC++, etc.
   )clink_langsindex)rj   s    rm   
sort_clinkr   s   s#     ;d###    c                    [        U [        R                  5      (       a  U R                  n U R	                  S5      S   nU[
        ;   $ N.)
isinstancer	   Filefnamesplitheader_suffixesr   rl   s     rm   	is_headerr   ~   s:    %''[[b!F_$$r   c                    U [         ;   $ rg   )source_suffixes)rl   s    rm   is_source_suffixr      s    _$$r   maxsizec                \    U R                  S5      S   R                  5       n[        U5      $ r   )r   lowerr   r   s     rm   cached_is_source_by_namer      s)    [[b!'')FF##r   c                n    [        U [        R                  5      (       a  U R                  n [	        U 5      $ rg   )r   r	   r   r   r   r   s    rm   	is_sourcer      '    %''#E**r   c                    [        U [        R                  5      (       a  U R                  n U R	                  S5      S   nU[
        ;   $ r   )r   r	   r   r   r   assembler_suffixesr   s     rm   is_assemblyr      s;    %''[[b!F'''r   c                    [        U [        R                  5      (       a  U R                  n U R	                  S5      S   nU[
        S   ;   $ )Nr   r   rY   )r   r	   r   r   r   ra   r   s     rm   is_javar      s?    %''[[b!F]6***r   c                .    U R                  S5      (       + $ )Nz.rs)endswithr   s    rm   is_separate_compiler      s    ~~e$$$r   c                    [        U [        R                  5      (       a  U R                  n U R	                  S5      S   nU[
        ;   $ r   )r   r	   r   r   r   llvm_ir_suffixesr   s     rm   
is_llvm_irr      s;    %''[[b!F%%%r   c                <    U R                  S5      S   nU[        ;   $ r   )r   obj_suffixesr   s     rm   cached_is_object_by_namer      s     [[b!F\!!r   c                n    [        U [        R                  5      (       a  U R                  n [	        U 5      $ rg   )r   r	   r   r   r   r   s    rm   	is_objectr      r   r   c                    [        U [        R                  5      (       a  U R                  n [        R                  U 5      (       a  gU R                  S5      S   nU[        ;   $ )NTr   r   )r   r	   r   r   soregexmatchr   lib_suffixesr   s     rm   
is_libraryr      sL    %''}}U[[b!F\!!r   c                    [        U [        R                  5      (       a  U R                  n U R	                  S5      S   nU[
        ;   $ r   )r   r	   r   r   r   all_suffixesr   s     rm   is_known_suffixr      s:    %''[[b!F\!!r   c                       \ rS rSrSrSrSrSrg)CompileCheckMode   
preprocesscompilelinkrh   N)__name__
__module____qualname____firstlineno__
PREPROCESSCOMPILELINK__static_attributes__rh   r   rm   r   r      s    JGDr   r   )
z
-lkernel32z-luser32z-lgdi32z
-lwinspoolz	-lshell32z-lole32z
-loleaut32z-luuidz
-lcomdlg32z
-ladvapi32)
zkernel32.libz
user32.libz	gdi32.libzwinspool.libzshell32.libz	ole32.libzoleaut32.libzuuid.libzcomdlg32.libzadvapi32.libz-O1z-O2z-O3z-Os)plain0g123rc   T.Dict[str, T.List[str]]clike_optimization_argsz-g)FTzT.Dict[bool, T.List[str]]clike_debug_argsc                    [        U[        5      (       a  [        U5      n X0;  a  gUR                  R	                  X5      n[        U[
        5      (       d   S5       eU$ ! [         a     gf = f)NFzmust return bool)r   strr   r   get_option_for_targetboolKeyError)boptionstargetenvoptionrets        rm   option_enabledr      sm     &#6"!ll00@#t$$8&88$
 s   A! 8A! !
A.-A.c                     U R                   R                  X5      n[	        U[        U5      5      (       d!   S[        U5      < S[        U5      < 35       eU$ ! [        [        4 a    Us $ f = f)z2Get the value of an option, or the fallback value.zShould have z	 but was )r   r   r   AttributeErrorr   type)r   r   optfallbackrk   s        rm   get_option_value_for_targetr      ss    LL..v; ah((_Lh8J)TXYZT[S^*__(H n% s   A A/.A/c                    UR                   R                  U S5      S:H  =(       dE    UR                   R                  U S5      S:H  =(       a    UR                   R                  U S5      S;   $ )zShould debug assertions be disabled

:param target: a target to check for
:param env: the environment
:return: whether to disable assertions or not
b_ndebugtrue
if-release	buildtype>   r   release)r   r   )r   r   s     rm   are_asserts_disabledr      sb     LL..vzBfL ^\\//
C|S ]\\//DH\\_r   c                @   [        SU 5      nUR                  R                  R                  U5      S:H  =(       dd    UR                  R                  R                  U5      S:H  =(       a5    UR                  R                  R                  UR	                  SS95      S;   $ )Nr   r   r   r   )name>   r   r   )r   r   optstoreget_value_forevolve)
subprojectr   keys      rm   #are_asserts_disabled_for_subprojectr     s    
J

+CLL!!//4> h\\""005E g\\""001MNRffir   c                   / n UR                   R                  U S5      (       aK  [        X [        S5      S5      n[        X [        S5      S5      nUR	                  UR                  UUS95         UR                   R                  U S5      n[        U[        5      (       d   eX1R                  U5      -  n UR                   R                  U S5      n[        U[        5      (       d   eUS	/:X  a  / nUR                  U5      nU(       aI  UR                  X5      S   (       d  [        S
UR                  5        SU 35      eUR	                  U5         UR                   R                  U S5      n	U	S:X  a   UR	                  UR!                  5       5        O%U	S:X  a  UR	                  UR#                  5       5         UR                   R                  U S5      (       a  X1R%                  5       -  n X1R'                  [)        X5      U5      -  n[+        UR,                  XS5      (       a  UR/                  S5         UR                   R                  U S5      n
[        U
[        5      (       d   eUR                   R                  U S5      n[        U[        5      (       d   e X1R1                  X5      -  nU$ ! [        [        4 a     GN\f = f! [         a     GN&f = f! [         a     GNf = f! [        [        4 a     GNHf = f! [        [        4 a     GN+f = f! [         a     GNf = f! [         a     U$ f = f! [         a     U$ f = f)Nb_ltob_lto_threadsr   
b_lto_modedefaultthreadsmode
b_colorout
b_sanitizenonez	Compiler & does not support sanitizer arguments b_pgogenerateuse
b_coverage	b_bitcodez-fembed-bitcodeb_vscrtr   )r   r   r   r   extendget_lto_compile_argsr   r   r   r   get_colorout_argslistsanitizer_compile_argshas_multi_argumentsr   name_stringget_profile_generate_argsget_profile_use_argsget_coverage_argsget_assert_argsr   r   base_optionsappendget_crt_compile_args)r   compilerr   argsnum_threadsltomodeclroutsanitizesanitize_argspgo_valcrt_valr   s               rm   get_base_compile_argsr    s5   D<<--fg>>5c9_C]_`aK1#y?VXabGKK55# 6  
33FLI&#&&&&**622<<55flK(D))))xH 77A //CAF$y1E1E1G0HHno|n}%~KK&,,44VWEj KK::<=KK5578<<--flCC..00D(()=f)JCPP h++V+FF%&
,,44VYG'3''''LL66v{K	)S))))	11'EED
 Kk n%      n% 
 n%     	 K		 Ks   A,J9 1AK 8BK! AK2 %K2 >3L	 2L  =A&M $L1 9KK
KK!
K/.K/2LL	LL 
L.-L.1
L?;M >L??M 
MMc                	   / nUR                  5       n UR                  R                  U S5      (       a  UR                  R                  U S5      (       a  UR                  UR	                  5       5        S n[        S5      n[        X US5      (       a=  [        X [        S5      S5      nUS:X  a!  [        R                  R                  USS5      n[        X [        S	5      S
5      n[        X [        S5      S5      nUR                  UR                  UUUS95         UR                  R                  U S5      n	[        U	[        5      (       d   eU	S/:X  a  / n	UR                  U	5      n
U
(       aI  UR!                  X5      S
   (       d  [#        SUR%                  5        SU
 35      eUR                  U
5         UR                  R                  U S5      nUS:X  a   UR                  UR'                  5       5        O%US:X  a  UR                  UR)                  5       5         UR                  R                  U S5      (       a  X1R+                  5       -  n[-        UR.                  XS5      n[-        UR.                  XS5      nU(       a0  U R0                  S:X  d   UR                  UR3                  5       5        O&U(       a  UR                  UR5                  5       5        U(       d  SSKJn  UR                  UR;                  5       5        [        X5      (       d<  [-        UR.                  XS5      (       a   UR                  UR=                  5       5        OUR                  UR?                  5       5         UR                  R                  U S5      n[        U[@        5      (       d   eUR                  R                  U S5      n[        U[@        5      (       d   e URC                  UU5      n[        U[        5      (       d   eUU-  nU$ ! [        [        4 a     GNf = f! [         a     GNzf = f! [        [        4 a     GN)f = f! [        [        4 a     GNf = f! [         a     U$ f = f! [         a     U$ f = f)Nr   werrorb_thinlto_cacheFb_thinlto_cache_dir zmeson-privatezthinlto-cacher   r   r   r   r   r   thinlto_cache_dirr   r   zLinker r   r   r   r   r   
b_asneededr   zshared moduler   )SharedModuleb_lundefr   r   )"get_build_dirr   r   r   get_werror_argsr   r   ospathjoinget_lto_link_argsr   r   r   r   sanitizer_link_argshas_multi_link_argumentsr   r   r   r  get_coverage_link_argsr   r  typenamebitcode_argsget_asneeded_argsbuildr  headerpad_argsno_undefined_link_argsget_allow_undefined_link_argsr   get_crt_link_args)r   linkerr   r  	build_dirr  cachedir_keyr	  lto_mode	sanitizersanitizer_argsr  	as_neededbitcoder  r  r   crtargss                     rm   get_base_link_argsr5  O  s	    D!!#I<<--fg>>||11&(CCF2245 $$%67L*3eLL$?YWlMmoq$r!$*(*YQ`(a%5c9_C]_`aK23	,@WYbcHKK00#"3 1 5 6LL66v|L	)T**** I33I> 22>GJ$wv/A/A/C.DDjkyjz%{||KK',,44VWEj KK88:;KK3356<<--flCC1133D v22FNIV00&{KG v/9F'')*	F,,./ (F))+,600v22FLLKK5578KK<<>?,,44VYG'3''''LL66v{K	)S))))	..w	BGgt,,,,GOD
 KA n%    n% 
 n% B  	 K		 Ks   D	P BP( <AP9 >%P9 $3Q :A&Q8 !.Q' P%$P%(
P65P69QQQ$#Q$'
Q51Q8 4Q55Q8 8
RRc                      \ rS rSrSrg)CrossNoRunExceptioni  rh   N)r   r   r   r   r   rh   r   rm   r7  r7    s    r   r7  c                  X    \ rS rSr% S\S'   SrS\S'   SrS\S	'   SrS\S
'   SrS\S'   Sr	g)	RunResulti  r   compiledi  int
returncode	UNDEFINEDr   stdoutstderrFcachedrh   N)
r   r   r   r   __annotations__r<  r>  r?  r@  r   rh   r   rm   r9  r9    s/    NJFCFCFDr   r9  c                  |    \ rS rSr% SrS\S'   S\S'   S\S'   S\S	'   S\S
'   \" SSS9rS\S'   \" SSS9rS\S'   Sr	g)CompileResulti  z.The result of Compiler.compiles (and friends).r   r>  r?  T.List[str]commandr;  r<  
input_nameNF)r   initT.Optional[str]output_namer   r@  rh   )
r   r   r   r   __doc__rA  r   rI  r@  r   rh   r   rm   rC  rC    sC     9KKOO#(E#BKBU3FD3r   rC  c                  
   \ rS rSr% / rS\S'   / rS\S'   SrS\S'   SrS	\S
'   S	\S'   S\S'   Sr	  S         SS jjr
SS jr\" SS9SS j5       rSS jrSS jrSS jrSS jrSS jrSS jrSS jr\SS j5       rSS jr S       SS jjr            SS jr    SS jrSSS .         SS! jjrSS".     SS# jjrSS$ jrSSS% jjrSS& jr\ RB                  SS' j5       r"SS( jr#SS) jr$SS* jr%SS+ jr&SS, jr'SS- jr(SS. jr)SS/ jr*SS0 jr+SS1 jr,\-SS2 j5       r.SS3 jr/SSS4 jjr0SSS5 jjr1SSS6 jjr2SSS .     SS7 jjr3SSSS8.       SS9 jjr4SSS .       SS: jjr5    S         SS; jjr6SSS .     SS< jjr7SSS .     SS= jjr8SSS .     SS> jjr9SSS .     SS? jjr:\SS@ j5       r;SSA jr<\SSB j5       r=\>R~                  SS4       SSC jjr@ S   SSD jjrASSE jrBSSF jrCSSG jrDSSH jrESSI jrFSSSJ jjrG\HR                   S\JR                  SSSK.         SSL jjj5       rL\HR                  S\JR                  SSM.       SSN jj5       rMSSO jrNSSSP jjrOSSQ jrPSSR jrQSSS jrRSST jrSSSU jrTSSV jrUSSW jrVSSX jrWSSY jrX S     SSZ jjrYSS[ jrZSS\ jr[SS] jr\SS^ jr]SS_ jr^SS` jr_SSa jr`SSb jraSSc jrbSSd jrcSSe jrdSSf jreSSg jrf\-SSh j5       rgSSi jrhSSj jriSSk jrjSlSmSn.SSo jjrkSlSmSSp.   SSq jjrlSSr jrmSSs jrnSSt jroSSu jrpSSv jrqSSw jrr        SSx jrsSSy jrtSSz jruSS{ jrv\SS| j5       rwSS} jrxSS~ jrySS jrzSS jr{SS jr|SS jr}SS jr~SS jrSS jrSS jrSS jr S   SS jjr              SS jr S         SS jjrSS jrSS jrSS jrSS jrSS jrSS jrSS jr\ RB                  SS j5       rSGS S jjrGSS jrGSS jrSS jrGSS jrGSS jrSS jrSS jrGSS jrSS jr\ RB                  SS j5       rGSS jrGSS jrGSS jrSS jrSS jr\JGR<                  4       GS	S jjr\HR                  SS\JGR<                  SS4           GS
S jj5       rSS\JGR<                  SS.         GSS jjrSSSSS.         GSS jjrGSS jrGSS jrSS jrGSS jrGSS jrSS jrGSS jrGSS jr S         GSS jjrGSS jrSrg(  r   i  rD  ignore_libsinternal_libsNzT.Union[None, str, T.List[str]]LINKER_PREFIXTr   languageidr   	warn_argsCOMPILERFc	                "   X-   U l         X l        [        U R                     U l        [        U R                  5      U l        U R                  S   U l        X0l        Xpl	        X@l
        [        5       U l        X`l        XPl        Xl        / U l        g Nr   )exelistexelist_no_ccachera   rO  file_suffixessetcan_compile_suffixesdefault_suffixversionfull_versionfor_machiner  r,  infois_crossmodes)	selfccacherU  r[  r]  r^  r,  r\  r_  s	            rm   __init__Compiler.__init__  s|     '!(*4==9$'(:(:$;!"003(&.1e	 ')
r   c                    SnUR                  U R                  R                  U R                  SR	                  U R
                  5      5      $ )Nz<{0}: v{1} `{2}`> )format	__class__r   r[  r  rU  )ra  repr_strs     rm   __repr__Compiler.__repr__  s:    &t~~66"xx57 	7r   r   c                   [        U[        R                  5      (       a  UR                  n[        R
                  R                  U5      S   nUS:w  a  UR                  5       n[        U5      =(       a    USS  U R                  ;   $ )Nr|   z.C)
r   r	   r   r   r  r  splitextr   r   rY  )ra  srcrl   s      rm   can_compileCompiler.can_compile  sg    c8==))))C!!#&q)T>\\^FF|Gqr
d.G.G GGr   c                    U R                   $ rg   )rP  ra  s    rm   get_idCompiler.get_id  s    wwr   c                    U R                   $ rg   )r`  rr  s    rm   	get_modesCompiler.get_modes  s    zzr   c                     U R                   S   $ rT  rU  rr  s    rm   get_exeCompiler.get_exe  s    ||Ar   c                     U R                   SS  $ )Nr|   ry  rr  s    rm   get_exe_argsCompiler.get_exe_args  s    ||ABr   c                h     U R                   R                  $ ! [         a    U R                  s $ f = frg   )r,  rP  r   rr  s    rm   get_linker_idCompiler.get_linker_id  s-    	;;>>! 	77N	s    11c                    U R                   U R                  /nU R                  (       a  USU R                  -  /-  nSSR                  U5      -  $ )Nz"%s"z(%s)rf  )rP  r[  r\  r  )ra  detailss     rm   get_version_stringCompiler.get_version_string  sI    77DLL)$"3"3455G'*++r   c                    U R                   $ rg   )rO  rr  s    rm   get_languageCompiler.get_language  s    }}r   c                6    U R                   R                  5       $ rg   )rO  
capitalize)clss    rm   get_display_languageCompiler.get_display_language  s    ||&&((r   c                    U R                   $ rg   )rZ  rr  s    rm   get_default_suffixCompiler.get_default_suffix  s    """r   c                :    [        SU R                  5       -  5      e)Nz%s does not support get_define r   rs  )ra  dnameprefixr   
extra_argsdependenciesdisable_caches          rm   
get_defineCompiler.get_define  s     ##Dt{{}#TUUr   c               :    [        SU R                  5       -  5      e)Nz %s does not support compute_int r  )	ra  
expressionlowhighguessr  r   r  r  s	            rm   compute_intCompiler.compute_int  s     ##E#UVVr   c                :    [        SU R                  5       -  5      e)Nz;%s does not support compute_parameters_with_absolute_paths r  )ra  parameter_listr-  s      rm   &compute_parameters_with_absolute_paths/Compiler.compute_parameters_with_absolute_paths#  s    "#`cgcncncp#pqqr   r  r  c               :    [        SU R                  5       -  5      e)Nz"%s does not support has_member(s) r  )ra  r$  membernamesr  r   r  r  s          rm   has_membersCompiler.has_members'  s     ##G$++-#WXXr   )r  c               :    [        SU R                  5       -  5      e)Nz%s does not support has_type r  ra  r$  r  r   r  r  s         rm   has_typeCompiler.has_type-  s     ##BT[[]#RSSr   c                :    [        SU R                  5       -  5      e)Nz3%s does not support symbols_have_underscore_prefix r  ra  r   s     rm   symbols_have_underscore_prefix'Compiler.symbols_have_underscore_prefix2  s    "#X[_[f[f[h#hiir   c                x    U(       a  U R                   R                  5       $ U R                  R                  5       $ rg   )rU  copyrV  )ra  rb  s     rm   get_exelistCompiler.get_exelist5  s+    &,t||  "O$2H2H2M2M2OOr   c                x    U R                   (       a  U R                   R                  5       $ U R                  5       $ rg   )r,  r  rr  s    rm   get_linker_exelistCompiler.get_linker_exelist8  s)    ,0KKt{{&&(OT=M=M=OOr   c                    g rg   rh   ra  
outputnames     rm   get_output_argsCompiler.get_output_args;      r   c                8    U R                   R                  U5      $ rg   )r,  r  r  s     rm   get_linker_output_argsCompiler.get_linker_output_args?  s    {{**:66r   c                8    U R                   R                  U5      $ rg   )r,  get_search_args)ra  dirnames     rm   get_linker_search_argsCompiler.get_linker_search_argsB  s    {{**733r   c                2    [        SU R                  -  5      e)Nz'%s does not support get_builtin_define.r   rP  ra  defines     rm   get_builtin_defineCompiler.get_builtin_defineE      "#Ltww#VWWr   c                2    [        SU R                  -  5      e)Nz'%s does not support has_builtin_define.r  r  s     rm   has_builtin_defineCompiler.has_builtin_defineH  r  r   c                    / $ rg   rh   rr  s    rm   get_always_argsCompiler.get_always_argsK      	r   c                6    U R                   R                  5       $ )zK
Determines whether the linker can accept arguments using the @rsp syntax.
)r,  get_accepts_rsprr  s    rm   can_linker_accept_rspCompiler.can_linker_accept_rspN  s     {{**,,r   c                6    U R                   R                  5       $ rg   )r,  r  rr  s    rm   get_linker_always_argsCompiler.get_linker_always_argsT  s    {{**,,r   c                6    U R                   R                  5       $ rg   )r,  get_lib_prefixrr  s    rm   get_linker_lib_prefixCompiler.get_linker_lib_prefixW      {{))++r   c                    / $ )zg
Used only on Windows for libraries that need an import library.
This currently means C, C++, Fortran.
rh   )ra  
implibnames     rm   gen_import_library_args Compiler.gen_import_library_argsZ  s	    
 	r   c                8    U R                    SUR                   3$ )N_)rO  r   )ra  r   s     rm   make_option_nameCompiler.make_option_namea  s    --#((,,r   c                *    U R                   " U5        U $ rg   )update)r
   r  s     rm   update_optionsCompiler.update_optionsd  s    tr   c                    0 $ rg   rh   rr  s    rm   get_optionsCompiler.get_optionsi  r  r   c                    / $ rg   rh   ra  r   r   r   s       rm   get_option_compile_args Compiler.get_option_compile_argsl  r  r   c                    / $ rg   rh   r  s       rm   get_option_std_argsCompiler.get_option_std_argso  r  r   c                :    U R                   R                  XU5      $ rg   )r,  get_option_link_argsr  s       rm   r  Compiler.get_option_link_argsr  s    {{//ZHHr   c               :    [        SU R                  5       -  5      e)zCheck that header is usable.

Returns a two item tuple of bools. The first bool is whether the
check succeeded, the second is whether the result was cached (True)
or run fresh (False).
+Language %s does not support header checks.r   r  )ra  hnamer  r   r  r  s         rm   check_headerCompiler.check_headeru  s     ##PSWSlSlSn#noor   )r  r  r  c               :    [        SU R                  5       -  5      e)at  Check that header is exists.

This check will return true if the file exists, even if it contains:

```c
# error "You thought you could use this, LOLZ!"
```

Use check_header if your header only works in some cases.

Returns a two item tuple of bools. The first bool is whether the
check succeeded, the second is whether the result was cached (True)
or run fresh (False).
r  r  )ra  r  r  r   r  r  r  s          rm   
has_headerCompiler.has_header  s    $ ##PSWSlSlSn#noor   c               :    [        SU R                  5       -  5      e)Nz2Language %s does not support header symbol checks.r  )ra  r  symbolr  r   r  r  s          rm   has_header_symbolCompiler.has_header_symbol  s     ##WZ^ZsZsZu#uvvr   c           	        UR                  U R                  5      nU(       a   UR                  5       (       d  [        S5      eU R	                  XX4[
        R                  SS9 nUR                  S:w  aE  [        R                  " SUR                   SUR                   S35        [        S5      sS S S 5        $ U(       a)  UR                  R                  5       UR                  /-   n	OUR                  /n	 [        R                   " XUS	9u  pn S S S 5        [        R                  " S5        [        R                  " W5        [        R                  " S5        [        R                  " W5        [        SW
R                  X5      $ ! ["         a;  n[        R                  " S
U	 SU S35        [        S5      s S nAsS S S 5        $ S nAff = f! , (       d  f       N= f)Nz8Can not run test applications in this cross environment.T)r   want_outputr   zCould not compile test file z: 
F)r   cwdzCould not run: z	 (error: z)
zProgram stdout:
zProgram stderr:
)need_exe_wrapperr]  has_exe_wrapperr7  _build_wrapperr   r   r<  r   debugrF  r9  exe_wrapperget_commandrI  r	   
Popen_safe	Exception)ra  coder   r  r  run_envrun_cwdr  pcmdlistper2   sees                 rm   runCompiler.run  sz   
 //0@0@AC$7$7$9$9%&`aa  JK[K`K`nr swx||q 

9!,,r!,,WYZ[ ' ts  //5571==/I==/(%007S
 t 	

&'

2

&'

2r}}b55  (

_WIYqcEF '' ts( tss=   #AG9=G7F
G'G8G9GGG
Gc                  UR                   R                  nU R                  X#U[        S5      5      nU[	        U5      4nXu;   a  XW   nSUl        [        R                  " S5        [        R                  " SU5        [        R                  " SU5        [        R                  " SUR                  5        [        R                  " SUR                  5        [        R                  " SUR                  5        U$ U R                  XX4S	9nXU'   U$ )
Nr   TzUsing cached run result:Code:
zArgs:
zCached run returncode:
zCached run stdout:
zCached run stderr:
r  )r   run_check_cachebuild_wrapper_argsr   tupler@  r   r  r<  r>  r?  r  )	ra  r  r   r  r  r  r  r   r  s	            rm   
cached_runCompiler.cached_run  s     ,,66&&sFVW]F^_U4[!!$AAHJJ12JJy$'JJy*-JJ11<<@JJ-qxx8JJ-qxx8  zUA#$C r   c               :    [        SU R                  5       -  5      e)Nz+Language %s does not support sizeof checks.r  r  s         rm   sizeofCompiler.sizeof  s     ##PSWSlSlSn#noor   c               :    [        SU R                  5       -  5      e)Nz.Language %s does not support alignment checks.r  r  s         rm   	alignmentCompiler.alignment  s     ##SVZVoVoVq#qrrr   c               :    [        SU R                  5       -  5      e)zSee if a function exists.

Returns a two item tuple of bools. The first bool is whether the
check succeeded, the second is whether the result was cached (True)
or run fresh (False).
z-Language %s does not support function checks.r  )ra  funcnamer  r   r  r  s         rm   has_functionCompiler.has_function  s     ##RUYUnUnUp#pqqr   c                "    UR                  5       $ z7Always returns a copy that can be independently mutatedr  )r  r  r^  s      rm   _unix_args_to_nativeCompiler._unix_args_to_native       yy{r   c                8    U R                  XR                  5      $ rg   )r1  r^  ra  r  s     rm   unix_args_to_nativeCompiler.unix_args_to_native  s    ((yy99r   c                "    UR                  5       $ r/  r0  )r  r  s     rm   native_args_to_unixCompiler.native_args_to_unix  r3  r   c                <    [        SU R                  5        S35      e)N	Language z" does not support library finding.r  )ra  libnamer   
extra_dirslibtypelib_prefix_warningignore_system_dirss          rm   find_libraryCompiler.find_library  s!    "Yt/H/H/J.KKm#noor   c                R    [        SR                  U R                  5       5      5      e)Nz0Language {} does not support get_library_naming.r   rg  r  )ra  r   r?  stricts       rm   get_library_namingCompiler.get_library_naming  s)    ">EE))+-. 	.r   c                    / $ rg   rh   r  s     rm   get_program_dirsCompiler.get_program_dirs  r  r   c                R    [        SR                  U R                  5       5      5      e)zChecks if the compiler has all of the arguments.

:returns:
    A tuple of (bool, bool). The first value is whether the check
    succeeded, and the second is whether it was retrieved from a cache
z1Language {} does not support has_multi_arguments.rE  ra  r  r   s      rm   r   Compiler.has_multi_arguments  s+     #?FF))+-. 	.r   c                8    U R                   R                  X5      $ )zChecks if the linker has all of the arguments.

:returns:
    A tuple of (bool, bool). The first value is whether the check
    succeeded, and the second is whether it was retrieved from a cache
)r,  r   rM  s      rm   r"  !Compiler.has_multi_link_arguments
  s     {{..t99r   c                    U[         R                  :w  d   S5       eU[         R                  :X  a  SnOSn[        R                  R                  USU-   5      $ )NAIn pre-processor mode, the output is sent to stdout and discardedexer.   zoutput.)r   r   r   r  r  r  )ra  r  r   rl   s       rm   _get_compile_outputCompiler._get_compile_output  sR    '222w4ww2 #(((FFww||GY%788r   c                    / nX R                  5       -  nU[        R                  L a  X R                  5       -  nU$ U[        R                  L a  X R                  5       -  nU$ U[        R                  L d   eU$ rg   )r  r   r   get_compile_only_argsr   get_preprocess_only_argsr   )ra  r   r  s      rm   get_compiler_args_for_mode#Compiler.get_compiler_args_for_mode  s    $$&&#+++..00D
 	 %0001133D  +00000r   c                    [        X5      $ )z;Return an appropriate CompilerArgs instance for this class.r   r5  s     rm   compiler_argsCompiler.compiler_args(  s    D''r   )r   r  temp_dirc          	   #    #    U[         R                  :X  a  U(       a   S5       eUc  / n[        US9 nSn[        U[        5      (       a  [
        R                  R                  USU R                  -   5      n[        USSS9 n	U	R                  U5        UR                  S5      (       d  U	R                  S5        S S S 5        S	nS
U 3n
OUR                  nSU 3n
U R                  5       nUR                  U5        U[         R                  :w  a$  U R                  Xc5      nXR!                  U5      -  nUR#                  U R%                  [        U5      5      5        U(       a  X-  nU R'                  U(       + S9UR)                  5       -   n[*        R,                  " S5        [*        R,                  " SU5        [*        R,                  " U
5        [
        R.                  R1                  5       nSUS'   U(       a  SUS'   [3        USXnS9u  nnn[5        UUXR6                  US9nU(       a  WUl        Uv   S S S 5        g ! , (       d  f       GN= f! , (       d  f       g = f7f)NrR  )dirFz	testfile.wzutf-8)encodingr	  Tr  zSource file: )rb  zRunning compile:zWorking directory: rA   LC_ALLr   CCACHE_DISABLEzCommand line)msgr
  r   )rF  )r   r   r   r   r   r  r  r  rZ  openwriter   r   r\  r  rT  r  r   rY  r  	to_nativer   r  environr  r   rC  r<  rI  )ra  r  r  r   r  r^  
tmpdirname	no_ccachesrcnameofile
code_debugcommandsoutputcommand_listos_envr  stdostderesults                      rm   r   Compiler.compile,  s     #..."g$gg?J'H5I$$$'',,z'2T5H5H'HJ'39UKK%==..D) :
 !	&tf-
**,WI6
 ))+HOOG$ '22211*C0088OOD;;<LT<RST
 &++y=+AHDVDVDXXLJJ)*JJ,j9JJz"ZZ__&F"F8+.'(-lT^kMAtT"4|\\V]^F%+"L[ 65
 :9 65s6   1I$AI9I<E<I8	I$
I	I
I!I$r  r   r^  c             #    #    Ub  [        U5      O	[        5       n[        U R                  5      U R                  XU4nXrR                  ;   a  UR                  U   nSUl        [
        R                  " S5        [
        R                  " SSR                  UR                  5      S5        [
        R                  " SU5        [
        R                  " SUR                  5        [
        R                  " SUR                  5        Uv   g U R                  XUS	US
9 nXR                  U'   Uv   S S S 5        g ! , (       d  f       g = f7f)NTzUsing cached compile:zCached command line: rf  r	  r  zCached compiler stdout:
zCached compiler stderr:
Fr  r   r  r^  )r!  rU  r[  compiler_check_cacher@  r   r  r  rE  r>  r?  r   )	ra  r  cdatar  r   r^  textra_argsr   r  s	            rm   cached_compileCompiler.cached_compileh  s      ?I>Tz):Z_Za/4T\\/BDLLRVei.j ,,,**3/AAHJJ./JJ.0CTJJJy$'JJ2AHH=JJ2AHH=GdRWbjkop23**3/ lkks   DED6-	E6
E Ec                    / $ rg   rh   )ra  	colortypes     rm   r   Compiler.get_colorout_args      	r   c                    / $ rg   rh   )ra  rel_objpchs      rm   get_compile_debugfile_args#Compiler.get_compile_debugfile_args  r  r   c                    g)NFrh   rr  s    rm   should_link_pch_objectCompiler.should_link_pch_object  s    r   c                8    U R                   R                  U5      $ rg   )r,  get_debugfile_namera  
targetfiles     rm   get_link_debugfile_name Compiler.get_link_debugfile_name      {{--j99r   c                8    U R                   R                  U5      $ rg   )r,  get_debugfile_argsr  s     rm   get_link_debugfile_args Compiler.get_link_debugfile_args  r  r   c                6    U R                   R                  5       $ rg   )r,  get_std_shared_lib_argsrr  s    rm   get_std_shared_lib_link_args%Compiler.get_std_shared_lib_link_args  s    {{2244r   c                8    U R                   R                  U5      $ rg   )r,  get_std_shared_module_argsra  r   s     rm   get_std_shared_module_link_args(Compiler.get_std_shared_module_link_args  s    {{55f==r   c                8    U R                   R                  U5      $ rg   )r,  get_link_whole_forr5  s     rm   r  Compiler.get_link_whole_for  s    {{--d33r   c                6    U R                   R                  5       $ rg   )r,  get_allow_undefined_argsrr  s    rm   r*  &Compiler.get_allow_undefined_link_args  s    {{3355r   c                6    U R                   R                  5       $ rg   )r,  no_undefined_argsrr  s    rm   r)  Compiler.no_undefined_link_args      {{,,..r   c                    g)zCompiler arguments needed to enable the given instruction set.

Return type ay be an empty list meaning nothing needed or None
meaning the given set is not supported.
Nrh   )ra  instruction_sets     rm   get_instruction_set_args!Compiler.get_instruction_set_args  s     r   c                <    U R                   R                  XX4U5      $ rg   )r,  build_rpath_args)ra  r   r-  from_dirr   extra_pathss         rm   r  Compiler.build_rpath_args  s     {{++Hk; 	;r   c                8    U R                   R                  U5      $ rg   )r,  get_archive_name)ra  filenames     rm   r  Compiler.get_archive_name  s    {{++H55r   c                \    U R                   (       d  / $ U R                   R                  5       $ rg   )r,  get_command_to_archive_shlibrr  s    rm   r  %Compiler.get_command_to_archive_shlib  s!    {{I{{7799r   c                    / $ rg   rh   r  s     rm   thread_flagsCompiler.thread_flags  r  r   c                8    U R                   R                  U5      $ rg   )r,  r  r  s     rm   thread_link_flagsCompiler.thread_link_flags  s    {{'',,r   c                :    [        SU R                  5       -  5      e)Nz*Language %s does not support OpenMP flags.r  r  s     rm   openmp_flagsCompiler.openmp_flags  s    "#ORVRkRkRm#mnnr   c                $    U R                  U5      $ rg   )r  r  s     rm   openmp_link_flagsCompiler.openmp_link_flags  s      %%r   c                    / $ rg   rh   r  s     rm   language_stdlib_only_link_flags(Compiler.language_stdlib_only_link_flags  r  r   c                    / $ rg   rh   )ra  vistypes     rm   gnu_symbol_visibility_args#Compiler.gnu_symbol_visibility_args  r  r   c                8    U R                   R                  U5      $ rg   )r,  get_win_subsystem_argsra  values     rm   r  Compiler.get_win_subsystem_args  s     {{11%88r   c                <    [        SU R                  5        S35      e)Nr<  z& does not support function attributes.r  )ra  r   r   s      rm   has_func_attributeCompiler.has_func_attribute  s(    "11344Z[] 	]r   c                V    Sn[        UR                  U R                  5       5      5      e)Nz6Language {} does not support position-independent coderE  ra  rP   s     rm   get_pic_argsCompiler.get_pic_args  s$    D"188D,E,E,G#HIIr   c                V    Sn[        UR                  U R                  5       5      5      e)Nz<Language {} does not support position-independent executablerE  r  s     rm   get_pie_argsCompiler.get_pie_args  s$    J"188D,E,E,G#HIIr   c                6    U R                   R                  5       $ rg   )r,  r  rr  s    rm   get_pie_link_argsCompiler.get_pie_link_args      {{''))r   c                     g)aC  Returns the argument family type.

Compilers fall into families if they try to emulate the command line
interface of another compiler. For example, clang is in the GCC family
since it accepts most of the same arguments as GCC. ICL (ICC on
windows) is in the MSVC family since it accepts most of the same
arguments as MSVC.
otherrh   rh   r   rm   get_argument_syntaxCompiler.get_argument_syntax  s     r   c                :    [        SU R                  5       -  5      e)Nz.%s does not support get_profile_generate_args r  rr  s    rm   r   "Compiler.get_profile_generate_args  s    "<t{{}LN 	Nr   c                :    [        SU R                  5       -  5      e)Nz)%s does not support get_profile_use_args r  rr  s    rm   r  Compiler.get_profile_use_args  s    "7$++-GI 	Ir   c                    SnSnSn/ n[        U5      nU HJ  nXr;   a  M
  UR                  U5      (       a  Xs;  a  M'  Xt;   a  [        U5        M9  UR                  U5        ML     U$ )N)z-headerpad_max_install_names)z-Wl,-L)r  z
-framework)iter
startswithnextr  )ra  r  rm_exactrm_prefixesrm_nextr   iargsargs           rm   remove_linkerlike_argsCompiler.remove_linkerlike_args  sk    4%'T
C ~~k**s/E~UJJsO  
r   r   r   r   c                   / $ rg   rh   )ra  r   r   s      rm   r   Compiler.get_lto_compile_args  r  r   r  c               6    U R                   R                  5       $ rg   )r,  get_lto_args)ra  r   r   r  s       rm   r   Compiler.get_lto_link_args  s    {{''))r   c                    / $ rg   rh   r  s     rm   r   Compiler.sanitizer_compile_args  r  r   c                8    U R                   R                  U5      $ rg   )r,  r1  r  s     rm   r!  Compiler.sanitizer_link_args  s    {{))%00r   c                6    U R                   R                  5       $ rg   )r,  r&  rr  s    rm   r&  Compiler.get_asneeded_args  r  r   c                6    U R                   R                  5       $ rg   )r,  r(  rr  s    rm   r(  Compiler.headerpad_args  r  r   c                6    U R                   R                  5       $ rg   )r,  r%  rr  s    rm   r%  Compiler.bitcode_args  r  r   c                8    U R                   R                  U5      $ rg   )r,  get_optimization_link_argsra  optimization_levels     rm   r  #Compiler.get_optimization_link_args  s    {{556HIIr   c                >    U R                   R                  XX4UU5      $ rg   )r,  get_soname_args)ra  r   r  
shlib_namerl   	soversiondarwin_versionss          rm   r  Compiler.get_soname_args!  s%     {{**Y 	r   c                    UR                   $ rg   )	link_argsr  s     rm   get_target_link_argsCompiler.get_target_link_args(  s    r   c                "    UR                  5       $ rg   )get_compile_argsra  deps     rm   get_dependency_compile_args$Compiler.get_dependency_compile_args+  s    ##%%r   c                @    UR                  U R                  5       5      $ rg   )get_link_argsr  r  s     rm   get_dependency_link_args!Compiler.get_dependency_link_args.  s      !2!2!455r   c                    / $ )zKGet a list of arguments to pass to the compiler to set the linker.
        rh   )r  r,  r[  s      rm   use_linker_argsCompiler.use_linker_args1  s	     	r   c                    / $ rg   rh   rr  s    rm   r  Compiler.get_coverage_args7  r  r   c                6    U R                   R                  5       $ rg   )r,  r  rr  s    rm   r#  Compiler.get_coverage_link_args:  r  r   c                    / $ )zGet arguments to enable or disable assertion.

:param disable: Whether to disable assertions
:return: A list of string arguments for this compiler
rh   )ra  disabler   s      rm   r  Compiler.get_assert_args=  s	     	r   c                    U[         R                  ;   a  U$ US;   d   eSnSnUS:X  a  SnSnUS:X  a  gUS	:X  a  U$ US
;   a  U$ US:X  d   e[        S5      e)N>   from_buildtypestatic_from_buildtypemddmdr'  mtdmtr   r   r  >   minsizer   debugoptimizedcustomzBRequested C runtime based on buildtype, but buildtype is "custom".)r
   
MSCRT_VALSr   )ra  r  r   dbgrels        rm   get_crt_valCompiler.get_crt_valE  s    g(((NEEEE--CC '!JBBJ(((&'kllr   c                    [        S5      eNz4This compiler does not support Windows CRT selectionr   ra  r  r   s      rm   r  Compiler.get_crt_compile_args[      "#YZZr   c                    [        S5      er5  r6  r7  s      rm   r+  Compiler.get_crt_link_args^  r9  r   c                    / $ rg   rh   rr  s    rm   rW  Compiler.get_compile_only_argsa  r  r   c                    [        S5      e)Nz*This compiler does not have a preprocessorr6  rr  s    rm   rX  !Compiler.get_preprocess_only_argsd  s    "#OPPr   c                "    U R                  5       $ rg   )rX  rr  s    rm   get_preprocess_to_file_args$Compiler.get_preprocess_to_file_argsg  s    ,,..r   c                    / $ rg   rh   rr  s    rm   get_default_include_dirs!Compiler.get_default_include_dirsj  r  r   c                r    U R                  5       S:X  d"  U R                  R                  5       (       d  S/$ / $ )z=Enable transparent large-file-support for 32-bit UNIX systemsmsvcz-D_FILE_OFFSET_BITS=64)r  r^  	is_darwinrr  s    rm   get_largefile_argsCompiler.get_largefile_argsn  s7    ((*f4		8K8K8M8M --- 	r   c                    / $ rg   rh   )ra  r   	elf_classs      rm   get_library_dirsCompiler.get_library_dirs  r  r   c                2    [        U R                   S35      e)Nz" does not support get_return_valuer  )ra  r   rtyper  r   r  r  s          rm   get_return_valueCompiler.get_return_value  s     #dggY.P#QRRr   c                2    [        U R                   S35      e)Nz  does not support find_frameworkr  )ra  r   r   r>  allow_systems        rm   find_frameworkCompiler.find_framework  s    
 #dggY.N#OPPr   c                2    [        U R                   S35      e)Nz& does not support find_framework_pathsr  r  s     rm   find_framework_pathsCompiler.find_framework_paths      "dggY.T#UVVr   c                2    [        U R                   S35      e)Nz" does not support attribute checksr  ra  r   s     rm   attribute_check_funcCompiler.attribute_check_func  s    "dggY.P#QRRr   c                2    [        U R                   S35      eNz& does not support pre compiled headersr  rr  s    rm   get_pch_suffixCompiler.get_pch_suffix  rZ  r   c                2    [        U R                   S35      er`  r  r\  s     rm   get_pch_nameCompiler.get_pch_name  rZ  r   c                2    [        U R                   S35      er`  r  )ra  pch_dirheaders      rm   get_pch_use_argsCompiler.get_pch_use_args  rZ  r   c                2    [        U R                   S35      e)Nz% does not support function attributesr  r\  s     rm   !get_has_func_attribute_extra_args*Compiler.get_has_func_attribute_extra_args  s    "dggY.S#TUUr   c                8    SR                  U R                  5      $ )Nrf  )r  rU  rr  s    rm   r   Compiler.name_string  s    xx%%r   c                    g)zCheck that this compiler actually works.

This should provide a simple compile/link test. Something as simple as:
```python
main(): return 0
```
is good enough here.
Nrh   )ra  work_direnvironments      rm   sanity_checkCompiler.sanity_check  s    r   c                   U R                   (       a:  U(       a3  UR                  5       (       d  gUR                  R                  5       U-   n[        R
                  " S[        R                  " U5      5         [        USUS9u  pVnUR                  S:w  a5  [        R                  " SU R                   S	U R                  5        S
35      eXg4$ ! [         a   n[        R                  " SU< S35      eS nAff = f)N)r  r  zRunning test binary command: zSanity check)r
  z*Could not invoke sanity check executable: r   r   zExecutables created by z
 compiler z are not runnable.)r_  r  r  r  r   r  r	   	join_argsr   r  r   r<  rO  r   )	ra  rr  r  rq  use_exe_wrapper_for_crossr  rs  rt  r  s	            rm   run_sanity_checkCompiler.run_sanity_check  s    ==6..00!--99;gEG

2H4F4Fw4OP	e.wHUNBd ==A//2I$--Xbcgcscscubv  wI  1J  K  Kz  	e//2\]^\aab0cdd	es   8C 
C8C33C8c                
    S U4$ rg   rh   )ra  r   s     rm   split_shlib_to_partsCompiler.split_shlib_to_parts  s    U{r   c                    / $ rg   rh   )ra  	outtargetoutfiles      rm   get_dependency_gen_args Compiler.get_dependency_gen_args  r  r   c                    / $ rg   rh   rr  s    rm   get_std_exe_link_argsCompiler.get_std_exe_link_args  r  r   c                    / $ rg   rh   )ra  r  	is_systems      rm   get_include_argsCompiler.get_include_args  r  r   c                .    US-   U R                  5       -   $ )Nr   )get_depfile_suffix)ra  objfiles     rm   depfile_for_objectCompiler.depfile_for_object  s    }t66888r   c                2    [        U R                   S35      e)Nz& does not implement get_depfile_suffixr  rr  s    rm   r  Compiler.get_depfile_suffix  rZ  r   c                    / $ )z>Arguments to turn off default inclusion of standard libraries.rh   rr  s    rm   get_no_stdinc_argsCompiler.get_no_stdinc_args  r  r   c                    / $ rg   rh   )ra  levels     rm   get_warn_argsCompiler.get_warn_args  r  r   c                    / $ rg   rh   rr  s    rm   r  Compiler.get_werror_args  r  r   c                    g rg   rh   r  s     rm   get_optimization_argsCompiler.get_optimization_args  r  r   c                2    [        U R                   S35      e)Nz* does not implement get_module_incdir_argsr  rr  s    rm   get_module_incdir_argsCompiler.get_module_incdir_args      "dggY.X#YZZr   c                2    [        U R                   S35      e)Nz* does not implement get_module_outdir_argsr  )ra  r  s     rm   get_module_outdir_argsCompiler.get_module_outdir_args  r  r   c                2    [        U R                   S35      e)Nz+ does not implement module_name_to_filenamer  )ra  module_names     rm   module_name_to_filename Compiler.module_name_to_filename  s    "dggY.Y#Z[[r   c                "    U R                  5       $ )a  Arguments to pass the compiler and/or linker for checks.

The default implementation turns off optimizations.

Examples of things that go here:
  - extra arguments for error checking
  - Arguments required to make the compiler exit with a non-zero status
    when something is wrong.
)get_no_optimization_args)ra  r   s     rm   get_compiler_check_args Compiler.get_compiler_check_args  s     ,,..r   c                    / $ )z8Arguments to the compiler to turn off all optimizations.rh   rr  s    rm   r  !Compiler.get_no_optimization_args  r  r   c                ,   [        U5      (       a  U" U5      nUc  / nUc  / nU R                  U R                  U5      5      nU H<  nXVR                  5       -  nU[        R
                  L d  M*  XVR                  5       -  nM>     U[        R                  L a3  XQR                  R                  U R                  U R                  5      -  nOEU[        R
                  L a2  XQR                  R                  U R                  U R                  5      -  nXR-  nU$ )a:  Arguments to pass the build_wrapper helper.

This generally needs to be set on a per-language basis. It provides
a hook for languages to handle dependencies and extra args. The base
implementation handles the most common cases, namely adding the
check_arguments, unwrapping dependencies, and appending extra args.
)callabler\  r  r  r   r   r  r   r   get_external_argsr]  rO  get_external_link_args)ra  r   r  r  r   r  rN   s          rm   r   Compiler.build_wrapper_args   s     J#D)JJL !!$">">t"DEA&&((D',,,))  #+++LL2243C3CT]]SSD%***LL778H8H$--XXDr   c              #  F  #    U R                  X#XE5      nU(       d  U(       a)  U R                  XXVUR                  S9 n	U	v   SSS5        gU R                  XR                  XUR                  S9 n	U	v   SSS5        g! , (       d  f       g= f! , (       d  f       g= f7f)zHelper for getting a cached value when possible.

This method isn't meant to be called externally, it's mean to be
wrapped by other methods like compiles() and links().
ry  Nrw  )r   r   scratch_dirr}  r   )
ra  r  r   r  r  r   r  r  r  rs
             rm   r  Compiler._build_wrapper%  s      &&sKKd$bebqbqrvw sr $$T<<D^a^m^m$nrs on sr ons4   <B!A?.B!1B6	B!?
B	B!
BB!r  r  r   r  c          	         U R                  XX4XVS9 nUR                  S:H  UR                  4sSSS5        $ ! , (       d  f       g= f)zRun a compilation or link test to see if code can be compiled/linked.

:returns:
    A tuple of (bool, bool). The first value is whether the check
    succeeded, and the second is whether it was retrieved from a cache
)r  r   N)r  r<  r@  )ra  r  r   r  r  r   r  r  s           rm   compilesCompiler.compiles8  s>       Jd hlm<<1$ahh. ihhs	   7
A)r  r  r  r  c          
     >   U(       ae  UR                  XUSS9 n[        R                  R                  UR                  5      nU R                  XUU[        R                  SS9sS S S 5        $ U R                  XUU[        R                  US9$ ! , (       d  f       N/= f)NT)r  r  r  )r  r	   r   from_absolute_filerI  r  r   r   )	ra  r  r   r  r  r  r  r  r  s	            rm   linksCompiler.linksF  s    
 (([_(`de"--::1==I}}Wj2>EUEZEZjn % p a`
 }}T:*6=M=R=Rbo  q 	q a`s   A
B
Bc                2    [        U R                   S35      e)z&Used by D for extra language features.z$ does not implement get_feature_argsr  )ra  kwargsbuild_to_srcs      rm   get_feature_argsCompiler.get_feature_argsT  s     #dggY.R#STTr   c                2    [        U R                   S35      e)Nz$ does not know how to do prelinking.r  )ra  prelink_nameobj_lists      rm   get_prelink_argsCompiler.get_prelink_argsY  s    "dggY.R#STTr   c                    g)zCControls whether compile args have to be used for prelinking or notFrh   rr  s    rm   get_prelink_append_compile_args(Compiler.get_prelink_append_compile_args\  s    r   c                6    U R                   R                  5       $ )zThe format of the RSP file that this compiler supports.

If `self.can_linker_accept_rsp()` returns True, then this needs to
be implemented
)r,  rsp_file_syntaxrr  s    rm   r  Compiler.rsp_file_syntax`  s     {{**,,r   c                    / $ )z%Arguments required for a debug build.rh   )ra  is_debugs     rm   get_debug_argsCompiler.get_debug_argsh  r  r   c                2    [        SU R                   35      e)NzThere is no static linker for )NotImplementedErrorrO  rr  s    rm   needs_static_linkerCompiler.needs_static_linkerl  s    !$B4==/"RSSr   c                :    [        U R                  5        S35      e)z%Get compiler's preprocessor.
        z does not support preprocessorr  rr  s    rm   get_preprocessorCompiler.get_preprocessoro  s     #dkkm_4R#STTr   c                H    [        U R                   SU 3U R                  S9$ )Nr  )machine)r   rO  r]  )ra  basenames     rm   form_compileropt_keyCompiler.form_compileropt_keyt  s$    DMM?!H:6@P@PQQr   c                    [        U[        5      (       a  U R                  U5      nU(       a  UR                  R	                  X15      $ UR                  R
                  R                  UR                  US95      $ )N)r   )r   r   r  r   r   r   r   r   )ra  r   r   r   r   s        rm   get_compileropt_valueCompiler.get_compileropt_valuew  s_     c3++C0C<<55fBB<<((66szzZz7XYYr   c                    U R                  S5      nX   n[        U[        R                  [        R                  45      (       d   S5       eSU;  a  S/U-   nX$l        g )Nstdzfor mypyr   )r  r   r
   UserStdOptionUserComboOptionchoices)ra  optsr  r   r  s        rm   _update_language_stdsCompiler._update_language_stds  s\    ''.i# 5 5w7N7NOPP\R\\PHu$Er   )r  rY  rZ  rU  rV  rW  r]  r\  r^  r_  r,  r`  r[  )NNF)rb  rD  rU  rD  r[  r   r]  r   r^  z'MachineInfo'r,  zT.Optional['DynamicLinker']r\  rH  r_  r   )returnr   )rn  'mesonlib.FileOrString'r  r   )r  zT.List[Compiler])r  rD  )F)r  r   r  r   r   'Environment'r  AT.Union[T.List[str], T.Callable[[CompileCheckMode], T.List[str]]]r  zT.List['Dependency']r  r   r  zT.Tuple[str, bool])r  r   r  T.Optional[int]r  r  r  r  r  r   r   r  r  GT.Union[None, T.List[str], T.Callable[[CompileCheckMode], T.List[str]]]r   T.Optional[T.List['Dependency']]r  r;  )r  rD  r-  r   r  rD  )r$  r   r  rD  r  r   r   r  r  r  r  r  r  T.Tuple[bool, bool])r$  r   r  r   r   r  r  r  r  r  r  r  )r   r  r  r   )T)rb  r   r  rD  )r  r   r  rD  )r  r   r  rD  )r  r   r  rH  )r  r   r  r   )r  r   )r  r   r  rD  )r   r   r  r   )r
   r   r  z)T.Tuple[OptionKey, options.AnyOptionType]r  r   )r  z'MutableKeyedOptionDictType'rg   )r   'BuildTarget'r   r  r   rH  r  rD  )r   r   r   r   r   rH  r  rD  )r  r   r  r   r   r  r  r  r  r  r  r  )r  r   r  r   r   r  r  r  r  r  r  r   r  r  )r  r   r  r   r  r   r   r  r  r  r  r  r  r  )NNNN)r  r  r   r  r  GT.Union[T.List[str], T.Callable[[CompileCheckMode], T.List[str]], None]r  r  r  zT.Optional[T.Dict[str, str]]r  rH  r  r9  )
r  r   r   r  r  r  r  r  r  r9  )r$  r   r  r   r   r  r  r  r  r  r  T.Tuple[int, bool])r$  r   r  r   r   r  r  T.Optional[T.List[str]]r  r  r  r  )r+  r   r  r   r   r  r  r  r  r  r  r  )r  rD  r^  r   r  rD  )r  rD  r  rD  )r=  r   r   r  r>  rD  r?  r   r@  r   rA  r   r  r  )r   r  r?  r   rF  r   r  zT.Optional[T.Tuple[str, ...]])r   r  r  rD  )r  rD  r   r  r  r  )r  r   r   r   r  r   )r   r   r  rD  )r  zT.Optional[T.Iterable[str]]r  r   )r  r  r  z(T.Union[None, CompilerArgs, T.List[str]]r   r   r  r   r^  rH  r  T.Iterator[CompileResult])r  r  r{  zcoredata.CoreDatar  z(T.Union[None, T.List[str], CompilerArgs]r   r   r^  rH  r  r  )r  r   r  rD  )r  r   r  r   r  rD  )r  r   r  rH  )r  r   r  rD  )r   r  r  rD  )r  r   r  r  )r   r   r-  r   r  r   r   r   r  r  r  z"T.Tuple[T.List[str], T.Set[bytes]])r  r   r  r   )r   r   r  rD  )r  r   r  rD  )r  r   r  rD  )r   r   r   r  r  r  )r   r;  r   r   r  rD  )r   r;  r   r   r  rH  r  rD  )r  rD  r  rD  )r  r   r  rD  )r   r  r  r   r	  r   rl   r   r
  r   r  T.Tuple[str, str]r  rD  )r  z'Dependency'r  rD  )r,  r   r[  r   r  rD  )r#  r   r   r  r  rD  )r  r   r   r   r  r   )r  r   r   r   r  rD  )r   r  rL  r  r  rD  )r   r   rP  r   r  r   r   r  r  r  r  r  r  zT.Union[str, int])
r   r   r   r  r>  rD  rT  r   r  r  )r   r   r  r   )rg  r   rh  r   r  rD  )r   r   r  rD  )rq  r   rr  r  r  None)
rr  r   r  rD  rq  r   rw  r   r  r  )r   r   r  zT.Tuple[T.Optional[str], str])r~  r   r  r   r  rD  )r  r   r  r   r  rD  )r  r   r  rH  )r  r   r  rD  )r  zT.Tuple[str, ...])r  r   r  rD  )r  r   r  r   )
r   r  r  UT.Union[None, CompilerArgs, T.List[str], T.Callable[[CompileCheckMode], T.List[str]]]r  r  r   r   r  r   )r  r  r   r  r  r  r  r  r   r   r  r   r  r   r  r  )r  r  r   r  r  UT.Union[None, T.List[str], CompilerArgs, T.Callable[[CompileCheckMode], T.List[str]]]r  r  r   r   r  r   r  r  )r  r  r   r  r  zT.Optional['Compiler']r  r  r  r  r  r   r  r  )r  r   r  r   r  rD  )r  r   r  rD  r  z!T.Tuple[T.List[str], T.List[str]])r  z'RSPFileSyntax')r  r   r  rD  )r  r   )r  r   r  r   )
r   T.Union[str, OptionKey]r   r   r   zT.Optional[BuildTarget]r   rH  r  zoptions.ElementaryOptionValues)r  r   r  rD  r  r  )r   r   r   r   rL  rA  rM  rN  INVOKES_LINKERr   rc  rj  r   ro  rs  rv  rz  r}  r  r  r  classmethodr  r  r  r  r  r  r  r  r  r  abcabstractmethodr  r  r  r  r  r  r  r  r  r  r  staticmethodr  r  r  r  r  r  r  r  r  r"  r%  r(  r,  r1  r6  r9  r   PREFER_SHAREDrB  rG  rJ  r   r"  rT  rY  r\  
contextlibcontextmanagerr   r   r   r}  r   r  r  r  r  r  r  r  r*  r)  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r   r   r   r!  r&  r(  r%  r  r  r  r  r  r  r  r#  r  r2  r  r+  rW  rX  rA  rD  rI  rM  rQ  rU  rX  r]  ra  rd  ri  rl  r   rs  rx  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r  r  r  r  r  r  r  r  r  r  r  r  r  r   rh   r   rm   r   r     s	     "K! "$M;#59M29NMG''D 8<HM*+*3@*4*  /* BF*$7
 tH H , ) )# */V`V!5V #'V 4FVW*W47W>KW gW #CW HKWr:=rBMr koEIYY&3Y gY #CY ObY CGT^T?TK^T
jPP 	 74XX--,-  I lpFJ	p!h	p#C	pOb	p jnDH).pfp!Ap #'p 4Gp, quKOw,w&mw )Iw Uhw cg=A48'+	6_6:6 26 %	6 1:	6F jnDHf!AMV* fj@Dpbp=pI[p 9=CGs5s @sL^s <@FJ	r!8	r#C	rOb	r  :  
 )0(=(=Z^  |Ap%pSWptxp F]p
 +0.#'.4Q.	.:9	( GK9,<,A,AW\,09D9)9PT9 *9 6O9 9v NR0@0E0E37#K- "1 =V 2::5>46/ VZ;!,;;R; _A;
6:
-o&9]JJ* 	 	NI* 67I  34?C*-<*HS*1/,*J #03):?J &6  
/m,[[Q/( 7;$3?JS #S #S "%S ,	S
 &=S (HS M^S -1	Q Q)Q $/Q &*	Q 6M	QWSWWWV& 	 "9W 	 [[\
/ 5E4L4L#'|#)I# "2# R^#J {HL0@0H0H^c-2	#x%E . X\ '+	 8Q	 & vzBF*:*B*B',	/r/?/ (/ !%	/ 2E	/ 26rv?C$)	q.qoq =q "	q /B	qU
U-TU
R =A	Z#:Z#.Z '>Z +:	Z
 $BZ r   )	metaclass)rj   r   r  r;  )r   r  r  r   )rl   r   r  r   )r   r   r  r   )r   zmesonlib.FileOrStringr  r   )
r   zT.Set[OptionKey]r   r  r   r  r   r  r  r   )
r   r  r   r  r   r   r   '_T'r  r  )r   r  r   r  r  r   )r   r   r   r  r  r   )r   r  r  
'Compiler'r   r  r  rD  )r   r  r,  r  r   r  r  rD  )j
__future__r   r  r  os.pathr  reenum	itertoolstypingTdataclassesr   r   	functoolsr   r  r   r	   r
   r   r   r   r   r   r   r   arglistr   TYPE_CHECKINGr   r'  r   r   r   	envconfigr   rr  r   linkersr   linkers.linkersr   r   r  r   TypeVarr   r!   r   r   r   ra   rA  keysall_languagesc_cpp_suffixesrX  cpp_suffixes
c_suffixesr   r   chainvaluesr   r   
clib_langsr}   dictitemsSUFFIX_TO_LANGLANGUAGES_USING_LDFLAGSLANGUAGES_USING_CPPFLAGSr   r   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   Enumr   gnu_winlibsmsvc_winlibsr   r   r   r   r   r   r  r5  r7  r9  rC  ABCMetar   rh   r   rm   <module>r&     s  
 # 
      (     
   "??.4')'/()99^:>LYYt_; ["@44	  C4 G4 E4 4 F4 g4 G4 "4 	'4 Z4 I4 i4  !4" I#4$ %40 ( ""$='(>9s#$~5
4 6 9??qM$8$8$:q<NqP`qbpqr0 ?
 $j0ioo (K4A4G4G4I(K L M Q 9 
**@
A 
	
'#  	$%% 4$ $+
(+%& 4" "+
""tyy N<
 		



5 1  &/ + (% 3 8< 		_i>@V)V)V.9Vr	. 	    
4N 
4 
4I~ Ir   