B
    ›³ëb½  ã               @   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Z	dd„ Z
ejj ¡ Zej dd	¡Zejjed
de
edZdd„ Zdd„ ZdS )zìSCons.Tool.midl

Tool-specific initialization for midl (Microsoft IDL compiler).

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é   )Úmsvc_setup_env_toolZmidlc             C   sŠ   t j t| d ƒ¡\}}| d }|d }|d }|||g}|d }	|	 d¡dkrb|d }
| |
¡ |	 d¡dkr‚|d	 }| |¡ ||fS )
z1Produces a list of outputs from the MIDL compilerr   z.hz_i.cÚMIDLCOMz/proxyéÿÿÿÿz_p.cz/dlldataz_data.c)ÚSConsÚUtilÚsplitextÚstrÚfindÚappend)ÚtargetÚsourceÚenvÚbaseÚ_ZtlbZinclZ	interfaceZtargetsZmidlcomÚproxyZdlldata© r   ú.lib/python3.7/site-packages/SCons/Tool/midl.pyÚmidl_emitter-   s    


r   z$MIDLCOMz$MIDLCOMSTRz.idlz.tlb)ÚactionZ
src_suffixÚsuffixZemitterZsource_scannerc             C   s0   d| d< t j d¡| d< d| d< t| d d< d	S )
zCAdd Builders and construction variables for midl to an Environment.zMIDL.EXEZMIDLz/nologoZ	MIDLFLAGSz‚$MIDL $MIDLFLAGS /tlb ${TARGETS[0]} /h ${TARGETS[1]} /iid ${TARGETS[2]} /proxy ${TARGETS[3]} /dlldata ${TARGETS[4]} $SOURCE 2> NULr   ZBUILDERSZTypeLibraryN)r   r   ZCLVarÚmidl_builder)r   r   r   r   ÚgenerateL   s    r   c             C   s   t | tdS )N)Ztool)r   Ú	tool_name)r   r   r   r   ÚexistsU   s    r   )Ú__doc__ZSCons.Actionr   ZSCons.BuilderZSCons.DefaultsZSCons.Scanner.IDLZ
SCons.UtilZMSCommonr   r   r   ÚScannerZIDLZIDLScanZidl_scannerZActionZmidl_actionZBuilderr   r   r   r   r   r   r   Ú<module>    s"   	