
    -Phy
                        d Z ddlmZ ddlZddlmZ ej        rddlm	Z	 ddl
mZ dd	lmZ neZ G d
 de          Z G d de          Z G d de          ZdS )z$Provides mixins for Apple compilers.    )annotationsN   )MesonException)ImmutableListProtocol)Environment   )Compilerc                  >    e Zd ZU dZddgZded<   dd
ZddZddZdS )AppleCompilerMixinzJHandle differences between Vanilla Clang and the Clang shipped with XCode.z-Xpreprocessorz-fopenmpzImmutableListProtocol[str]#_AppleCompilerMixin__BASE_OMP_FLAGSenvr   returnT.List[str]c                    |j         | j                 }|
J d            |j                            d          rd}nd}| j        d| dgz   S )a6  Flags required to compile with OpenMP on Apple.

        The Apple Clang Compiler doesn't have builtin support for OpenMP, it
        must be provided separately. As such, we need to add the -Xpreprocessor
        argument so that an external OpenMP can be found.

        :return: A list of arguments
        Nfor mypyx86
/usr/local/opt/homebrewz-Iz/opt/libomp/include)machinesfor_machine
cpu_family
startswithr   )selfr   mroots       a/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mesonbuild/compilers/mixins/apple.pyopenmp_flagszAppleCompilerMixin.openmp_flags   sc     L)*}}j}}}<""5)) 	#DD"D$(FT(F(F(F'GGG    c                    |j         | j                 }|
J d            |j                            d          rd}nd}|                     d|| dg          }|st          d          | j        |z   S )Nr   r   r   r   ompz/opt/libomp/libzCouldn't find libomp)r   r   r   r   find_libraryr   r   )r   r   r   r   links        r   openmp_link_flagsz$AppleCompilerMixin.openmp_link_flags.   s    L)*}}j}}}<""5)) 	#DD"D  .F.F.F-GHH 	9 !7888$t++r   prelink_namestrobj_list!T.Tuple[T.List[str], T.List[str]]c                    |gddd|g|z   fS )Nz	-nostdlibz-rz-o )r   r$   r&   s      r   get_prelink_argsz#AppleCompilerMixin.get_prelink_args;   s    ~T4FQQQr   N)r   r   r   r   )r$   r%   r&   r   r   r'   )	__name__
__module____qualname____doc__r   __annotations__r   r#   r*   r)   r   r   r   r      sy         TT4Dj3QQQQQH H H H", , , ,R R R R R Rr   r   c                      e Zd ZdZdZdZdZdS )AppleCStdsMixinz2Provide version overrides for the Apple Compilers.z>=10.0.0z>=11.0.0N)r+   r,   r-   r.   _C17_VERSION_C18_VERSION_C2X_VERSIONr)   r   r   r1   r1   @   s#        <<LLLLLr   r1   c                      e Zd ZdZdZdZdS )AppleCPPStdsMixinz6Provide version overrides for the Apple C++ Compilers.z>=13.0.0z>=16.0.0N)r+   r,   r-   r.   _CPP23_VERSION_CPP26_VERSIONr)   r   r   r6   r6   I   s        @@NNNNr   r6   )r.   
__future__r   typingTmesonlibr   TYPE_CHECKING_typingr   environmentr   	compilersr	   objectr   r1   r6   r)   r   r   <module>rB      s   + * " " " " " "     & & & & & &? 	000000******$$$$$$$ H&R &R &R &R &R &R &R &RR    h                      r   