o
    c                     @  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 dgdZG dd deZdS )    )annotationsN   )EnvironmentException)MachineInfo)Environment)Compiler)plaindebugZdebugoptimizedreleaseZminsizeZcustomz-O0-Ooffz-O1z-O2z-O3z-O4)r   0g123sz-g)FTc                   @  s   e Zd ZdZd?ddZd@ddZdAddZdBddZdCddZdDddZ	d@ddZ
d@ddZd@ddZdEddZdFd"d#Zd@d$d%Zd@d&d'ZdGd)d*Zd@d+d,ZdHd/d0ZedId4d5ZdJd8d9ZdKd<d=Zd>S )L
TICompilerZtireturnNonec                 C  sL   | j std| jd | jd g }g ||g  |g  |g  d| _d S )Nz,TI compilers only support cross-compilation.ZasmZcla)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/ti.py__init__?   s   zTICompiler.__init__T.List[str]c                 C     g S Nr   r   r   r   r   get_pic_argsM   s   zTICompiler.get_pic_args	buildtypestrc                 C     t | S r   )ti_buildtype_args)r   r   r   r   r   get_buildtype_argsR      zTICompiler.get_buildtype_argsc                 C  s   dS )NZpchr   r   r   r   r   get_pch_suffixU      zTICompiler.get_pch_suffixpch_dirheaderc                 C  r   r   r   )r   r'   r(   r   r   r   get_pch_use_argsX   r&   zTICompiler.get_pch_use_argsenv'Environment'c                 C  r   r   r   )r   r*   r   r   r   thread_flags[   r&   zTICompiler.thread_flagsc                 C  r   r   r   r   r   r   r   get_coverage_args^   r&   zTICompiler.get_coverage_argsc                 C  r   r   r   r   r   r   r   get_no_stdinc_argsa   r&   zTICompiler.get_no_stdinc_argsc                 C  r   r   r   r   r   r   r   get_no_stdlib_link_argsd   r&   z"TICompiler.get_no_stdlib_link_argsoptimization_levelc                 C  r!   r   )ti_optimization_args)r   r0   r   r   r   get_optimization_argsg   r$   z TICompiler.get_optimization_argsis_debugboolc                 C  r!   r   )ti_debug_args)r   r3   r   r   r   get_debug_argsj   r$   zTICompiler.get_debug_argsc                 C  r   r   r   r   r   r   r   get_compile_only_argsm   r&   z TICompiler.get_compile_only_argsc                 C     dgS )Nr   r   r   r   r   r   get_no_optimization_argsp      z#TICompiler.get_no_optimization_argstargetc                 C  s   d| gS )Nz--output_file=r   )r   r;   r   r   r   get_output_argss   s   zTICompiler.get_output_argsc                 C  r8   )Nz--emit_warnings_as_errorsr   r   r   r   r   get_werror_argsv   r:   zTICompiler.get_werror_argspath	is_systemc                 C  s   |dkrd}d| gS )N .z-I=r   )r   r>   r?   r   r   r   get_include_argsy   s   
zTICompiler.get_include_argsargsinfor   c                 C  sX   g }|D ]%}| drd|dd   }| drq|dkrq| dr$q|| q|S )Nz-Dz	--define=   z-Wl,-rpath=z--print-search-dirsz-L)
startswithappend)clsrC   rD   resultir   r   r   _unix_args_to_native~   s   


zTICompiler._unix_args_to_nativeparameter_list	build_dirc              
   C  s   t |D ]B\}}|d d dkr'|d d tjtj||dd   ||< |d d dkrF|d d tjtj||dd   ||< q|S )N   z--include_path=rE   z-I)	enumerateosr>   normpathjoin)r   rL   rM   idxrJ   r   r   r   &compute_parameters_with_absolute_paths   s   ..z1TICompiler.compute_parameters_with_absolute_paths	outtargetoutfilec                 C  s   dd| gS )Nz--preproc_with_compilez--preproc_dependency=r   )r   rU   rV   r   r   r   get_dependency_gen_args   s   z"TICompiler.get_dependency_gen_argsN)r   r   )r   r   )r   r    r   r   )r   r    )r'   r    r(   r    r   r   )r*   r+   r   r   )r0   r    r   r   )r3   r4   r   r   )r;   r    r   r   )r>   r    r?   r4   r   r   )rC   r   rD   r   r   r   )rL   r   rM   r    r   r   )rU   r    rV   r    r   r   )__name__
__module____qualname__idr   r   r#   r%   r)   r,   r-   r.   r/   r2   r6   r7   r9   r<   r=   rB   classmethodrK   rT   rW   r   r   r   r   r   ;   s,    
















	r   )
__future__r   rP   typingTZmesonlibr   TYPE_CHECKINGZ	envconfigr   environmentr   Zcompilers.compilersr   objectr"   r1   r5   r   r   r   r   r   <module>   s:   
