o
    cd                     @  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d	gd	gd
gdgdgddgdZg dgdZG dd deZdS )    )annotationsN   )EnvironmentException)MachineInfo)Environment)Compiler)plaindebugZdebugoptimizedreleaseZminsizeZcustomz-optimize=0z-optimize=1z-optimize=2z-optimize=maxz-size)0g123sz-debug)FTc                   @  s   e Zd ZejrdZe ZdZd/ddZ	d0dd	Z
d1ddZd2ddZd3ddZd4ddZd0ddZd0ddZd0ddZd5dd Zd6d#d$Zed7d(d)Zd8d,d-Zd.S )9CcrxCompilerTZ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   Z
everything)is_crossr   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/ccrx.py__init__B   s   zCcrxCompiler.__init__T.List[str]c                 C     g S Nr   r   r   r   r   get_pic_argsN   s   zCcrxCompiler.get_pic_args	buildtypestrc                 C     t | S r   )ccrx_buildtype_args)r   r!   r   r   r   get_buildtype_argsS      zCcrxCompiler.get_buildtype_argsc                 C  s   dS )NZpchr   r   r   r   r   get_pch_suffixV      zCcrxCompiler.get_pch_suffixpch_dirheaderc                 C  r   r   r   )r   r)   r*   r   r   r   get_pch_use_argsY   r(   zCcrxCompiler.get_pch_use_argsenv'Environment'c                 C  r   r   r   )r   r,   r   r   r   thread_flags\   r(   zCcrxCompiler.thread_flagsc                 C  r   r   r   r   r   r   r   get_coverage_args_   r(   zCcrxCompiler.get_coverage_argsc                 C  r   r   r   r   r   r   r   get_no_stdinc_argsb   r(   zCcrxCompiler.get_no_stdinc_argsc                 C  r   r   r   r   r   r   r   get_no_stdlib_link_argse   r(   z$CcrxCompiler.get_no_stdlib_link_argsoptimization_levelc                 C  r#   r   )ccrx_optimization_args)r   r2   r   r   r   get_optimization_argsh   r&   z"CcrxCompiler.get_optimization_argsis_debugboolc                 C  r#   r   )ccrx_debug_args)r   r5   r   r   r   get_debug_argsk   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)clsr9   r:   resultir   r   r   _unix_args_to_nativen   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	   r<   )	enumerateospathnormpathjoin)r   rD   rE   idxrB   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"   )r)   r"   r*   r"   r   r   )r,   r-   r   r   )r2   r"   r   r   )r5   r6   r   r   )r9   r   r:   r   r   r   )rD   r   rE   r"   r   r   )__name__
__module____qualname__TTYPE_CHECKINGr   setr   idr   r    r%   r'   r+   r.   r/   r0   r1   r4   r8   classmethodrC   rM   r   r   r   r   r   :   s&    










r   )
__future__r   rH   typingrQ   Zmesonlibr   rR   Z	envconfigr   environmentr   Zcompilers.compilersr   objectr$   r3   r7   r   r   r   r   r   <module>   s8   

