
_rYK                 @   sX   d  d l  Z d  d l Z d d l m Z d d l m Z m Z Gd d   d e  Z d S)    N   )EnvironmentException   )Compilermono_buildtype_argsc                   s*  e  Z d  Z   f d d   Z d d   Z d d   Z d d   Z d	 d
   Z d d   Z d d   Z	 d d   Z
 d d   Z d d   Z d d   Z d d   Z d d   Z d d   Z d d   Z d d    Z d! d"   Z d# d$   Z d% d&   Z d' d(   Z d) d*   Z d+ d,   Z d- d.   Z   S)/MonoCompilerc                s2   d |  _  t   j | |  d |  _ d |  _ d  S)NcsZmono)languagesuper__init__id
monorunner)selfexelistversion)	__class__ S/mnt/raid6/a/bak/reczko/tools/protein/utils/meson-0.42.1/mesonbuild/compilers/cs.pyr      s    		zMonoCompiler.__init__c             C   s   d S)NzC sharpr   )r   r   r   r   get_display_language   s    z!MonoCompiler.get_display_languagec             C   s   d | g S)Nz-out:r   )r   fnamer   r   r   get_output_args   s    zMonoCompiler.get_output_argsc             C   s   d | g S)Nz-r:r   )r   r   r   r   r   get_link_args"   s    zMonoCompiler.get_link_argsc             C   s   g  S)Nr   )r   prefix
shlib_namesuffixpath	soversionis_shared_moduler   r   r   get_soname_args%   s    zMonoCompiler.get_soname_argsc             C   s   d g S)Nz-warnaserrorr   )r   r   r   r   get_werror_args(   s    zMonoCompiler.get_werror_argsc             C   s
   d  | f S)Nr   )r   r   r   r   r   split_shlib_to_parts+   s    z!MonoCompiler.split_shlib_to_partsc             C   s   g  S)Nr   )r   	build_dirfrom_dirrpath_pathsbuild_rpathinstall_rpathr   r   r   build_rpath_args.   s    zMonoCompiler.build_rpath_argsc             C   s   g  S)Nr   )r   	outtargetoutfiler   r   r   get_dependency_gen_args1   s    z$MonoCompiler.get_dependency_gen_argsc             C   s   |  j  d  d   S)N)r   )r   r   r   r   get_linker_exelist4   s    zMonoCompiler.get_linker_exelistc             C   s   g  S)Nr   )r   r   r   r   get_compile_only_args7   s    z"MonoCompiler.get_compile_only_argsc             C   s   g  S)Nr   )r   
outputnamer   r   r   get_linker_output_args:   s    z#MonoCompiler.get_linker_output_argsc             C   s   g  S)Nr   )r   r   r   r   get_coverage_args=   s    zMonoCompiler.get_coverage_argsc             C   s   g  S)Nr   )r   r   r   r   get_coverage_link_args@   s    z#MonoCompiler.get_coverage_link_argsc             C   s   g  S)Nr   )r   r   r   r   get_std_exe_link_argsC   s    z"MonoCompiler.get_std_exe_link_argsc             C   s   g  S)Nr   )r   r   r   r   r   get_include_argsF   s    zMonoCompiler.get_include_argsc             C   s   g  S)Nr   )r   r   r   r   get_pic_argsI   s    zMonoCompiler.get_pic_argsc             C   s   d j  |  j  S)N )joinr   )r   r   r   r   name_stringL   s    zMonoCompiler.name_stringc             C   s   g  S)Nr   )r   pch_dirheaderr   r   r   get_pch_use_argsO   s    zMonoCompiler.get_pch_use_argsc             C   s   d S)N r   )r   header_namer   r   r   get_pch_nameR   s    zMonoCompiler.get_pch_namec       
   
   C   s   d } d } t  j j | |  } t | d   } | j d  Wd  QXt j |  j | g d | } | j   | j	 d k r t
 d |  j     n  |  j | g } t j | d | }	 |	 j   |	 j	 d k r t
 d |  j     n  d  S)	Nz	sanity.csz
sanity.exewz?public class Sanity {
    static public void Main () {
    }
}
cwdr   z*Mono compiler %s can not compile programs.z9Executables created by Mono compiler %s are not runnable.)osr   r4   openwrite
subprocessPopenr   wait
returncoder   r5   r   )
r   work_direnvironmentsrcobjsource_nameofilepccmdlistper   r   r   sanity_checkU   s    

zMonoCompiler.sanity_checkc             C   s   d S)NFr   )r   r   r   r   needs_static_linkeri   s    z MonoCompiler.needs_static_linkerc             C   s   t  | S)N)r   )r   	buildtyper   r   r   get_buildtype_argsl   s    zMonoCompiler.get_buildtype_args)__name__
__module____qualname__r   r   r   r   r   r   r    r&   r)   r*   r+   r-   r.   r/   r0   r1   r2   r5   r8   r;   rN   rO   rQ   r   r   )r   r   r      s.   r   )	os.pathr>   rA   mesonlibr   	compilersr   r   r   r   r   r   r   <module>   s   