o
    ¢ÙldÎ  ã                   @  sª   d dl mZ 	 d dlZd dlZddlmZ ejr+ddlm	Z	 ddl
mZ ddlmZ neZg g g g g g dœZg d	gd	gd
gdgdgdgdœZg g dœZG dd„ deƒZdS )é    )ÚannotationsNé   )ÚEnvironmentException)ÚMachineInfo)ÚEnvironment)ÚCompiler)ÚplainÚdebugZdebugoptimizedÚreleaseZminsizeZcustomz-O0z-O1z-O2z-O3z-Os)r   Ú0ÚgÚ1Ú2Ú3Ús)FTc                   @  s    e Zd ZdZd0dd„Zd1dd„Zd1d	d
„Zd2dd„Zd3dd„Zd4dd„Z	d5dd„Z
d1dd„Zd1dd„Zd1dd„Zd6d d!„Zd7d$d%„Zed8d)d*„ƒZd9d-d.„Zd/S ):ÚXc16CompilerZxc16ÚreturnÚNonec                 C  sL   | j stdƒ‚| j d¡ | j d¡ g }g ||g  |g  |g  dœ| _d S )Nz%xc16 supports only cross-compilation.r   Zsx)r   r   r   r   Z
everything)Zis_crossr   Zcan_compile_suffixesÚaddZ	warn_args)ÚselfZdefault_warn_args© r   úhome/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/lib/python3.10/site-packages/mesonbuild/compilers/mixins/xc16.pyÚ__init__?   s   üzXc16Compiler.__init__úT.List[str]c                 C  ó   g S ©Nr   ©r   r   r   r   Úget_always_argsL   ó   zXc16Compiler.get_always_argsc                 C  r   r   r   r   r   r   r   Úget_pic_argsO   s   zXc16Compiler.get_pic_argsÚ	buildtypeÚstrc                 C  ó   t | S r   )Úxc16_buildtype_args)r   r    r   r   r   Úget_buildtype_argsT   ó   zXc16Compiler.get_buildtype_argsc                 C  s   dS )NZpchr   r   r   r   r   Úget_pch_suffixW   r   zXc16Compiler.get_pch_suffixÚpch_dirÚheaderc                 C  r   r   r   )r   r'   r(   r   r   r   Úget_pch_use_argsZ   r   zXc16Compiler.get_pch_use_argsÚenvú'Environment'c                 C  r   r   r   )r   r*   r   r   r   Úthread_flags]   r   zXc16Compiler.thread_flagsc                 C  r   r   r   r   r   r   r   Úget_coverage_args`   r   zXc16Compiler.get_coverage_argsc                 C  ó   dgS )Nz	-nostdincr   r   r   r   r   Úget_no_stdinc_argsc   ó   zXc16Compiler.get_no_stdinc_argsc                 C  r.   )Nz
--nostdlibr   r   r   r   r   Úget_no_stdlib_link_argsf   r0   z$Xc16Compiler.get_no_stdlib_link_argsÚoptimization_levelc                 C  r"   r   )Úxc16_optimization_args)r   r2   r   r   r   Úget_optimization_argsi   r%   z"Xc16Compiler.get_optimization_argsÚis_debugÚboolc                 C  r"   r   )Úxc16_debug_args)r   r5   r   r   r   Úget_debug_argsl   r%   zXc16Compiler.get_debug_argsÚargsÚinfor   c                 C  sr   g }|D ]2}|  d¡rd|dd …  }|  d¡r d|dd …  }|  d¡r&q|dkr+q|  d¡r1q| |¡ q|S )Nz-Dé   ú-Iz-Wl,-rpath=z--print-search-dirsz-L)Ú
startswithÚappend)Úclsr9   r:   ÚresultÚir   r   r   Ú_unix_args_to_nativeo   s   



z!Xc16Compiler._unix_args_to_nativeÚparameter_listÚ	build_dirc              
   C  sT   t |ƒD ]#\}}|d d… dkr'|d d… tj tj ||dd … ¡¡ ||< q|S )Né	   r<   )Ú	enumerateÚosÚpathÚnormpathÚjoin)r   rC   rD   ÚidxrA   r   r   r   Ú&compute_parameters_with_absolute_paths€   s
   .€z3Xc16Compiler.compute_parameters_with_absolute_pathsN)r   r   )r   r   )r    r!   r   r   )r   r!   )r'   r!   r(   r!   r   r   )r*   r+   r   r   )r2   r!   r   r   )r5   r6   r   r   )r9   r   r:   r   r   r   )rC   r   rD   r!   r   r   )Ú__name__Ú
__module__Ú__qualname__Úidr   r   r   r$   r&   r)   r,   r-   r/   r1   r4   r8   ÚclassmethodrB   rL   r   r   r   r   r   ;   s"    











r   )Ú
__future__r   rG   ÚtypingÚTZmesonlibr   ÚTYPE_CHECKINGZ	envconfigr   Úenvironmentr   Zcompilers.compilersr   Úobjectr#   r3   r7   r   r   r   r   r   Ú<module>   s:   ú
ùþ