B
    ›³ëbB  ã               @   s^   d Z ddlZddlZddlZddlZddlZddlmZ ddl	m
Z
 dgZdd„ Zdd	„ ZdS )
zÂTool-specific initialization for clang.

There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
é    N)Úget_clang_install_dirs)Úmsvc_setup_env_onceÚclangc          	   C   s.  t jj | ¡ | d dkr\t jj| td t| d ƒd}|r\tj 	|¡}|  
d|¡ t| ƒ |  t¡phd| d< | d dkrŒt j d	¡| d
< nt j d¡| d
< | d rt jj| | d dgddtjd}| ¡ dkrÖdS |j |j ¡ }W dQ R X | ¡ }t d|¡}|r| d¡| d< d| d< d| d< dS )zDAdd Builders and construction variables for clang to an Environment.ZPLATFORMÚwin32r   )Zdefault_pathsÚPATHr   ZCC)Úcygwinr   z$CCFLAGSZ	SHCCFLAGSz$CCFLAGS -fPICz	--versionÚdevnull)ÚstdinÚstderrÚstdoutNz%clang +version +([0-9]+(?:\.[0-9]+)+)é   Z	CCVERSIONz-MMD -MF ${TARGET}.dZ
CCDEPFLAGSZNINJA_DEPFILE_PARSE_FORMAT)ÚSConsZToolZccÚgenerateZfind_program_pathÚ	compilersr   ÚosÚpathÚdirnameZAppendENVPathr   ÚDetectZUtilZCLVarZActionZ_subprocÚ
subprocessÚPIPEÚwaitr   ÚreadlineÚdecodeÚreÚsearchÚgroup)Úenvr   Zclang_bin_dirÚpipeÚlineÚmatch© r    ú/lib/python3.7/site-packages/SCons/Tool/clang.pyr   /   s6    

 r   c             C   s
   |   t¡S )N)r   r   )r   r    r    r!   ÚexistsX   s    r"   )Ú__doc__r   r   r   Z
SCons.Utilr   ZSCons.Tool.ccZSCons.Tool.clangCommonr   ZSCons.Tool.MSCommonr   r   r   r"   r    r    r    r!   Ú<module>   s   )