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
< dgdgdgdgdgddgdœZd	ed< g d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]]Úccrx_buildtype_argsz-optimize=0z-optimize=1z-optimize=2z-optimize=maxz-size)Ú0ÚgÚ1Ú2Ú3ÚsÚccrx_optimization_argsz-debug)FTzT.Dict[bool, T.List[str]]Úccrx_debug_argsc                   @  s°   e Zd ZU ejrdZeƒ Zded< dZ	d1dd„Z
d2d
d„Zd3dd„Zd4dd„Zd5dd„Zd6dd„Zd2dd„Zd2dd„Zd2dd„Zd7d!d"„Zd8d%d&„Zed9d*d+„ƒZd:d.d/„Zd0S );ÚCcrxCompilerTz
T.Set[str]Úcan_compile_suffixesÚccrxÚreturnÚNonec                 C  s@   | j stdƒ‚| j d¡ g }g ||g  |g  |g  dœ| _d S )Nz%ccrx supports only cross-compilation.Úsrc)r   r   r   r   Ú
everything)Úis_crossr   r   ÚaddÚ	warn_args)ÚselfÚdefault_warn_args© r#   úE/usr/lib/python3.10/site-packages/mesonbuild/compilers/mixins/ccrx.pyÚ__init__B   s   ûzCcrxCompiler.__init__úT.List[str]c                 C  ó   g S ©Nr#   ©r!   r#   r#   r$   Úget_pic_argsO   s   zCcrxCompiler.get_pic_argsÚ	buildtypeÚstrc                 C  ó   t | S r(   )r   )r!   r+   r#   r#   r$   Úget_buildtype_argsT   ó   zCcrxCompiler.get_buildtype_argsc                 C  s   dS )NÚpchr#   r)   r#   r#   r$   Úget_pch_suffixW   ó   zCcrxCompiler.get_pch_suffixÚpch_dirÚheaderc                 C  r'   r(   r#   )r!   r3   r4   r#   r#   r$   Úget_pch_use_argsZ   r2   zCcrxCompiler.get_pch_use_argsÚenvú'Environment'c                 C  r'   r(   r#   )r!   r6   r#   r#   r$   Úthread_flags]   r2   zCcrxCompiler.thread_flagsc                 C  r'   r(   r#   r)   r#   r#   r$   Úget_coverage_args`   r2   zCcrxCompiler.get_coverage_argsc                 C  r'   r(   r#   r)   r#   r#   r$   Úget_no_stdinc_argsc   r2   zCcrxCompiler.get_no_stdinc_argsc                 C  r'   r(   r#   r)   r#   r#   r$   Úget_no_stdlib_link_argsf   r2   z$CcrxCompiler.get_no_stdlib_link_argsÚoptimization_levelc                 C  r-   r(   )r   )r!   r<   r#   r#   r$   Úget_optimization_argsi   r/   z"CcrxCompiler.get_optimization_argsÚis_debugÚboolc                 C  r-   r(   )r   )r!   r>   r#   r#   r$   Úget_debug_argsl   r/   zCcrxCompiler.get_debug_argsÚargsÚinfor   c                 C  sŽ   g }|D ]@}|  d¡rd|dd …  }|  d¡r d|dd …  }|  d¡r&q|dkr+q|  d¡r1q|  d	¡s?| d
¡r?d	| }| |¡ q|S )Nz-Dz-define=é   z-Iú	-include=z-Wl,-rpath=z--print-search-dirsz-Lz-lib=)z.az.lib)Ú
startswithÚendswithÚappend)ÚclsrA   rB   ÚresultÚir#   r#   r$   Ú_unix_args_to_nativeo   s    



z!CcrxCompiler._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é	   rD   )Ú	enumerateÚosÚpathÚnormpathÚjoin)r!   rL   rM   ÚidxrJ   r#   r#   r$   Ú&compute_parameters_with_absolute_paths‚   s
   .€z3CcrxCompiler.compute_parameters_with_absolute_pathsN)r   r   )r   r&   )r+   r,   r   r&   )r   r,   )r3   r,   r4   r,   r   r&   )r6   r7   r   r&   )r<   r,   r   r&   )r>   r?   r   r&   )rA   r&   rB   r   r   r&   )rL   r&   rM   r,   r   r&   )Ú__name__Ú
__module__Ú__qualname__ÚTÚTYPE_CHECKINGr   Úsetr   Ú__annotations__Úidr%   r*   r.   r1   r5   r8   r9   r:   r;   r=   r@   ÚclassmethodrK   rU   r#   r#   r#   r$   r   :   s&   
 










r   )Ú
__future__r   rP   ÚtypingrY   Úmesonlibr   rZ   Ú	envconfigr   Úenvironmentr   Zcompilers.compilersr   Úobjectr   r\   r   r   r   r#   r#   r#   r$   Ú<module>   s8   ú
ú
þ