File: //usr/local/lib/python3.7/site-packages/setuptools/command/__pycache__/build_clib.cpython-37.pyc
B
N��gG � @ sL d dl m mZ d dlmZ d dlmZ d dlm Z G dd� dej�ZdS )� N)�DistutilsSetupError)�log)�newer_pairwise_groupc @ s e Zd ZdZdd� ZdS )�
build_clibav
Override the default build_clib behaviour to do the following:
1. Implement a rudimentary timestamp-based dependency system
so 'compile()' doesn't run every time.
2. Add more keys to the 'build_info' dictionary:
* obj_deps - specify dependencies for each object compiled.
this should be a dictionary mapping a key
with the source filename to a list of
dependencies. Use an empty string for global
dependencies.
* cflags - specify a list of additional flags to pass to
the compiler.
c C s� �xx|D �]n\}}|� d�}|d ks2t|ttf�s>td| ��tt|��}t�d|� |� dt� �}t|t�sztd| ��g }|� dt� �}t|ttf�s�td| ��xX|D ]P}|g} | � |� |� |t� �}
t|
ttf�s�td| ��| � |
� |�
| � q�W | jj|| j
d�}t||�g g fk�r`|� d�}|� d �}
|� d
�}| jj|| j
||
|| jd� | jj||| j| jd� qW d S )
N�sourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' library�obj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list'� )�
output_dir�macros�include_dirs�cflags)r r
r Zextra_postargs�debug)r r
)�get�
isinstance�list�tupler �sortedr �info�dict�extend�append�compilerZobject_filenames�
build_tempr �compiler
Zcreate_static_libr )�self� librariesZlib_nameZ
build_infor r ZdependenciesZglobal_deps�sourceZsrc_depsZ
extra_depsZexpected_objectsr
r r � r �A/tmp/pip-unpacked-wheel-yrlplx0q/setuptools/command/build_clib.py�build_libraries sb
zbuild_clib.build_librariesN)�__name__�
__module__�__qualname__�__doc__r r r r r r s r )
Zdistutils.command.build_clib�commandr �orig�distutils.errorsr � distutilsr Zsetuptools.dep_utilr r r r r �<module> s