
    :e3                       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e      Z G d de      Z G d de      Z  G d de       Z! G d de      Z" G d de      Z# G d de      Z$ G d de      Z% G d de      Z& G d  d!e      Z' G d" d#e      Z( G d$ d%e      Z) G d& d'e      Z* G d( d)e      Z+ G d* d+e"      Z, G d, d-e      Z- G d. d/e"      Z. G d0 d1e      Z/ G d2 d3e      Z0 G d4 d5e      Z1 G d6 d7e      Z2 G d8 d9e      Z3 G d: d;e      Z4 G d< d=e      Z5 G d> d?e"e#      Z6 G d@ dAe      Z7 G dB dCe      Z8 G dD dEe      Z9 G dF dGe      Z: G dH dIe      Z; G dJ dKe      Z< G dL dMe      Z= G dN dOe"      Z> G dP dQe"      Z? G dR dSe      Z@ G dT dUe@      ZA G dV dWe      ZB G dX dYeA      ZC G dZ d[e      ZD G d\ d]eAeDeB      ZE G d^ d_e      ZF G d` daeAeFeB      ZG G db dceAeB      ZH G dd deeAeFeDeB      ZI G df dgeI      ZJ G dh die@      ZK G dj dke      ZLy)l    )annotationsN)	TypedDictLiteralProtocolNotRequired   )build)coredata)Compiler)
Dependency)EnvironmentVariablesMachineChoiceFileFileModeFileOrString	OptionKey)CMakeSubprojectOptions)ExternalProgram   )PkgConfigDefineTypeSourcesVarargsTypec                  &    e Zd ZU dZded<   ded<   y)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__     ?/usr/lib/python3/dist-packages/mesonbuild/interpreter/kwargs.pyr   r      s     r$   r   c                  b    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<   y)BaseTestz Shared base for the Rust module.z(T.List[T.Union[str, File, build.Target]]argsboolshould_failinttimeoutT.Optional[str]workdirz6T.List[T.Union[build.CustomTarget, build.BuildTarget]]dependspriorityr   envr   suiteNr   r#   r$   r%   r'   r'   $   s3    *
22LCCM	r$   r'   c                      e Zd ZU dZded<   y)FuncBenchmarkz8Keyword Arguments shared between `test` and `benchmark`.z+Literal['exitcode', 'tap', 'gtest', 'rust']protocolNr   r#   r$   r%   r4   r4   2   s    B99r$   r4   c                      e Zd ZU dZded<   y)FuncTestzKeyword Arguments for `test`

    `test` only adds the `is_parallel` argument over benchmark, so inheritance
    is helpful here.
    r)   is_parallelNr   r#   r$   r%   r7   r7   9   s     r$   r7   c                      e Zd ZU dZded<   y)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:   r:   D   s     87r$   r:   c                      e Zd ZU dZded<   y)ExtractSearchDirszlKeyword arguments consumed by the `extract_search_dirs` function.

    See the not in `ExtractRequired`
    r   dirsNr   r#   r$   r%   r=   r=   O   s    
 r$   r=   c                  D    e Zd ZU dZded<   ded<   ded<   ded<   d	ed
<   y)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@   r@   Y   s"    6NCCr$   r@   c                  0    e Zd ZU dZded<   ded<   ded<   y)	GeneratorProcessz(Keyword Arguments for generator.process.r-   preserve_path_fromr   
extra_argsr   r1   Nr   r#   r$   r%   rG   rG   d   s    2''	r$   rG   c                  D    e Zd ZU dZded<   ded<   ded<   ded<   ded<   y)	!DependencyMethodPartialDependencyz: Keyword Arguments for the dep.partial_dependency methods r)   compile_args	link_argslinksincludessourcesNr   r#   r$   r%   rK   rK   l   s    DOKNMr$   rK   c                      e Zd ZU ded<   y)!BuildTargeMethodExtractAllObjectsr)   	recursiveNr   r   r    r"   r#   r$   r%   rR   rR   v   s    Or$   rR   c                  J    e Zd ZU ded<   ded<   ded<   ded<   ded	<   d
ed<   y)FuncInstallSubdirstrinstall_dirr)   strip_directoryr   exclude_filesexclude_directoriesr   install_modeT.Optional[bool]follow_symlinksNrT   r#   r$   r%   rV   rV   y   s&    $$%%r$   rV   c                  @    e Zd ZU ded<   ded<   ded<   ded<   d	ed
<   y)FuncInstallDatarW   rX   T.List[FileOrString]rP   r   renamer   r\   r]   r^   NrT   r#   r$   r%   r`   r`      s     !!%%r$   r`   c                  6    e Zd ZU ded<   ded<   ded<   ded<   y)	FuncInstallHeadersr-   rX   r   r\   subdirr]   r^   NrT   r#   r$   r%   rd   rd      s      %%r$   rd   c                  ,    e Zd ZU ded<   ded<   ded<   y)FuncInstallManr-   rX   r   r\   localeNrT   r#   r$   r%   rg   rg      s      r$   rg   c                      e Zd ZU ded<   y)FuncImportModuler)   disablerNrT   r#   r$   r%   rj   rj      s    Nr$   rj   c                      e Zd ZU ded<   y)FuncIncludeDirectoriesr)   	is_systemNrT   r#   r$   r%   rm   rm      s    Or$   rm   c                      e Zd ZU ded<   y)FuncAddLanguagesr]   r   NrT   r#   r$   r%   rp   rp      s    r$   rp   c                  ,    e Zd ZU ded<   ded<   ded<   y)	RunTargetzRT.List[T.Union[str, build.BuildTarget, build.CustomTarget, ExternalProgram, File]]commandrE   r/   r   r1   NrT   r#   r$   r%   rr   rr      s    __CC	r$   rr   c                      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<   y)CustomTargetr)   build_alwaysr]   build_always_stalebuild_by_defaultrD   kT.List[T.Union[str, build.BuildTarget, build.CustomTarget, build.CustomTargetIndex, ExternalProgram, File]]rs   consolera   depend_filesrE   r/   r-   rC   r   r1   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]]]rX   r   r\   zT.List[T.Optional[str]]install_tagr   rB   NrT   r#   r$   r%   ru   ru      sp    ((&&MM MM&&CC	
J_ _M77((r$   ru   c                  J    e Zd ZU ded<   ded<   ded<   ded<   ded	<   d
ed<   y)AddTestSetupz%T.List[T.Union[str, ExternalProgram]]exe_wrapperr)   gdbr+   timeout_multiplier
is_defaultr   exclude_suitesr   r1   NrT   r#   r$   r%   r   r      s%    66	I	r$   r   c                  @    e Zd ZU ded<   ded<   ded<   ded<   d	ed
<   y)ProjectzT.Optional[FileOrString]versionr-   meson_version7T.Dict[OptionKey, T.Union[str, int, bool, T.List[str]]]default_optionsr   licenserW   subproject_dirNrT   r#   r$   r%   r   r      s     %%""LLr$   r   c                      e Zd ZdZddZy)_FoundProtozrProtocol for subdir arguments.

    This allows us to define any object that has a found(self) -> bool method
    c                     y )Nr#   )selfs    r%   foundz_FoundProto.found   s    r$   N)returnr)   )r   r   r    r!   r   r#   r$   r%   r   r      s    
 !r$   r   c                      e Zd ZU ded<   y)SubdirzT.List[_FoundProto]if_foundNrT   r#   r$   r%   r   r      s    !!r$   r   c                  ,    e Zd ZU ded<   ded<   ded<   y)SummaryrW   sectionr)   bool_ynr-   list_sepNrT   r#   r$   r%   r   r      s    LMr$   r   c                  ,    e Zd ZU ded<   ded<   ded<   y)FindProgramr   r   r   r   r   r   NrT   r#   r$   r%   r   r      s    LLr$   r   c                  ,    e Zd ZU ded<   ded<   ded<   y)
RunCommandr)   checkr]   rD   r   r1   NrT   r#   r$   r%   r   r      s    K	r$   r   c                      e Zd ZU ded<   y)FeatureOptionRequirer-   error_messageNrT   r#   r$   r%   r   r      s    ""r$   r   c                  "    e Zd ZU ded<   ded<   y)DependencyPkgConfigVarr-   defaultr   define_variableNrT   r#   r$   r%   r   r     s    ((r$   r   c                  J    e Zd ZU ded<   ded<   ded<   ded<   ded<   ded<   y	)
DependencyGetVariabler-   cmake	pkgconfig
configtoolinternaldefault_valuer   pkgconfig_defineNrT   r#   r$   r%   r   r     s&    ""))r$   r   c                      e Zd ZU ded<   y)ConfigurationDataSetr-   descriptionNrT   r#   r$   r%   r   r     s      r$   r   c                  @    e Zd ZU ded<   ded<   ded<   ded<   d	ed
<   y)VcsTagry   rs   r-   fallbackr}   r~   r   rB   rW   replace_stringNrT   r#   r$   r%   r   r     s,    M M_ _r$   r   c                      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<   y)ConfigureFilerW   rB   r)   rD   z%T.Literal['meson', 'cmake', 'cmake@']formatzT.Literal['c', 'json', 'nasm']output_formatr-   rC   r]   r   zT.Union[str, T.Literal[False]]rX   r   r\   r   encodingzST.Optional[T.List[T.Union[build.Executable, ExternalProgram, Compiler, File, str]]]rs   ra   r~   zRT.Optional[T.Union[T.Dict[str, T.Union[str, int, bool]], build.ConfigurationData]]configuration
macro_nameNrT   r#   r$   r%   r   r      sS    KM1111//  M``eer$   r   c                  "    e Zd ZU ded<   ded<   y)
Subprojectr   r   r   r   NrT   r#   r$   r%   r   r   2  s    LLr$   r   c                  6    e Zd ZU ded<   ded<   ded<   ded<   y)	DoSubprojectr   r   r   r   cmake_optionsz"T.Optional[CMakeSubprojectOptions]optionsNrT   r#   r$   r%   r   r   8  s    LL//r$   r   c                      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<   y)_BaseBuildTargetzArguments used by all BuildTarget like functions.

    This really exists because Jar is so different than all of the other
    BuildTarget functions.
    r)   rx   rW   build_rpathra   extra_filesgnu_symbol_visibilityr   r   r\   install_rpathimplicit_include_directorieszZT.List[T.Union[str, File, build.CustomTarget, build.CustomTargetIndex, build.BuildTarget]]link_dependsr-   link_languagename_prefixname_suffixr   r   zT.List[build.ObjectTypes]objectsr   override_optionszNotRequired[T.List[File]]r{   r   	resourcesNr   r#   r$   r%   r   r   @  sn     %%M"&&ll""    &&MM++r$   r   c                      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<   y)_BuildTargetz%Arguments shared by non-JAR functionsT.List[T.Union[str, int]]d_debugz'T.List[T.Union[str, build.IncludeDirs]]d_import_dirsd_module_versionsr)   
d_unittestT.Dict[str, str]rust_dependency_mapr   rP   r   c_argscpp_args	cuda_argsfortran_argsd_args	objc_argsobjcpp_args	rust_argszT.List[T.Union[str, File]]	vala_argscs_args
swift_argscython_args	nasm_args	masm_argsNr   r#   r$   r%   r   r   [  s}    /&&::00))))r$   r   c                      e Zd ZU ded<   y)_LibraryMixinz T.Optional[Literal['c', 'rust']]rust_abiNrT   r#   r$   r%   r   r   u  s    ..r$   r   c                  J    e Zd ZU ded<   ded<   ded<   ded<   ded<   d	ed
<   y)
Executabler]   export_dynamicgui_appzT.Optional[T.Union[str, bool]]implibpieKT.Optional[T.Union[str, File, build.CustomTarget, build.CustomTargetIndex]]vs_module_defsr-   win_subsystemNrT   r#   r$   r%   r   r   z  s&    $$**	__""r$   r   c                  "    e Zd ZU ded<   ded<   y)_StaticLibMixinr)   prelinkr]   picNrT   r#   r$   r%   r   r     s    M	r$   r   c                      e Zd Zy)StaticLibraryNr   r   r    r#   r$   r%   r   r         r$   r   c                  6    e Zd ZU ded<   ded<   ded<   ded<   y)	_SharedLibMixinzT.Optional[T.Tuple[str, str]]darwin_versionsr-   	soversionr   r   r   NrT   r#   r$   r%   r   r     s    22__r$   r   c                      e Zd Zy)SharedLibraryNr   r#   r$   r%   r  r    r   r$   r  c                      e Zd ZU ded<   y)SharedModuler   r   NrT   r#   r$   r%   r  r    s    __r$   r  c                  *   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<   y )!Libraryz9For library, both_library, and as a base for build_targetzNotRequired[T.List[str]]c_static_argsc_shared_argscpp_static_argscpp_shared_argscuda_static_argscuda_shared_argsfortran_static_argsfortran_shared_argsd_static_argsd_shared_argsobjc_static_argsobjc_shared_argsobjcpp_static_argsobjcpp_shared_argsrust_static_argsrust_shared_argsz'NotRequired[T.List[T.Union[str, File]]]vala_static_argsvala_shared_argscs_static_argscs_shared_argsswift_static_argsswift_shared_argscython_static_argscython_shared_argsnasm_static_argsnasm_shared_argsmasm_static_argsmasm_shared_argsNr   r#   r$   r%   r  r    s    C++++----....1111++++....0000....====,,,,////0000........r$   r  c                      e Zd ZU ded<   y)BuildTargetznLiteral['executable', 'shared_library', 'static_library', 'shared_module', 'both_libraries', 'library', 'jar']target_typeNrT   r#   r$   r%   r&  r&    s    N Nr$   r&  c                  6    e Zd ZU ded<   ded<   ded<   ded<   y	)
JarrW   
main_classz#T.Optional[build.StructuredSources]java_resourceszT.Union[str, File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList, build.ExtractedObjects, build.BuildTarget]rP   r   	java_argsNrT   r#   r$   r%   r)  r)    s    O77 M  Mr$   r)  c                      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<   y)FuncDeclareDependencyr   rL   z'T.List[T.Union[build.IncludeDirs, str]]r   r   r   zT.List[Dependency]dependenciesra   r   include_directoriesrM   zQT.List[T.Union[build.StaticLibrary, build.CustomTarget, build.CustomTargetIndex]]
link_wholezT.List[build.LibTypes]	link_withzT.List[build.ExtractedObjects]r   z3T.List[T.Union[FileOrString, build.GeneratedTypes]]rP   r   	variablesr-   r   NrT   r#   r$   r%   r.  r.    sP    ::00$$%%@@aa%%++@@r$   r.  )M
__future__r   typingTtyping_extensionsr   r   r   r    r	   r
   	compilersr   dependencies.baser   mesonlibr   r   r   r   r   r   modules.cmaker   programsr   type_checkingr   r   r   r'   r4   r7   r:   r=   r@   rG   rK   rR   rV   r`   rd   rg   rj   rm   rp   rr   ru   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r&  r)  r.  r#   r$   r%   <module>r?     s   # (  G G     * c c 2 & B y :H :} 8i 8	 DI Dy 	 	 &	 &&i && &Y  
Y  	 9 ,9 i !( !"Y "
i /#4  #9 #
)Y )*I *!9 !Y  I  $ 0? 0y 6# 4/I /
# #i 	L/= 	`i `	L/= 	`< `
/lO_m /DN' N
 I r$   