o
    uJAfŒ  ã                   @  sÄ   U 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d	ed
< g dgdgdgdgdgdgdœZd	ed< g g dœZded< G dd„ deƒZdS )é    )ÚannotationsNé   )ÚEnvironmentException)ÚMachineInfo)ÚEnvironment)ÚCompiler)ÚplainÚdebugÚdebugoptimizedÚreleaseÚminsizeÚcustomzT.Dict[str, T.List[str]]Úxc16_buildtype_argsz-O0z-O1z-O2z-O3z-Os)r   Ú0ÚgÚ1Ú2Ú3ÚsÚxc16_optimization_args)FTzT.Dict[bool, T.List[str]]Úxc16_debug_argsc                   @  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 ):ÚXc16CompilerÚ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   Úsx)r   r   r   r   Ú
everything)Úis_crossr   Úcan_compile_suffixesÚaddÚ	warn_args)ÚselfÚdefault_warn_args© r#   úE/usr/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(   )r   )r!   r-   r#   r#   r$   Úget_buildtype_argsT   ó   zXc16Compiler.get_buildtype_argsc                 C  s   dS )NÚpchr#   r)   r#   r#   r$   Úget_pch_suffixW   r+   zXc16Compiler.get_pch_suffixÚpch_dirÚheaderc                 C  r'   r(   r#   )r!   r4   r5   r#   r#   r$   Úget_pch_use_argsZ   r+   zXc16Compiler.get_pch_use_argsÚenvú'Environment'c                 C  r'   r(   r#   )r!   r7   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   r=   z$Xc16Compiler.get_no_stdlib_link_argsÚoptimization_levelc                 C  r/   r(   )r   )r!   r?   r#   r#   r$   Úget_optimization_argsi   r1   z"Xc16Compiler.get_optimization_argsÚis_debugÚboolc                 C  r/   r(   )r   )r!   rA   r#   r#   r$   Úget_debug_argsl   r1   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)ÚclsrD   rE   Ú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é	   rG   )Ú	enumerateÚosÚpathÚnormpathÚjoin)r!   rN   rO   ÚidxrL   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.   )r4   r.   r5   r.   r   r&   )r7   r8   r   r&   )r?   r.   r   r&   )rA   rB   r   r&   )rD   r&   rE   r   r   r&   )rN   r&   rO   r.   r   r&   )Ú__name__Ú
__module__Ú__qualname__Úidr%   r*   r,   r0   r3   r6   r9   r:   r<   r>   r@   rC   ÚclassmethodrM   rW   r#   r#   r#   r$   r   ;   s"    











r   )Ú
__future__r   rR   ÚtypingÚTÚmesonlibr   ÚTYPE_CHECKINGÚ	envconfigr   Úenvironmentr   Zcompilers.compilersr   Úobjectr   Ú__annotations__r   r   r   r#   r#   r#   r$   Ú<module>   s:   ú
ùþ