o
    :e3                     @  s  d dl mZ 	 d dlZd dlmZmZmZmZ ddl	m
Z
 ddl	mZ ddlmZ ddlmZ dd	lmZmZmZmZmZmZ dd
lmZ ddlmZ ddlmZmZ G dd deZG dd deZG dd deZ G dd de Z!G dd deZ"G dd deZ#G dd deZ$G dd deZ%G dd deZ&G d d! d!eZ'G d"d# d#eZ(G d$d% d%eZ)G d&d' d'eZ*G d(d) d)eZ+G d*d+ d+e"Z,G d,d- d-eZ-G d.d/ d/e"Z.G d0d1 d1eZ/G d2d3 d3eZ0G d4d5 d5eZ1G d6d7 d7eZ2G d8d9 d9eZ3G d:d; d;eZ4G d<d= d=eZ5G d>d? d?e"e#Z6G d@dA dAeZ7G dBdC dCeZ8G dDdE dEeZ9G dFdG dGeZ:G dHdI dIeZ;G dJdK dKeZ<G dLdM dMeZ=G dNdO dOe"Z>G dPdQ dQe"Z?G dRdS dSeZ@G dTdU dUe@ZAG dVdW dWeZBG dXdY dYeAZCG dZd[ d[eZDG d\d] d]eAeDeBZEG d^d_ d_eZFG d`da daeAeFeBZGG dbdc dceAeBZHG ddde deeAeFeDeBZIG dfdg dgeIZJG dhdi die@ZKG djdk dkeZLdS )l    )annotationsN)	TypedDictLiteralProtocolNotRequired   )build)coredata)Compiler)
Dependency)EnvironmentVariablesMachineChoiceFileFileModeFileOrString	OptionKey)CMakeSubprojectOptions)ExternalProgram   )PkgConfigDefineTypeSourcesVarargsTypec                   @  s"   e Zd ZU dZded< ded< dS )FuncAddProjectArgsa  Keyword Arguments for the add_*_arguments family of arguments.

    including `add_global_arguments`, `add_project_arguments`, and their
    link variants

    Because of the use of a convertor function, we get the native keyword as
    a MachineChoice instance already.
    r   nativeT.List[str]languageN__name__
__module____qualname____doc____annotations__ r!   r!   B/usr/lib/python3.10/site-packages/mesonbuild/interpreter/kwargs.pyr      s   
 	r   c                   @  sR   e Zd ZU dZded< ded< ded< ded	< d
ed< ded< ded< ded< dS )BaseTestz Shared base for the Rust module.z(T.List[T.Union[str, File, build.Target]]argsboolZshould_failinttimeoutT.Optional[str]Zworkdirz6T.List[T.Union[build.CustomTarget, build.BuildTarget]]dependspriorityr   envr   ZsuiteNr   r!   r!   r!   r"   r#   $   s   
 r#   c                   @     e Zd ZU dZded< dS )FuncBenchmarkz8Keyword Arguments shared between `test` and `benchmark`.z+Literal['exitcode', 'tap', 'gtest', 'rust']ZprotocolNr   r!   r!   r!   r"   r-   2   s   
 r-   c                   @  r,   )FuncTestzKeyword Arguments for `test`

    `test` only adds the `is_parallel` argument over benchmark, so inheritance
    is helpful here.
    r%   Zis_parallelNr   r!   r!   r!   r"   r.   9      
 r.   c                   @  r,   )ExtractRequiredzKeyword Arguments consumed by the `extract_required_kwargs` function.

    Any function that uses the `required` keyword argument which accepts either
    a boolean or a feature option should inherit it's arguments from this class.
    z)T.Union[bool, coredata.UserFeatureOption]requiredNr   r!   r!   r!   r"   r0   D   r/   r0   c                   @  r,   )ExtractSearchDirszlKeyword arguments consumed by the `extract_search_dirs` function.

    See the not in `ExtractRequired`
    r   dirsNr   r!   r!   r!   r"   r2   O   s   
 r2   c                   @  s:   e Zd ZU dZded< ded< ded< ded< d	ed
< dS )FuncGeneratorz,Keyword rguments for the generator function.r   	argumentsoutputr(   depfiler%   capture6T.List[T.Union[build.BuildTarget, build.CustomTarget]]r)   Nr   r!   r!   r!   r"   r4   Y      
 r4   c                   @  s*   e Zd ZU dZded< ded< ded< dS )	GeneratorProcessz(Keyword Arguments for generator.process.r(   Zpreserve_path_fromr   
extra_argsr   r+   Nr   r!   r!   r!   r"   r;   d   s
   
 r;   c                   @  s:   e Zd ZU dZded< ded< ded< ded< ded< dS )	!DependencyMethodPartialDependencyz: Keyword Arguments for the dep.partial_dependency methods r%   compile_args	link_argsZlinksincludessourcesNr   r!   r!   r!   r"   r=   l   r:   r=   c                   @     e Zd ZU ded< dS )!BuildTargeMethodExtractAllObjectsr%   	recursiveNr   r   r   r    r!   r!   r!   r"   rC   v   s   
 rC   c                   @  s>   e Zd ZU ded< ded< ded< ded< ded	< d
ed< dS )FuncInstallSubdirstrinstall_dirr%   Zstrip_directoryr   Zexclude_filesZexclude_directoriesr   install_modeT.Optional[bool]follow_symlinksNrE   r!   r!   r!   r"   rF   y      
 rF   c                   @  6   e Zd ZU ded< ded< ded< ded< d	ed
< dS )FuncInstallDatarG   rH   T.List[FileOrString]rA   r   renamer   rI   rJ   rK   NrE   r!   r!   r!   r"   rN         
 rN   c                   @  s.   e Zd ZU ded< ded< ded< ded< dS )	FuncInstallHeadersr(   rH   r   rI   ZsubdirrJ   rK   NrE   r!   r!   r!   r"   rR      
   
 rR   c                   @  s&   e Zd ZU ded< ded< ded< dS )FuncInstallManr(   rH   r   rI   localeNrE   r!   r!   r!   r"   rT         
 rT   c                   @  rB   )FuncImportModuler%   ZdisablerNrE   r!   r!   r!   r"   rW         
 rW   c                   @  rB   )FuncIncludeDirectoriesr%   Z	is_systemNrE   r!   r!   r!   r"   rY      rX   rY   c                   @  rB   )FuncAddLanguagesrJ   r   NrE   r!   r!   r!   r"   rZ      rX   rZ   c                   @  &   e Zd ZU ded< ded< ded< dS )	RunTargetzRT.List[T.Union[str, build.BuildTarget, build.CustomTarget, ExternalProgram, File]]commandr9   r)   r   r+   NrE   r!   r!   r!   r"   r\      rV   r\   c                   @  s   e Zd ZU ded< ded< ded< ded< ded< ded	< d
ed< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< dS )CustomTargetr%   Zbuild_alwaysrJ   Zbuild_always_stalebuild_by_defaultr8   kT.List[T.Union[str, build.BuildTarget, build.CustomTarget, build.CustomTargetIndex, ExternalProgram, File]]r]   ZconsolerO   depend_filesr9   r)   r(   r7   r   r+   feedT.List[T.Union[str, build.BuildTarget, build.CustomTarget, build.CustomTargetIndex, build.ExtractedObjects, build.GeneratedList, ExternalProgram, File]]inputinstallz&T.List[T.Union[str, T.Literal[False]]]rH   r   rI   zT.List[T.Optional[str]]install_tagr   r6   NrE   r!   r!   r!   r"   r^      s$   
 r^   c                   @  s>   e Zd ZU ded< ded< ded< ded< ded	< d
ed< dS )AddTestSetupz%T.List[T.Union[str, ExternalProgram]]Zexe_wrapperr%   Zgdbr&   Ztimeout_multiplierZ
is_defaultr   Zexclude_suitesr   r+   NrE   r!   r!   r!   r"   rg      rL   rg   c                   @  rM   )ProjectzT.Optional[FileOrString]versionr(   Zmeson_version7T.Dict[OptionKey, T.Union[str, int, bool, T.List[str]]]default_optionsr   licenserG   Zsubproject_dirNrE   r!   r!   r!   r"   rh      rQ   rh   c                   @  s   e Zd ZdZdddZdS )_FoundProtozrProtocol for subdir arguments.

    This allows us to define any object that has a found(self) -> bool method
    returnr%   c                 C  s   d S )Nr!   )selfr!   r!   r"   found   s    z_FoundProto.foundN)rn   r%   )r   r   r   r   rp   r!   r!   r!   r"   rm      s    rm   c                   @  rB   )SubdirzT.List[_FoundProto]Zif_foundNrE   r!   r!   r!   r"   rq      rX   rq   c                   @  r[   )SummaryrG   sectionr%   Zbool_ynr(   Zlist_sepNrE   r!   r!   r!   r"   rr      rV   rr   c                   @  r[   )FindProgramrj   rk   r   r   r   ri   NrE   r!   r!   r!   r"   rt      rV   rt   c                   @  r[   )
RunCommandr%   checkrJ   r8   r   r+   NrE   r!   r!   r!   r"   ru      rV   ru   c                   @  rB   )FeatureOptionRequirer(   Zerror_messageNrE   r!   r!   r!   r"   rw      rX   rw   c                   @     e Zd ZU ded< ded< dS )DependencyPkgConfigVarr(   defaultr   Zdefine_variableNrE   r!   r!   r!   r"   ry        
 ry   c                   @  s>   e Zd ZU ded< ded< ded< ded< ded< ded< d	S )
DependencyGetVariabler(   ZcmakeZ	pkgconfigZ
configtoolZinternaldefault_valuer   Zpkgconfig_defineNrE   r!   r!   r!   r"   r|     rL   r|   c                   @  rB   )ConfigurationDataSetr(   descriptionNrE   r!   r!   r!   r"   r~     rX   r~   c                   @  rM   )VcsTagr`   r]   r(   fallbackrc   rd   r   r6   rG   Zreplace_stringNrE   r!   r!   r!   r"   r     s   
 r   c                   @  s~   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< ded< d	ed< ded< ded< ded< ded< d	ed< dS )ConfigureFilerG   r6   r%   r8   z%T.Literal['meson', 'cmake', 'cmake@']formatzT.Literal['c', 'json', 'nasm']Zoutput_formatr(   r7   rJ   re   zT.Union[str, T.Literal[False]]rH   r   rI   rf   encodingzST.Optional[T.List[T.Union[build.Executable, ExternalProgram, Compiler, File, str]]]r]   rO   rd   zRT.Optional[T.Union[T.Dict[str, T.Union[str, int, bool]], build.ConfigurationData]]configurationZ
macro_nameNrE   r!   r!   r!   r"   r      s   
 r   c                   @  rx   )
Subprojectrj   rk   r   ri   NrE   r!   r!   r!   r"   r   2  r{   r   c                   @  .   e Zd ZU ded< ded< ded< ded< dS )	DoSubprojectrj   rk   r   ri   Zcmake_optionsz"T.Optional[CMakeSubprojectOptions]optionsNrE   r!   r!   r!   r"   r   8  rS   r   c                   @  s   e Zd ZU dZded< ded< ded< ded< ded	< d
ed< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< dS )_BaseBuildTargetzArguments used by all BuildTarget like functions.

    This really exists because Jar is so different than all of the other
    BuildTarget functions.
    r%   r_   rG   Zbuild_rpathrO   extra_filesZgnu_symbol_visibilityre   r   rI   Zinstall_rpathZimplicit_include_directorieszZT.List[T.Union[str, File, build.CustomTarget, build.CustomTargetIndex, build.BuildTarget]]Zlink_dependsr(   Zlink_languageZname_prefixZname_suffixr   r   zT.List[build.ObjectTypes]objectsrj   Zoverride_optionszNotRequired[T.List[File]]ra   r   	resourcesNr   r!   r!   r!   r"   r   @  s&   
 r   c                   @  s   e Zd ZU dZded< ded< ded< ded< d	ed
< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< dS )_BuildTargetz%Arguments shared by non-JAR functionsT.List[T.Union[str, int]]Zd_debugz'T.List[T.Union[str, build.IncludeDirs]]d_import_dirsd_module_versionsr%   Z
d_unittestT.Dict[str, str]Zrust_dependency_mapr   rA   r   Zc_argsZcpp_argsZ	cuda_argsZfortran_argsZd_argsZ	objc_argsZobjcpp_argsZ	rust_argszT.List[T.Union[str, File]]Z	vala_argsZcs_argsZ
swift_argsZcython_argsZ	nasm_argsZ	masm_argsNr   r!   r!   r!   r"   r   [  s,   
 r   c                   @  rB   )_LibraryMixinz T.Optional[Literal['c', 'rust']]Zrust_abiNrE   r!   r!   r!   r"   r   u  rX   r   c                   @  s>   e Zd ZU ded< ded< ded< ded< ded< d	ed
< dS )
ExecutablerJ   Zexport_dynamicZgui_appzT.Optional[T.Union[str, bool]]ZimplibZpieKT.Optional[T.Union[str, File, build.CustomTarget, build.CustomTargetIndex]]vs_module_defsr(   Zwin_subsystemNrE   r!   r!   r!   r"   r   z  rL   r   c                   @  rx   )_StaticLibMixinr%   ZprelinkrJ   ZpicNrE   r!   r!   r!   r"   r     r{   r   c                   @     e Zd ZdS )StaticLibraryNr   r   r   r!   r!   r!   r"   r         r   c                   @  r   )	_SharedLibMixinzT.Optional[T.Tuple[str, str]]Zdarwin_versionsr(   	soversionri   r   r   NrE   r!   r!   r!   r"   r     rS   r   c                   @  r   )SharedLibraryNr   r!   r!   r!   r"   r     r   r   c                   @  rB   )SharedModuler   r   NrE   r!   r!   r!   r"   r     rX   r   c                   @  s   e Zd ZU dZded< ded< ded< ded< ded< ded< ded	< ded
< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< d S )!Libraryz9For library, both_library, and as a base for build_targetzNotRequired[T.List[str]]Zc_static_argsZc_shared_argsZcpp_static_argsZcpp_shared_argsZcuda_static_argsZcuda_shared_argsZfortran_static_argsZfortran_shared_argsZd_static_argsZd_shared_argsZobjc_static_argsZobjc_shared_argsZobjcpp_static_argsZobjcpp_shared_argsZrust_static_argsZrust_shared_argsz'NotRequired[T.List[T.Union[str, File]]]Zvala_static_argsZvala_shared_argsZcs_static_argsZcs_shared_argsZswift_static_argsZswift_shared_argsZcython_static_argsZcython_shared_argsZnasm_static_argsZnasm_shared_argsZmasm_static_argsZmasm_shared_argsNr   r!   r!   r!   r"   r     s<   
 r   c                   @  rB   )BuildTargetznLiteral['executable', 'shared_library', 'static_library', 'shared_module', 'both_libraries', 'library', 'jar']Ztarget_typeNrE   r!   r!   r!   r"   r     rX   r   c                   @  s.   e Zd ZU ded< ded< ded< ded< d	S )
JarrG   Z
main_classz#T.Optional[build.StructuredSources]Zjava_resourceszT.Union[str, File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList, build.ExtractedObjects, build.BuildTarget]rA   r   Z	java_argsNrE   r!   r!   r!   r"   r     rS   r   c                   @  sv   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< ded< ded< ded< ded< ded< ded< dS )FuncDeclareDependencyr   r>   z'T.List[T.Union[build.IncludeDirs, str]]r   r   r   zT.List[Dependency]dependenciesrO   r   Zinclude_directoriesr?   zQT.List[T.Union[build.StaticLibrary, build.CustomTarget, build.CustomTargetIndex]]Z
link_wholezT.List[build.LibTypes]Z	link_withzT.List[build.ExtractedObjects]r   z3T.List[T.Union[FileOrString, build.GeneratedTypes]]rA   r   	variablesr(   ri   NrE   r!   r!   r!   r"   r     s   
 r   )M
__future__r   typingTtyping_extensionsr   r   r   r    r   r	   	compilersr
   Zdependencies.baser   Zmesonlibr   r   r   r   r   r   Zmodules.cmaker   Zprogramsr   Ztype_checkingr   r   r   r#   r-   r.   r0   r2   r4   r;   r=   rC   rF   rN   rR   rT   rW   rY   rZ   r\   r^   rg   rh   rm   rq   rr   rt   ru   rw   ry   r|   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r!   r!   r!   r"   <module>   sv    


	
	


"