
    -PhP                    8   d dl mZ d dlZd dlZd dlZd dlZd dlZd dl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 dlZddlmZmZmZmZmZmZmZ ddlmZ ddlmZ ej        rd dlmZ dd	lm Z   G d
 de e          Z!dZ"dZ#ddZ$ G d d          Z%ddZ&ddZ'dS )    )annotationsN)Path   )buildcoredataenvironmentinterpretermesonlibmintromlog)MesonException)	OptionKey)Protocol)SharedCMDOptionsc                  j    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S )
CMDOptionsboolprofilefatal_warningsreconfigurewipe
clearcachestrbuilddir	sourcedirpagerzT.List[str]
unset_optsN)__name__
__module____qualname____annotations__     Q/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mesonbuild/msetup.pyr   r      so         


r#   r   z\# This file is autogenerated by Meson. If you change or delete it, it won't be recreated.
*
zl# This file is autogenerated by Meson. If you change or delete it, it won't be recreated.
syntax: glob
**/*
parserargparse.ArgumentParserreturnNonec                B   t          j        |            |                     dg dd           |                     dg dd           |                     ddd	t           j        
           |                     dddt          j                   |                     dddd           |                     ddd           |                     ddd           |                     dddd           |                     ddd            |                     ddd            d S )Nz--native-fileappendz=File containing overrides for native compilation environment.)defaultactionhelpz--cross-filez.File describing cross compilation environment.z-vz	--versionversion)r,   r.   z--profile-self
store_truer   )r,   destr-   z--fatal-meson-warningsr   zMake all Meson warnings fatalz--reconfigurezSet options and reconfigure the project. Useful when new options have been added to the project and the default value is not working.)r,   r-   z--wipezWipe build directory and reconfigure using previous command line options. Useful when build directory got corrupted, or when rebuilding with a newer version of meson.z--clearcacheFz:Clear cached state (e.g. found dependencies). Since 1.3.0.)r,   r+   r-   r   ?)nargsr+   r   )r   register_builtin_argumentsadd_argumentr.   argparseSUPPRESS)r%   s    r$   add_argumentsr7   ,   s   '///
 "'\  ^ ^ ^  "'M  O O O k) ( 0  2 2 2
(I%.  0 0 0
0L\<  > > >
/  0 0 0 7  8 8 8 |UY  [ [ [

#t<<<
3=====r#   c                  X    e Zd Zd'dZd(d	Zd)dZd*dZd+dZd,d-dZd.dZ	d/d!Z
d0d&ZdS )1MesonAppoptionsr   r'   r(   c           	     D   || _         |                                 \  | _        | _        |j        rog }t          j                    5 }t          j        | j                  gt          j	        t          j                            | j        t          j        j        d                    z   D ]=}	 |                    t#          j        ||          |f           .# t&          $ r Y :w xY wt          j        | j        |           	 t          j        | j                  D ]}t          j                            | j        |          }t          j                            |          r4t          j                            |          st1          j        |           zt1          j        |           	 |                     | j                   |D ]M\  }}t          j        t          j                            |          d           t#          j        ||           Nno# |                     | j                   |D ]M\  }}t          j        t          j                            |          d           t#          j        ||           Nw xY w	 d d d            d S # 1 swxY w Y   d S d S )Nz*.iniTexist_ok)r:   validate_dirs
source_dir	build_dirr   tempfileTemporaryDirectoryr   get_cmd_line_fileglobospathjoinr   Environmentprivate_dirr*   shutilcopyFileNotFoundErrorread_cmd_line_filelistdirisdirislinkr
   windows_proof_rmtreewindows_proof_rmadd_vcs_ignore_filesmakedirsdirnamemove)selfr:   restoredfilenamelbfs           r$   __init__zMesonApp.__init__J   s   ,0,>,>,@,@)$.< 	* G,.. *!!)!;DN!K!K LtyY[Y`YeYefjft  wB  wN  wZ  \c  Zd  Zd  Pe  Pe  !e  HHa(@(@('KLLLL,    
 +DNGDDD*  Z77 9 9GLL;;7==++ 9BGNN14E4E 9$9!<<<<$5a88889 --dn=== ' * *1BGOOA$6$6FFFFAq))))* --dn=== ' * *1BGOOA$6$6FFFFAq))))* */* * * * * * * * * * * * * * * * * *	* 	*sR   A%J,*CJ
C$!J#C$$JB(H+A+JA,JJJJrU   r   r   c                    t           j                            |t          j                  }t           j                            |          S N)rE   rF   rG   r   build_filenameexists)rW   rU   fnames      r$   has_build_filezMesonApp.has_build_filem   s.    Wk&@AAw~~e$$$r#   dir1T.Optional[str]dir2T.Tuple[str, str]c                X   d|d|}|Q|<|                      d          s|                      d          rd}nt          d          t          j                    }|t          j                    }t          j                            t          j                            |                    }t          j                            t          j                            |                    }t          j                            |          s1t          j                            |          st          | d          	 t          j        |d           n%# t          $ r}t          | d	          |d }~ww xY w	 t          j        |d           n%# t          $ r}t          | d	          |d }~ww xY wt          j        
                    ||          rVt          d
 t          j        |          t          j        |          fD                       }|r||k    rt          d          |                      |          r6|                      |          rt          dt          j         d          ||fS |                      |          r||fS t          | dt          j         d          )NzNeither source directory z nor build directory .z..z)Must specify at least one directory name.z exist.Tr<   z is not a directoryc              3  B   K   | ]}|j         d k    o
|j        d k    V  dS )r   N)st_inost_dev).0ss     r$   	<genexpr>z.MesonApp.validate_core_dirs.<locals>.<genexpr>   s3      llaQ!@18q=llllllr#   zUSource and build directories must not be the same. Create a pristine build directory.z&Both directories contain a build file z contain a build file )rd   r   rE   getcwdrF   abspathrealpathrb   rT   FileExistsErrorsamefileanystatr   ra   )rW   re   rg   invalid_msg_prefixndir1ndir2ehas_undefineds           r$   validate_core_dirszMesonApp.validate_core_dirsq   s   ^^^VZ^^<|**3// VD4G4G4M4M VDD()TUUU9;;D<9;;D 0 0 6 677 0 0 6 677w~~e$$ 	ARW^^E-B-B 	A $6!?!?!?@@@	FK----- 	F 	F 	F D!=!=!=>>AE	F	FK----- 	F 	F 	F D!=!=!=>>AE	F7E5)) 	~llBGTYNN\^\cdi\j\jKklllllM  ~EUNN$%|}}}u%% 	 ""5)) m$%kkNh%k%k%klll%<u%% 	 %< 2gg+Jdggghhhs0   :E 
E3E..E37F 
F0F++F0r@   c                   t          t          j                            |d          dd          5 }|                    t
                     d d d            n# 1 swxY w Y   t          t          j                            |d          dd          5 }|                    t                     d d d            d S # 1 swxY w Y   d S )Nz
.gitignorewutf-8encodingz	.hgignore)openrE   rF   rG   writegit_ignore_filehg_ignore_file)rW   r@   ofiles      r$   rS   zMesonApp.add_vcs_ignore_files   s%   "',,y,77wOOO 	)SXKK(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)"',,y+66gNNN 	(RWKK'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(s#   AAAB;;B?B?c                L   |                      | j        j        | j        j                  \  }}t	          |          t	          |          j        v rt          d| d|           t          j        |          s| 	                    |           ||fS t          j
                            |d          }t          j
                            t          j
                            |d                    }t          j
                            |          }|rq| j        j        sd| j        j        sXt!          d           | j        j        r.ddlm} t)          |                    | j        |                    t)          d          n |s| j        j        rt          d	|           ||fS )
NzBuild directory z( cannot be a parent of source directory zmeson-privatezcoredata.data7  Directory already configured.

Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
Run "meson setup --reconfigure" to force Meson to regenerate.

If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.r   )mconfr   z>Directory is not empty and does not contain a previous build:
)r}   r:   r   r   r   parentsr   rE   rN   rS   rF   rG   rb   rO   r   r   printcmd_line_options r   
SystemExitrun_impl)rW   src_dirr@   priv_dirhas_valid_buildhas_partial_buildr   s          r$   r>   zMesonApp.validate_dirs   s   #66t|7LdlNdee)	??d7mm333 !pI!p!pgn!p!pqqqz)$$ 	&%%i000I%%7<<	?;;'..h)O)OPPGMM(33 	p<+ 	$DL4E 	$ U V V V
 <0 N''''''$U^^DL)%L%LMMM mm#" 	pt|'8 	p !ncl!n!nooo	!!r#   FNcapture
vslite_ctxT.Optional[dict]c                V   t          j        | j        | j        | j                  }|j        s-| j        j        sJ |j                            | j                   t          j
        |                                | j        j                   | j        j        r%t          j        t          j                               | j        j        r|j                                         t'          j        | j                  5  |                     |||          cd d d            S # 1 swxY w Y   d S r`   )r   rH   r?   r@   r:   first_invocationr   r   set_from_configure_commandr   
initializeget_log_dirr   r   set_timestamp_starttime	monotonicr   clear_cacher
   BuildDirLock	_generate)rW   r   r   envs       r$   generatezMesonApp.generate   sC   %dot~t|TT# 	B<++++L33DLAAA))4<+FGGG< 	7$T^%5%5666<" 	'L$$&&&"4>22 	< 	<>>#w
;;	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	<s   :DD"%D"r   'coredata.CoreData'r   T.Anyall_subprojectsT.Mapping[str, object]c                h   |j         j        }g }|                                }|D ]J}|j                             ||          rt	          |          }||v r|                    d| d           K|r'd                    |          }	t          d|	           |j                                          d S )N"z, zUnknown options: )	optstorepending_optionskeysaccept_as_pending_optionr   r*   rG   r   clear_pending)
rW   r   r   r   pendingerrlistknown_subprojectsoptkeystrerrstrs
             r$   check_unused_optionszMesonApp.check_unused_options   s    #3!+0022 	. 	.C  99#?PQQ XXF)))}6}}}--- 	?YYw''F !=V!=!=>>>'')))))r#   r   environment.Environmentc           
     
   t          j        dt          j        d0i t	          | j                            }t          j        | j        |           t          j
        dt          j                                                                                   t          j
        dt          j                   t          j
        dt          j        |                     t          j
        dt#          j                               t          j        t          j        d                     t          j        dt          j                   t          j        dt          j        | j                             t          j        d	t          j        | j                             |                                r(t          j        d
t          j        d                     n't          j        d
t          j        d                     t1          j        |          }t5          j        ||          }t          j        d|                                rt          j        nt          j
                  } |dt          j        |j        j        j                              |dt          j        |j        j        j                             t          j        dt          j        |j        j        j                             t          j        dt          j        |j        j        j                              |dt          j        |j        j         j                              |dt          j        |j        j         j                             	 | j        j!        rWtD          j#        $                    | j        dd          }tC          j%        dtM                      tO                      |           n|(                                 n)# tR          $ r}	tU          j+        ||	g            d }	~	ww xY wd }
d }	 tD          j#        $                    |,                                d          }|-                                }
| .                    ||           | /                    |j        |j0        j1        |j2                   | j        j!        rtO                      }d|j3        j4         d}tD          j#        $                    | j        d|          }tC          j%        dtM                      ||           |d         }|tk          |tl                    sJ n|j3        7                    ||          }t1          j8        ||           |j9        rL|j        j:        | j        _;        |j        j<        | j        _=        t          j>        | j        | j                   nt          j?        | j        | j                   | j        j!        rWtD          j#        $                    | j        dd          }tC          j%        dtM                      tO                      |           ntU          j@        ||j3                   tU          j+        |g d            |j3        A                                 |j        jB        C                    d!          d"k    rt          jD        d#           |j        jB        C                    d$          d%k    rt          jD        d&           | j        j!        rtD          j#        $                    | j        dd'          }t          t          jF        G                                          }d( |D             }t          ||z
            }|t          |          d)t          |          t          |          d)d*}t          |d+d,-          5 }t          jL        ||           d d d            n# 1 swxY w Y   t          j        d.           ny# tR          $ rl}	tU          j+        ||	g           |
N|
d/z   }tD          j#        M                    |          rtE          jN        ||
           ntE          jO        |
            d }	~	ww xY w|S )1Nr   zBuild started atzMain binary:zBuild Options:zPython system:zThe Meson build systemzVersion:zSource dir:z
Build dir:zBuild type:zcross buildznative build)user_defined_optionsz6T.Callable[[mlog.TV_Loggable, mlog.TV_Loggable], None]zBuild machine cpu family:zBuild machine cpu:zHost machine cpu family:zHost machine cpu:zTarget machine cpu family:zTarget machine cpu:z
meson-logszprofile-interpreter.logz
intr.run())rZ   z	build.datzprofile-z-backend.logz7gen_result = intr.backend.generate(capture, vslite_ctx)
gen_resultzprofile-introspector.logz3mintro.generate_introspection_file(b, intr.backend)Tbackendxcodez8xcode backend is currently unmaintained, patches welcomelayoutflatay  -Dlayout=flat is unsupported and probably broken. It was a failed experiment at making Windows build artifacts runnable while uninstalled, due to PATH considerations, but was untested by CI and anyways breaks reasonable use of conflicting targets in different subdirs. Please consider using `meson devenv` instead. See https://github.com/mesonbuild/meson/pull/9243 for details.zprofile-startup-modules.jsonc                B    h | ]}|d z                        d          |S )rj   zmesonbuild.)
startswith)rn   mods     r$   	<setcomp>z%MesonApp._generate.<locals>.<setcomp>;  s/    XXXSSW4H4H4W4WXSXXXr#   )modulescount)stdlibmesonr   r   r   zmeson setup completedz.prevr"   )PTcastr5   	Namespacevarsr:   r   rM   r@   r   debugdatetimenow	isoformatsys
executableformat_cmd_line_optionsplatformsystemlogboldr.   r?   is_cross_buildr   Buildr	   Interpretermachines
cpu_familycpuhosttargetr   rE   rF   rG   runctxglobalslocalsrun	Exceptionr   write_meson_info_fileget_scratch_dirdump_coredatafinalize_postconf_hooksr   r   r   subprojectsr   name
isinstancedictr   saver   cross_files
cross_fileconfig_filesnative_filewrite_cmd_line_fileupdate_cmd_line_filegenerate_introspection_filerun_postconf_scriptsr   get_value_forwarningsetr   r   sortedlenr   jsondumprb   replaceunlink)rW   r   r   r   r   r\   intr
logger_funrc   r{   cdfcaptured_compile_argsdumpfile	localvarsmods	mesonmodsstdmodsdatar]   old_cdfs                       r$   r   zMesonApp._generate   s     !vlH4F4\4\dlI[I[4\4\]]#DN4HIII
%x'8'<'<'>'>'H'H'J'JKKK
>3>222
#X%EFZ%[%[\\\
#X_%6%6777344555X-...	$/ : :;;;ty88999 	?H]DIm$<$<====H]DIn$=$=>>>K&q?STTT VT),););)=)=MTXX4:P P

.	#,:L:W0X0XYYY
'3<3E3I)J)JKKK+TYs|7H7S-T-TUUU$di0A0E&F&FGGG
/3<;N;Y1Z1Z[[[
($)CL4G4K*L*LMMM	|# T^\C\]]|WYY5QQQQQ


 	 	 	(QC000	  $26K	w||C$7$7$9$9;GGH ##%%C((D111%%cl&*&?&P&*&68 8 8 |# S"HH	B4<#4BBBT^\5IIXZaZcZceny~(1,(?%,4
CXZ^8_8_444(,(=(=gz(R(R%Jq(#### L +.,*B'+.<+D(,T^T\JJJJ-dndlKKK |# DT^\C]^^TV]V_V_agaiaityzzzzz21dlCCC(B555 L--/// |$229==HHWXXX|$228<<FF , - - - |# 	2T^\Cabb3;++--..XXDXXX	 	!122.5G"M"Mdjktdudu  AD  EN  AO  AO  YP  YP  Q  Q%w777 '1IdA&&&' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0111 	 	 	(QC000-7>>'** #Jw,,,,IcNNN	 %$sW   
A7P 
P(P##P(0N`
 _*`
 *_..`
 1_.2`
 

b A'a;;b r\   build.Buildr   interpreter.Interpreterc                    |j                             |j                                                   |j                                        D ]}|                    |           d S r`   )devenvr*   r   
get_devenvr   valuespostconf_hook)rW   r\   r   r   s       r$   r   z MesonApp.finalize_postconf_hooksO  sb    	//11222<&&(( 	! 	!Ca    	! 	!r#   r:   r   r'   r(   )rU   r   r'   r   )re   rf   rg   rf   r'   rh   )r@   r   r'   r(   )r'   rh   )FN)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    r^   rd   r}   rS   r>   r   r   r   r   r"   r#   r$   r9   r9   I   s        !* !* !* !*F% % % %"i "i "i "iH( ( ( (" " " "4< < < < <* * * *$y% y% y% y%v! ! ! ! ! !r#   r9   r:   c                0   | j         }| j                            d          }d}|| j                                        v r!| j        |         dk    rt	          d          n
d| j        |<   t          j                    }i }|D ]M}| d| | _         || j        t          d          <   t          |           }|	                    d          ||<   N| d	| _         || j        t          d          <   t          |           }|	                    d
|           d S )N	genvsliter   ninjazExplicitly specifying a backend option with 'genvslite' is not necessary (the ninja backend is always used) but specifying a non-ninja backend conflicts with a 'genvslite' setup_	buildtypeT)r   _vsF)r   r   )
r   r   popr   r   r    get_genvs_default_buildtype_listr   r9   r   )r:   builddir_prefixgenvsliteval	k_backendbuildtypes_listr   buildtypestrapps           r$   run_genvslite_setupr  T  sI    &O+//<<L IG,113333#I.'99  "H I I I :
 /6 +?AAOJ' > >->>>>;G ;!7!78w#&<<<#=#=
<  )...G7CGY{334
7

CLL:L66666r#    T.Union[CMDOptions, T.List[str]]intc                   t          | t                    rJt          j                    }t	          |           t          j        d|                    |                     } t          j	        |            d| _
        d| j                                        v rt          |            n#t          |           }|                                 dS )Nr   Fr  r   )r   listr5   ArgumentParserr7   r   r   
parse_argsr   parse_cmd_line_optionsr   r   r   r  r9   r   )r:   r%   r  s      r$   r   r   v  s    '4   C(**f&v'8'8'A'ABB#G,,,
 GMg.335555G$$$$w1r#   )r%   r&   r'   r(   r  )r:   r  r'   r  )(
__future__r   r5   r   rD   r   rE   r   rJ   r   rA   r   cProfiler   pathlibr   typingr   r   r   r   r   r	   r
   r   r   r   r:   r   TYPE_CHECKINGtyping_extensionsr   r   r   r   r   r7   r9   r  r   r"   r#   r$   <module>r+     s  
 # " " " " " P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P               O O O O O O O O O O O O O O O O O O $ $ $ $ $ $      ?  ************
  
  
  
  
 %x 
  
  
 > > > >:I! I! I! I! I! I! I! I!V 7  7  7  7D     r#   