a
    ˜¥»a  ã                   @   sB   d d„ Z d
dd„Zedkr>ddlmZ ef i edd	� ¡ ¤Ž dS )c           	      C   sš   ddl m}m}m}m} | j}|j}|| |ƒ |jdkrD| d¡ nR||dd�}|rŠ|j	 d¡ ||dƒr‚| d¡ |j
 d¡ ntd	ƒ‚|||d
ƒ d S )Né    )Úset_cxx_flags_hookÚtry_add_flagÚtry_compileÚhas_flagZmsvcz/EHscz7#include <pthread.h>
int main(int argc, char **argv) {})Úcode)ZPOCKETFFT_PTHREADSNz-pthreadzSBuild failed: System has pthreads header but could not compile with -pthread optionz-fvisibility=hidden)Z"scipy._build_utils.compiler_helperr   r   r   r   Z_cxx_compilerÚextra_compile_argsÚcompiler_typeÚappendÚdefine_macrosÚextra_link_argsÚRuntimeError)	Ú	build_extÚextr   r   r   r   ÚccÚargsZhas_pthreads© r   úT/home/yuhw/wc/pochoir/venv/lib/python3.9/site-packages/scipy/fft/_pocketfft/setup.pyÚpre_build_hook   s    



r   Ú Nc                 C   sj   ddl m} dd l}| d¡| d¡g}|d| |ƒ}|jddgdg|d	d
�}t|_| d¡ | d¡ |S )Nr   )ÚConfigurationTFZ
_pocketfftZpypocketfftzpypocketfft.cxxzpocketfft_hdronly.hzc++)ÚsourcesÚdependsÚinclude_dirsÚlanguagez
LICENSE.mdÚtests)	Znumpy.distutils.misc_utilr   Úpybind11Zget_includeÚadd_extensionr   Z_pre_build_hookZadd_data_filesZadd_data_dir)Úparent_packageÚtop_pathr   r   r   Úconfigr   r   r   r   Úconfiguration   s    ü

r    Ú__main__r   )Úsetup)r   )r   N)r   r    Ú__name__Znumpy.distutils.corer"   Ztodictr   r   r   r   Ú<module>   s   
