
    -PhW                        d dl mZ 	 d dlZddlmZ ddlmZmZ ddl	m
Z
 ej        rddlmZ dd	lmZ dd
lmZ  G d de
          ZdS )    )annotationsN   )options)EnvironmentExceptionversion_compare   )Compiler)MutableKeyedOptionDictType)Environment)BuildTargetc                       e Zd ZdZdZdZd$dZd%dZd%dZd&dZ	d'dZ
d(dZd)dZd*dZd%dZd+dZd, fdZd-d.d#Z xZS )/CythonCompilerzCython Compiler.cythonreturnboolc                    dS )NF selfs    [/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mesonbuild/compilers/cython.pyneeds_static_linkerz"CythonCompiler.needs_static_linker   s    u    T.List[str]c                    dgS )Nz--fast-failr   r   s    r   get_always_argszCythonCompiler.get_always_args   s
    r   c                    dgS )Nz-Werrorr   r   s    r   get_werror_argszCythonCompiler.get_werror_args!   s
    {r   
outputnamestrc                
    d|gS )Nz-or   )r   r   s     r   get_output_argszCythonCompiler.get_output_args$   s    j!!r   optimization_levelc                    g S Nr   )r   r"   s     r   get_optimization_argsz$CythonCompiler.get_optimization_args'   s	     	r   	outtargetoutfilec                6    t          | j        d          rdgS g S )Nz	>=0.29.33z-M)r   version)r   r&   r'   s      r   get_dependency_gen_argsz&CythonCompiler.get_dependency_gen_args,   s"    4<55 	6M	r   c                    dS )Ndepr   r   s    r   get_depfile_suffixz!CythonCompiler.get_depfile_suffix1   s    ur   work_direnvironment'Environment'Nonec                    d}|                      ||j                  5 }|j        dk    rt          d| j        d          	 d d d            d S # 1 swxY w Y   d S )Nzprint("hello world")r   zCython compiler z cannot compile programs)cached_compilecoredata
returncoder   id)r   r.   r/   codeps        r   sanity_checkzCythonCompiler.sanity_check4   s    %  {';<< 	c|q  *+adg+a+a+abbb !	c 	c 	c 	c 	c 	c 	c 	c 	c 	c 	c 	c 	c 	c 	c 	c 	c 	cs   $AAAc                    g S r$   r   r   s    r   get_pic_argszCythonCompiler.get_pic_args:   s    	r   parameter_list	build_dirc                >    g }|D ]}|                     |           |S r$   )append)r   r<   r=   newis        r   &compute_parameters_with_absolute_pathsz5CythonCompiler.compute_parameters_with_absolute_paths>   s,     	 	AJJqMMMM
r   'MutableKeyedOptionDictType'c                \   t                                                      }|                     d          }t          j        |                     |          ddddg          ||<   |                     d          }t          j        |                     |          dddd	g          ||<   |S )
Nr)   zPython version to target32)choiceslanguagezOutput C or C++ filesccpp)superget_optionsform_compileropt_keyr   UserComboOptionmake_option_name)r   optskey	__class__s      r   rL   zCythonCompiler.get_optionsF   s    ww""$$''	22+!!#&&&#J	     S	 ''
33+!!#&&#%L	" " "S	 r   Ntarget'BuildTarget'env
subprojectT.Optional[str]c                ,   g }|                      d|||          }t          |t                    sJ |                    d|            |                      d|||          }t          |t                    sJ |dk    r|                    d           |S )Nr)   -rH   rJ   z--cplus)get_compileropt_value
isinstancer   r?   )r   rS   rU   rV   argsr)   langs          r   get_option_compile_argsz&CythonCompiler.get_option_compile_argsY   s    ,,YVZPP'3'''''MMM"""))*c6:NN$$$$$$5==KK	"""r   )r   r   )r   r   )r   r   r   r   )r"   r   r   r   )r&   r   r'   r   r   r   )r   r   )r.   r   r/   r0   r   r1   )r<   r   r=   r   r   r   )r   rC   r$   )rS   rT   rU   r0   rV   rW   r   r   )__name__
__module____qualname____doc__rH   r6   r   r   r   r!   r%   r*   r-   r9   r;   rB   rL   r^   __classcell__)rR   s   @r   r   r      s2       H	B         " " " "   
   
   c c c c           &
 
 
 
 
 
 
 
 
r   r   )
__future__r   typingT r   mesonlibr   r   	compilersr	   TYPE_CHECKINGr
   r/   r   buildr   r   r   r   r   <module>rl      s    # " " " " " 0           < < < < < < < <      ? $444444))))))######P P P P PX P P P P Pr   