a
    �¥»a  ã                   @   sL   d Z ddlZddlmZ e dej¡jZe dej¡jZ	G dd„ deƒZdS )zŒdistutils.extension

Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.

Overridden to support f2py.

é    N)Ú	Extensionz.*\.(cpp|cxx|cc)\Zz!.*\.(f90|f95|f77|for|ftn|f|pyf)\Zc                   @   s*   e Zd ZdZd	dd„Zdd„ Zdd„ ZdS )
r   a  
    Parameters
    ----------
    name : str
        Extension name.
    sources : list of str
        List of source file locations relative to the top directory of
        the package.
    extra_compile_args : list of str
        Extra command line arguments to pass to the compiler.
    extra_f77_compile_args : list of str
        Extra command line arguments to pass to the fortran77 compiler.
    extra_f90_compile_args : list of str
        Extra command line arguments to pass to the fortran90 compiler.
    Nc                 C   s¤   t j| |g |||||||	|
||d� || _|p0g | _t| jtƒrhdd l}d}|j|tdd� | j 	¡ | _|png | _
|| _|p~g | _|pˆg | _|p’g | _|pœg | _d S )N)
Úinclude_dirsÚdefine_macrosÚundef_macrosÚlibrary_dirsÚ	librariesÚruntime_library_dirsÚextra_objectsÚextra_compile_argsÚextra_link_argsÚexport_symbolsr   z4swig_opts is specified as a string instead of a listé   )Ú
stacklevel)Úold_ExtensionÚ__init__ÚsourcesÚ	swig_optsÚ
isinstanceÚstrÚwarningsÚwarnÚSyntaxWarningÚsplitÚdependsÚlanguageÚf2py_optionsÚmodule_dirsÚextra_f77_compile_argsÚextra_f90_compile_args)ÚselfÚnamer   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   Úmsg© r"   úS/home/yuhw/wc/pochoir/venv/lib/python3.9/site-packages/numpy/distutils/extension.pyr   !   s6    õ





zExtension.__init__c                 C   s"   | j D ]}tt|ƒƒr dS qdS ©NTF)r   Ú
cxx_ext_rer   ©r   Úsourcer"   r"   r#   Úhas_cxx_sources[   s    
zExtension.has_cxx_sourcesc                 C   s   | j D ]}t|ƒr dS qdS r$   )r   Úfortran_pyf_ext_rer&   r"   r"   r#   Úhas_f2py_sourcesa   s    
zExtension.has_f2py_sources)NNNNNNNNNNNNNNNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r(   r*   r"   r"   r"   r#   r      s*                    î
:r   )
r.   ÚreÚdistutils.extensionr   r   ÚcompileÚIÚmatchr%   r)   r"   r"   r"   r#   Ú<module>   s
   