o
    WodT~                     @  sD  d dl mZ d dlZd dlZddlmZ ddlmZ ddl	m
Z
mZmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZmZ ddlmZmZ ddlm Z  ddlm!Z!m"Z" ddl#m$Z$m%Z% ddl&m'Z' ddl(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/m0Z0m1Z1 ej2rddlm3Z3m4Z4 ddl5m6Z6 ddl7m8Z8 ddl9m:Z: ddl;m<Z< ddl	m=Z= ddl>m?Z? ddl.m@Z@ e1ZAneBZAG d d! d!ee1ZCG d"d# d#eAZDG d$d% d%eDe'eCZEG d&d' d'eEZFG d(d) d)eEZGG d*d+ d+e-eEZHG d,d- d-eeCZIG d.d/ d/e eCZJG d0d1 d1e+eCZKG d2d3 d3e+eCZLG d4d5 d5e)eCZMG d6d7 d7e$eCZNG d8d9 d9eEZOG d:d; d;eAZPG d<d= d=eePeCZQG d>d? d?eDeePeCZRG d@dA dAe%ePeCZSG dBdC dCeSZTG dDdE dEeeCZUG dFdG dGeeCZVG dHdI dIeeCZWG dJdK dKeeCZXG dLdM dMeeCZYG dNdO dOeYZZdS )P    )annotationsN   )coredata)mlog)MesonExceptionversion_compare	OptionKey   )C_FUNC_ATTRIBUTES)CLikeCompiler)CcrxCompiler)Xc16Compiler)CompCertCompiler)
TICompiler)ArmCompilerArmclangCompiler)MSVCCompilerClangClCompiler)GnuCompiler)gnu_common_warning_argsgnu_c_warning_args)IntelGnuLikeCompilerIntelVisualStudioLikeCompiler)ClangCompiler)ElbrusCompiler)PGICompiler)EmscriptenMixin)gnu_winlibsmsvc_winlibsCompiler)MutableKeyedOptionDictTypeKeyedOptionDictType)
Dependency)MachineInfo)Environment)DynamicLinker)MachineChoice)ExternalProgram)CompileCheckModec                      sd   e Zd Zd1ddZdZ			d2d3ddZd4ddZd5d d!Zddd"d6d,d-Zd7 fd/d0Z	  Z
S )8	CCompilernamestrreturnc                 C  s*   zt | W S  ty   td| dw )NzUnknown function attribute "")r
   KeyErrorr   )selfr*    r0   uhome/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/lib/python3.10/site-packages/mesonbuild/compilers/c.pyattribute_check_func;   s
   
zCCompiler.attribute_check_funccNccacheT.List[str]exelistversionfor_machiner&   is_crossboolinfo'MachineInfo'exe_wrapperT.Optional['ExternalProgram']linkerT.Optional['DynamicLinker']full_versionT.Optional[str]c
           
      C  s,   t j| |||||||	|d	 t| | d S )N)r9   rA   r?   )r   __init__r   
r/   r4   r6   r7   r8   r9   r;   r=   r?   rA   r0   r0   r1   rC   C   s   zCCompiler.__init__c                 C     dgS )Nz	-nostdincr0   r/   r0   r0   r1   get_no_stdinc_argsL      zCCompiler.get_no_stdinc_argswork_direnvironment'Environment'Nonec                 C  s   d}|  ||d|S )Nz.int main(void) { int class=0; return class; }
zsanitycheckc.c)Z_sanity_check_impl)r/   rI   rJ   coder0   r0   r1   sanity_checkO   s   zCCompiler.sanity_check
extra_argsdependencieshnamesymbolprefixenvrP   IT.Union[None, T.List[str], T.Callable[['CompileCheckMode'], T.List[str]]]rQ    T.Optional[T.List['Dependency']]T.Tuple[bool, bool]c          	      C  s.   |||d}d}| j |jdi ||||dS )N)rT   headerrS   z{prefix}
        #include <{header}>
        int main(void) {{
            /* If it's not defined as a macro, try to use as a symbol */
            #ifndef {symbol}
                {symbol};
            #endif
            return 0;
        }}rO   r0   )Zcompilesformat)	r/   rR   rS   rT   rU   rP   rQ   Zfargstr0   r0   r1   has_header_symbolS   s
   	zCCompiler.has_header_symbol'MutableKeyedOptionDictType'c                   s6   t   }|td| j| jdtddgdi |S )NstdmachinelangzC language standard to usenone)superget_optionsupdater   r8   languager   ZUserComboOptionr/   opts	__class__r0   r1   rd   d   s   
zCCompiler.get_options)r*   r+   r,   r+   NNNr4   r5   r6   r5   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   r,   r5   )rI   r+   rJ   rK   r,   rL   )rR   r+   rS   r+   rT   r+   rU   rK   rP   rV   rQ   rW   r,   rX   r,   r]   )__name__
__module____qualname__r2   rf   rC   rG   rN   r\   rd   __classcell__r0   r0   ri   r1   r)   :   s    

	
r)   c                      s.   e Zd ZdZdZdZdZd	 fddZ  ZS )
_ClangCStdszMixin class for clang based compilers for setting C standards.

    This is used by both ClangCCompiler and ClangClCompiler, as they share
    the same versions
    z>=6.0.0>=8.0.0>=9.0.0r,   r]   c                   s   t   }g d}g d}t| j| jr|dg7 }|dg7 }t| j| jr/|dg7 }|dg7 }t| j| jr@|dg7 }|dg7 }d	g| | |td
| j| j	d _
|S )Nc89c99c11gnu89gnu99gnu11c17gnu17c18gnu18c2xgnu2xrb   r^   r_   )rc   rd   r   r7   _C17_VERSION_C18_VERSION_C2X_VERSIONr   r8   rf   choicesr/   rh   c_stdsg_stdsri   r0   r1   rd   |   s   






"z_ClangCStds.get_optionsrn   )	ro   rp   rq   __doc__r   r   r   rd   rr   r0   r0   ri   r1   rs   p   s    rs   c                      sF   e Zd Z				d!d"ddZd# fddZd$ddZd$dd Z  ZS )%ClangCCompilerNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   definesT.Optional[T.Dict[str, str]]rA   rB   c                 C  sX   t j| |||||||||
d
 t| |	 ddg}g ||dg |ddg dgd| _d S Nr?   rA   -Wall-Winvalid-pch-Wextra
-Wpedanticz-Weverything0123Z
everything)r)   rC   r   	warn_argsr/   r4   r6   r7   r8   r9   r;   r=   r?   r   rA   default_warn_argsr0   r0   r1   rC      s   
zClangCCompiler.__init__r,   r]   c                   sF   t   }| j s| j r!|td| j| jdt	
dti |S )Nwinlibsr_   &Standard Win libraries to link against)rc   rd   r;   
is_windows	is_cygwinre   r   r8   rf   r   UserArrayOptionr   rg   ri   r0   r1   rd      s   
zClangCCompiler.get_optionsoptions'KeyedOptionDictType'c                 C  8   g }|t d| j| jd }|jdkr|d|j  |S Nr^   r_   rb   -std=r   r8   rf   valueappendr/   r   argsr^   r0   r0   r1   get_option_compile_args   
   
z&ClangCCompiler.get_option_compile_argsc                 C  ^   | j  s
| j  r-|td| j| jd j }t|t	sJ |D ]	}t|t
s*J q!|S g S Nr   r_   )r;   r   r   r   r8   rf   r   copy
isinstancelistr+   r/   r   libslr0   r0   r1   get_option_link_args      z#ClangCCompiler.get_option_link_argsNNNNr4   r5   r6   r5   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   r   r   rA   rB   rn   r   r   r,   r5   )ro   rp   rq   rC   rd   r   r   rr   r0   r0   ri   r1   r      s    
r   c                   @     e Zd ZdZdS )ArmLtdClangCCompilerZarmltdclangNro   rp   rq   idr0   r0   r0   r1   r          r   c                   @  s   e Zd ZdZdZdZdZdS )AppleClangCCompilerzHandle the differences between Apple Clang and Vanilla Clang.

    Right now this just handles the differences between the versions that new
    C standards were added.
    z>=10.0.0z>=11.0.0N)ro   rp   rq   r   r   r   r   r0   r0   r0   r1   r      s
    r   c                   @  s$   e Zd ZdZ				ddddZdS )EmscriptenCCompilerZ
emscriptenNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   r   r   rA   rB   c                 C  sB   |st dt|dst dtj| |||||||||	|
d d S )Nz;Emscripten compiler can only be used for cross compilation.z	>=1.39.19z$Meson requires Emscripten >= 1.39.19)r=   r?   r   rA   )r   r   r   rC   r/   r4   r6   r7   r8   r9   r;   r=   r?   r   rA   r0   r0   r1   rC      s   

zEmscriptenCCompiler.__init__r   r   ro   rp   rq   r   rC   r0   r0   r0   r1   r      s    r   c                   @  s@   e Zd ZdZ			d d!ddZd"ddZd#ddZd#ddZdS )$ArmclangCCompilerz
    Keil armclang
    Nr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   c
                 C  sV   t j| |||||||||	d
 t|  ddg}
g |
|
dg |
ddg dgd| _d S r   )r)   rC   r   r   r/   r4   r6   r7   r8   r9   r;   r=   r?   rA   r   r0   r0   r1   rC      s   

zArmclangCCompiler.__init__r,   r]   c                 C  .   t | }td| j| jd}g d|| _|S )Nr^   r_   )rb   c90rx   ry   gnu90r|   r}   r)   rd   r   r8   rf   r   r/   rh   keyr0   r0   r1   rd         
zArmclangCCompiler.get_optionsr   r   c                 C  r   r   r   r   r0   r0   r1   r      r   z)ArmclangCCompiler.get_option_compile_argsc                 C     g S Nr0   r/   r   r0   r0   r1   r         z&ArmclangCCompiler.get_option_link_argsrk   rl   rn   r   )ro   rp   rq   r   rC   rd   r   r   r0   r0   r0   r1   r      s    

r   c                   @  sT   e Zd ZdZdZdZ				d(d)ddZd*ddZd+d d!Zd+d"d#Z	d,d&d'Z
dS )-GnuCCompilerrt   ru   z>=3.4.0Nr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   r   r   rA   rB   c                 C  s   t j| |||||||||
d
 t| |	 dg}t| j| jr$|dg7 }g ||dg |ddg |ddg | t | t d| _	d S )Nr   r   r   r   r   r   )
r)   rC   r   r   r7   _INVALID_PCH_VERSIONZsupported_warn_argsr   r   r   r   r0   r0   r1   rC   
  s   


zGnuCCompiler.__init__r,   r]   c                 C  s   t | }g d}g d}t| j| jr |ddg7 }|ddg7 }t| j| jr1|dg7 }|dg7 }td	| j| jd
}dg| | || _	| j
 sN| j
 r\||dtdti |S )Nrv   rz   r~   r   r   r   r   r   r^   r_   rb   r   r   )r)   rd   r   r7   r   r   r   r8   rf   r   r;   r   r   re   Zevolver   r   r   r/   rh   r   r   r   r0   r0   r1   rd     s&   


zGnuCCompiler.get_optionsr   r   c                 C  r   )Nr^   ra   r`   rb   r   )r   rf   r8   r   r   r   r0   r0   r1   r   1  r   z$GnuCCompiler.get_option_compile_argsc                 C  r   )Nr   r   )r;   r   r   r   rf   r8   r   r   r   r   r+   r   r0   r0   r1   r   8  r   z!GnuCCompiler.get_option_link_argspch_dirrY   c                 C  s   ddt j|gS )Nz-fpch-preprocessz-include)ospathbasename)r/   r   rY   r0   r0   r1   get_pch_use_argsB  s   zGnuCCompiler.get_pch_use_argsr   r   rn   r   )r   r+   rY   r+   r,   r5   )ro   rp   rq   r   r   r   rC   rd   r   r   r   r0   r0   r0   r1   r     s    



r   c                   @  s   e Zd Z			ddddZdS )PGICCompilerNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   c
           
      C  ,   t j| |||||||||	d
 t|  d S Nr   r)   rC   r   rD   r0   r0   r1   rC   G     zPGICCompiler.__init__rk   rl   )ro   rp   rq   rC   r0   r0   r0   r1   r   F  s
    r   c                   @  s"   e Zd ZdZ			ddddZdS )NvidiaHPC_CCompilerZ
nvidia_hpcNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   c
           
      C  r   r   r   rD   r0   r0   r1   rC   T  r   zNvidiaHPC_CCompiler.__init__rk   rl   r   r0   r0   r0   r1   r   P  s    r   c                      sD   e Zd Z				d'd(ddZd)ddZdddd* fd%d&Z  ZS )+ElbrusCCompilerNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   r   r   rA   rB   c                 C  s,   t j| |||||||||
d
 t|  d S r   )r)   rC   r   r   r0   r0   r1   rC   ^     zElbrusCCompiler.__init__r,   r]   c                 C  s   t | }g d}|g d7 }t| jdr|ddg7 }t| jdr-t| jdr-|g d7 }t| jd	r9|g d7 }t| jd
rE|g d7 }dg| |td| j| jd _|S )N)rw   Zc9xrx   r{   gnu9xr|   )ziso9899:1990ziso9899:199409ziso9899:1999z	>=1.20.00ry   r}   z	>=1.21.00z<1.22.00)r   Zc1xr   gnu1xziso9899:2011z	>=1.23.00z	>=1.26.00)r~   r   ziso9899:2017ziso9899:2018r   r   rb   r^   r_   r)   rd   r   r7   r   r8   rf   r   )r/   rh   Zstdsr0   r0   r1   rd   g  s   
zElbrusCCompiler.get_optionsrO   funcnamerT   rU   rK   rP   T.Optional[T.List[str]]rQ   rW   rX   c                  s"   |dkrdS t  j|||||dS )Nlchmod)FFrO   )rc   has_function)r/   r   rT   rU   rP   rQ   ri   r0   r1   r   x  s   zElbrusCCompiler.has_functionr   r   rn   )r   r+   rT   r+   rU   rK   rP   r   rQ   rW   r,   rX   )ro   rp   rq   rC   rd   r   rr   r0   r0   ri   r1   r   ]  s    
	r   c                   @  2   e Zd Z			ddddZdddZd ddZdS )!IntelCCompilerNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   c
                 C  sh   t j| |||||||||	d
 t|  d| _ddg}
g |
dg |
ddg |
ddg |
dg d| _d S )Nr   zc-headerr   z-w3z-diag-disable:remarkr   r   )r)   rC   r   Zlang_headerr   r   r0   r0   r1   rC     s   


zIntelCCompiler.__init__r,   r]   c                 C  sV   t | }ddg}ddg}t| jdr|dg7 }dg| | |td| j| jd	 _|S )
Nrw   rx   r{   r|   z>=16.0.0ry   rb   r^   r_   r   r   r0   r0   r1   rd     s   

"zIntelCCompiler.get_optionsr   r   c                 C  r   r   r   r   r0   r0   r1   r     r   z&IntelCCompiler.get_option_compile_argsrk   rl   rn   r   ro   rp   rq   rC   rd   r   r0   r0   r0   r1   r     s    
	r   c                   @  r   )IntelLLVMCCompilerz
intel-llvmNr   r0   r0   r0   r1   r     r   r   c                      s,   e Zd ZdZd fddZdd	d
Z  ZS )VisualStudioLikeCCompilerMixinz3Shared methods that apply to MSVC-like C compilers.r,   r]   c                   s2   t   }|td| j| jdtdti |S )Nr   r_   zWindows libs to link against.)	rc   rd   re   r   r8   rf   r   r   r   rg   ri   r0   r1   rd     s   
z*VisualStudioLikeCCompilerMixin.get_optionsr   r   r5   c                 C  sJ   t d| j| jd}|| j }t|tsJ |D ]	}t|ts"J q|S r   )r   r8   rf   r   r   r   r   r+   )r/   r   r   r   r   r0   r0   r1   r     s   z3VisualStudioLikeCCompilerMixin.get_option_link_argsrn   r   )ro   rp   rq   r   rd   r   rr   r0   r0   ri   r1   r     s    
r   c                      sB   e Zd ZdZdZ			dd ddZd! fddZd"ddZ  ZS )#VisualStudioCCompilerz>=19.28Nr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   targetr=   r>   r?   r@   rA   rB   c                 C  s.   t j| ||||||||	|
d
 t| | d S r   )r)   rC   r   )r/   r4   r6   r7   r8   r9   r;   r   r=   r?   rA   r0   r0   r1   rC     
   zVisualStudioCCompiler.__init__r,   r]   c                   s   t   }ddg}g d}t| j| jr|dg7 }|ddg7 }t| j| jr2|ddg7 }|d	d
g7 }td| j| jd}dg| | || _	|S )Nrw   rx   )r{   r   r   r|   ry   r   r}   r~   r   r   r   r^   r_   rb   )
rc   rd   r   r7   _C11_VERSIONr   r   r8   rf   r   r   ri   r0   r1   rd     s   

z!VisualStudioCCompiler.get_optionsr   r   c                 C  s`   g }|t d| j| jd }|jdrtd |jdv r$|d |S |jdv r.|d |S )	Nr^   r_   Zgnuzcl.exe does not actually support gnu standards, and meson will instead demote to the nearest ISO C standard. This may cause compilation to fail.>   r   ry   r}   z/std:c11>   r   r   r   r~   z/std:c17)r   r8   rf   r   
startswithr   log_oncer   r   r0   r0   r1   r     s   



z-VisualStudioCCompiler.get_option_compile_argsrk   )r4   r5   r6   r5   r7   r+   r8   r&   r9   r:   r;   r<   r   r+   r=   r>   r?   r@   rA   rB   rn   r   )	ro   rp   rq   r   r   rC   rd   r   rr   r0   r0   ri   r1   r     s    
r   c                   @  s(   e Zd Z			ddddZdddZdS )ClangClCCompilerNr6   r5   r7   r+   r8   r&   r9   r:   r;   r<   r   r=   r>   r?   r@   rA   rB   c
           
      C  .   t j| g ||||||||	d
 t| | d S r   )r)   rC   r   
r/   r6   r7   r8   r9   r;   r   r=   r?   rA   r0   r0   r1   rC     r   zClangClCCompiler.__init__r   r   r,   c                 C  s4   t d| j| jd}|| j}|dkrd| gS g S )Nr^   r_   rb   z/clang:-std=)r   r8   rf   r   )r/   r   r   r^   r0   r0   r1   r     s
   
z(ClangClCCompiler.get_option_compile_argsrk   r6   r5   r7   r+   r8   r&   r9   r:   r;   r<   r   r+   r=   r>   r?   r@   rA   rB   r   )ro   rp   rq   rC   r   r0   r0   r0   r1   r     s    
r   c                      s>   e Zd ZdZ			ddddZd  fddZd!ddZ  ZS )"IntelClCCompilerz!Intel "ICL" compiler abstraction.Nr6   r5   r7   r+   r8   r&   r9   r:   r;   r<   r   r=   r>   r?   r@   rA   rB   c
           
      C  r   r   )r)   rC   r   r   r0   r0   r1   rC     r   zIntelClCCompiler.__init__r,   r]   c                   s.   t   }td| j| jd}g d|| _|S Nr^   r_   )rb   rw   rx   ry   )rc   rd   r   r8   rf   r   r   ri   r0   r1   rd     r   zIntelClCCompiler.get_optionsr   r   c                 C  sT   g }t d| j| jd}|| }|jdkrtd |S |jdkr(|d|j  |S )Nr^   r_   rw   zUICL doesn't explicitly implement c89, setting the standard to 'none', which is close.rb   z/Qstd:)r   r8   rf   r   r   r   r   r/   r   r   r   r^   r0   r0   r1   r     s   


z(IntelClCCompiler.get_option_compile_argsrk   r   rn   r   )ro   rp   rq   r   rC   rd   r   rr   r0   r0   ri   r1   r     s    
r   c                   @  r   )IntelLLVMClCCompilerzintel-llvm-clNr   r0   r0   r0   r1   r   #  r   r   c                   @  r   )!ArmCCompilerNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   c
           
      C  r   r   )r)   rC   r   rD   r0   r0   r1   rC   )  s
   zArmCCompiler.__init__r,   r]   c                 C  r   r   r   r   r0   r0   r1   rd   3  r   zArmCCompiler.get_optionsr   r   c                 C  <   g }t d| j| jd}|| }|jdkr|d|j  |S Nr^   r_   rb   z--r   r   r0   r0   r1   r   9     
z$ArmCCompiler.get_option_compile_argsrk   rl   rn   r   r   r0   r0   r0   r1   r   (  s    

r   c                   @  sx   e Zd Z			d.d/ddZd0ddZd1ddZd0ddZd2dd Zd0d!d"Zd0d#d$Z	d3d&d'Z
d0d(d)Zd4d,d-ZdS )5CcrxCCompilerNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   c
           
      C  r   r   )r)   rC   r   rD   r0   r0   r1   rC   C  r   zCcrxCCompiler.__init__r,   c                 C  rE   )Nz-nologor0   rF   r0   r0   r1   get_always_argsM  rH   zCcrxCCompiler.get_always_argsr]   c                 C  r   Nr^   r_   )rb   rw   rx   r   r   r0   r0   r1   rd   P  r   zCcrxCCompiler.get_optionsc                 C  r   r   r0   rF   r0   r0   r1   rG   V  r   z CcrxCCompiler.get_no_stdinc_argsr   r   c                 C  sN   g }t d| j| jd}|| }|jdkr|d |S |jdkr%|d |S )Nr^   r_   rw   z-lang=crx   z	-lang=c99r   r   r0   r0   r1   r   Y  s   



z%CcrxCCompiler.get_option_compile_argsc                 C  r   r   r0   rF   r0   r0   r1   get_compile_only_argsc  r   z#CcrxCCompiler.get_compile_only_argsc                 C  rE   )Nz-optimize=0r0   rF   r0   r0   r1   get_no_optimization_argsf  rH   z&CcrxCCompiler.get_no_optimization_argsr   c                 C     d| gS )Nz-output=obj=r0   r/   r   r0   r0   r1   get_output_argsi     zCcrxCCompiler.get_output_argsc                 C  rE   Nz-change_message=errorr0   rF   r0   r0   r1   get_werror_argsl  rH   zCcrxCCompiler.get_werror_argsr   	is_systemc                 C     |dkrd}d| gS )N .z	-include=r0   r/   r   r  r0   r0   r1   get_include_argso     
zCcrxCCompiler.get_include_argsrk   rl   rm   rn   r   r   r+   r,   r5   r   r+   r  r:   r,   r5   )ro   rp   rq   rC   r  rd   rG   r   r  r  r  r
  r  r0   r0   r0   r1   r   B  s    









r   c                   @  sn   e Zd Z			d,d-ddZd.ddZd/ddZd0ddZd/dd Zd/d!d"Zd1d$d%Z	d/d&d'Z
d2d*d+ZdS )3Xc16CCompilerNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   c
           
      C  r   r   )r)   rC   r   rD   r0   r0   r1   rC   v  r   zXc16CCompiler.__init__r,   r]   c                 C  r   )Nr^   r_   )rb   rw   rx   r{   r|   r   r   r0   r0   r1   rd     r   zXc16CCompiler.get_optionsc                 C  r   r   r0   rF   r0   r0   r1   rG     r   z Xc16CCompiler.get_no_stdinc_argsr   r   c                 C  sF   g }t d| j| jd}|| }|jdkr!|d |d|j  |S )Nr^   r_   rb   z-ansir   r   r   r0   r0   r1   r     s   

z%Xc16CCompiler.get_option_compile_argsc                 C  r   r   r0   rF   r0   r0   r1   r    r   z#Xc16CCompiler.get_compile_only_argsc                 C  rE   Nz-O0r0   rF   r0   r0   r1   r    rH   z&Xc16CCompiler.get_no_optimization_argsr   c                 C  r  Nz-or0   r  r0   r0   r1   r    r  zXc16CCompiler.get_output_argsc                 C  rE   r	  r0   rF   r0   r0   r1   r
    rH   zXc16CCompiler.get_werror_argsr   r  c                 C  r  Nr  r  z-Ir0   r  r0   r0   r1   r    r  zXc16CCompiler.get_include_argsrk   rl   rn   rm   r   r  r  )ro   rp   rq   rC   rd   rG   r   r  r  r  r
  r  r0   r0   r0   r1   r  u  s    
	


	


r  c                   @  sZ   e Zd Z			d(d)ddZd*ddZd+ddZd,ddZd-d d!Zd,d"d#Zd.d&d'Z	dS )/CompCertCCompilerNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   c
           
      C  r   r   )r)   rC   r   rD   r0   r0   r1   rC     r   zCompCertCCompiler.__init__r,   r]   c                 C  r   r  r   r   r0   r0   r1   rd     r   zCompCertCCompiler.get_optionsr   r   c                 C  r   r   r0   r   r0   r0   r1   r     r   z)CompCertCCompiler.get_option_compile_argsc                 C  rE   r  r0   rF   r0   r0   r1   r    rH   z*CompCertCCompiler.get_no_optimization_argsr   c                 C  r  r  r0   r  r0   r0   r1   r    r  z!CompCertCCompiler.get_output_argsc                 C  rE   )Nz-Werrorr0   rF   r0   r0   r1   r
    rH   z!CompCertCCompiler.get_werror_argsr   r  c                 C  r  r  r0   r  r0   r0   r1   r    r  z"CompCertCCompiler.get_include_argsrk   rl   rn   r   rm   r  r  )
ro   rp   rq   rC   rd   r   r  r  r
  r  r0   r0   r0   r1   r    s    
	



r  c                   @  sF   e Zd Z			d!d"ddZd#ddZd$ddZd#ddZd%dd ZdS )&TICCompilerNr4   r5   r6   r7   r+   r8   r&   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   c
           
      C  r   r   )r)   rC   r   rD   r0   r0   r1   rC     r   zTICCompiler.__init__r,   c                 C  r   r   r0   rF   r0   r0   r1   r    r   zTICCompiler.get_always_argsr]   c                 C  r   r   r   r   r0   r0   r1   rd     r   zTICCompiler.get_optionsc                 C  r   r   r0   rF   r0   r0   r1   rG     r   zTICCompiler.get_no_stdinc_argsr   r   c                 C  r   r   r   r   r0   r0   r1   r     r   z#TICCompiler.get_option_compile_argsrk   rl   rm   rn   r   )ro   rp   rq   rC   r  rd   rG   r   r0   r0   r0   r1   r    s    



r  c                   @  r   )C2000CCompilerZc2000Nr   r0   r0   r0   r1   r    r   r  )[
__future__r   os.pathr   typingTr  r   r   Zmesonlibr   r   r   Zc_function_attributesr
   Zmixins.cliker   Zmixins.ccrxr   Zmixins.xc16r   Zmixins.compcertr   Z	mixins.tir   Z
mixins.armr   r   Zmixins.visualstudior   r   Z
mixins.gnur   r   r   Zmixins.intelr   r   Zmixins.clangr   Zmixins.elbrusr   Z
mixins.pgir   Zmixins.emscriptenr   	compilersr   r   r   TYPE_CHECKINGr    r!   rQ   r"   Z	envconfigr#   rJ   r$   Zlinkersr%   r&   Zprogramsr'   r(   ZCompilerMixinBaseobjectr)   rs   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r0   r0   r0   r1   <module>   sr   6-$B
&!03-!