
    -Ph                        d dl mZ 	 d dlZd dlZddlmZ ddlmZ ddl	m
Z
 dd	lmZ dd
lmZ ej        rddlmZ  G d de
          Z G d de          ZdS )    )annotationsN   )mesonlib   )CompileCheckMode   )GnuLikeCompiler)VisualStudioLikeCompiler	OptionKey)Environmentc                       e Zd ZU dZg ddgdZded<   g dgdgdgd	gd
gdgdZded<   dZd) fdZd*dZ	d+dZ
d,dZd-dZd. fd Zd/d!Zd/d"Zd0d%Zd1d'Zd2d(Z xZS )3IntelGnuLikeCompilerz
    Tested on linux for ICC 14.0.3, 15.0.6, 16.0.4, 17.0.1, 19.0
    debugoptimized: -g -O2
    release: -O3
    minsize: -O2
    z-gz
-tracebackFTT.Dict[bool, T.List[str]]
DEBUG_ARGSz-O0z-O1z-O2z-O3z-Osplain0g123sT.Dict[str, T.List[str]]
OPTIM_ARGSintelreturnNonec                x    t                                                       d dD             | _        d| _        d S )Nc                ,    h | ]}t          |          S  r   ).0os     a/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mesonbuild/compilers/mixins/intel.py	<setcomp>z0IntelGnuLikeCompiler.__init__.<locals>.<setcomp>F   s*     1 1 1aYq\\ 1 1 1    )b_pchb_lundef
b_asneededb_pgo
b_coverageb_ndebugb_staticpicb_pienone)super__init__base_optionslang_header)self	__class__s    r%   r2   zIntelGnuLikeCompiler.__init__?   sL    1 1 40 1 1 1 "r'   strc                    dS )Npchir"   r5   s    r%   get_pch_suffixz#IntelGnuLikeCompiler.get_pch_suffixK   s    vr'   pch_dirheaderT.List[str]c           	     \    ddt           j                            |          d| j        d|ddg	S )Nz-pchz-pch_dirz-xz-includer0   )ospathjoinr4   )r5   r<   r=   s      r%   get_pch_use_argsz%IntelGnuLikeCompiler.get_pch_use_argsN   s3    
BGLL$9$94 *fdFD 	Dr'   namec                p    t           j                            |          dz   |                                 z   S )N.)r@   rA   basenamer;   r5   rD   s     r%   get_pch_namez!IntelGnuLikeCompiler.get_pch_nameR   s.    w%%+d.A.A.C.CCCr'   envr   c                B    t          j        | j        d          rdgS dgS )Nz>=15.0.0z-qopenmpz-openmp)r   version_compareversionr5   rJ   s     r%   openmp_flagsz!IntelGnuLikeCompiler.openmp_flagsU   s)    #DL*== 	<;r'   moder   c                T    g d}t                                          |          |z   S )N)-diag-error10006rR   10148rR   10155rR   10156rR   10157rR   10158)r1   get_compiler_check_args)r5   rP   
extra_argsr6   s      r%   rY   z,IntelGnuLikeCompiler.get_compiler_check_args[   s3    
 
 

 ww..t44zAAr'   c                    dgS )Nz-prof-gen=threadsafer"   r:   s    r%   get_profile_generate_argsz.IntelGnuLikeCompiler.get_profile_generate_argsf   s    &''r'   c                    dgS )Nz	-prof-user"   r:   s    r%   get_profile_use_argsz)IntelGnuLikeCompiler.get_profile_use_argsi   s
    }r'   is_debugboolc                    | j         |         S Nr   r5   r_   s     r%   get_debug_argsz#IntelGnuLikeCompiler.get_debug_argsl       x((r'   optimization_levelc                    | j         |         S rb   r   r5   rg   s     r%   get_optimization_argsz*IntelGnuLikeCompiler.get_optimization_argso       122r'   c                
    ddgS )NrR   1292r"   rH   s     r%   !get_has_func_attribute_extra_argsz6IntelGnuLikeCompiler.get_has_func_attribute_extra_argsr   s    v&&r'   )r   r   )r   r7   )r<   r7   r=   r7   r   r>   )rD   r7   r   r7   rJ   r   r   r>   rP   r   r   r>   )r   r>   r_   r`   r   r>   rg   r7   r   r>   )rD   r7   r   r>   )__name__
__module____qualname____doc__r   __annotations__r   idr2   r;   rC   rI   rO   rY   r\   r^   re   rk   ro   __classcell__r6   s   @r%   r   r   '   s          \"- -J     WWWWWW, ,J     
B
" 
" 
" 
" 
" 
"   D D D DD D D D   	B 	B 	B 	B 	B 	B( ( ( (   ) ) ) )3 3 3 3' ' ' ' ' ' ' 'r'   r   c                       e Zd ZU dZg ddgdZded<   g dgdgdgd	gd
gdgdZded<   dZd" fdZd#dZ	d$dZ
d%dZd&dZd'd!Z xZS )(IntelVisualStudioLikeCompilerz4Abstractions for ICL, the Intel compiler on Windows.z/Ziz
/tracebackr   r   r   z/Odz/O1z/O2z/O3z/Osr   r   r   zintel-clrP   r   r   r>   c                    t                                          |          }|t          j        ur|                    g d           |S )N)z/Qdiag-error:10006z/Qdiag-error:10148z/Qdiag-error:10155z/Qdiag-error:10156z/Qdiag-error:10157z/Qdiag-error:10158)r1   rY   r   LINKextend)r5   rP   argsr6   s      r%   rY   z5IntelVisualStudioLikeCompiler.get_compiler_check_args   sU    ww..t44',,,KK       r'   T.Optional[str]c                    t          j        dg          \  }}}t          j        |                              d          ^}}}t	          ||z             }|                     |          S )Nzcl.exerF   )r   
Popen_safesearch_versionsplitint_calculate_toolset_version)r5   _errv1v2rM   s         r%   get_toolset_versionz1IntelVisualStudioLikeCompiler.get_toolset_version   sc     '
33	1c,S1177<<
Bb2g,,..w777r'   rJ   r   c                    dgS )Nz/Qopenmpr"   rN   s     r%   rO   z*IntelVisualStudioLikeCompiler.openmp_flags   s
    |r'   r_   r`   c                    | j         |         S rb   rc   rd   s     r%   re   z,IntelVisualStudioLikeCompiler.get_debug_args   rf   r'   rg   r7   c                    | j         |         S rb   ri   rj   s     r%   rk   z3IntelVisualStudioLikeCompiler.get_optimization_args   rl   r'   r=   c                @    t           j                            |          S rb   )r@   rA   rG   )r5   r=   s     r%   get_pch_base_namez/IntelVisualStudioLikeCompiler.get_pch_base_name   s    w'''r'   rq   )r   r   rp   rr   rs   )r=   r7   r   r7   )rt   ru   rv   rw   r   rx   r   ry   rY   r   rO   re   rk   r   rz   r{   s   @r%   r}   r}   v   s         >> l#- -J     WWWWWW, ,J     
B     8 8 8 8   ) ) ) )3 3 3 3( ( ( ( ( ( ( (r'   r}   )
__future__r   r@   typingT r   	compilersr   gnur	   visualstudior
   optionsr   TYPE_CHECKINGenvironmentr   r   r}   r"   r'   r%   <module>r      s   # " " " " " 
			           ( ( ( ( ( (             2 2 2 2 2 2            ? +******L' L' L' L' L'? L' L' L'^5( 5( 5( 5( 5($< 5( 5( 5( 5( 5(r'   