+
    UBih                    R  a  0 t $ ^ RIHt ^ RIHt ^ RIt^ RIHt ^ RI	t	^ RI
t
^ RIt^RIHt ^RIHtHtHt ^RIHt ^RIHt ^ R	IHt ]P,                  '       d   ^R
IHt ^RIHt ^RIHt Rt. ROt/ RRbRRbRRbRRbRRbRRbRRbRRbRRbRR bR!R"bR#R$bR%R&bR'R(bR)R*bR+R,bR-R.bR/R0/CtR1] R2&   / R3R4bR5R6bR7R8bR9R:bR;R<bR=R>bR?R@bRARBbRCRDbRERFbRGRHbRIRJbRKRLbRMRNbRORPbRQRRbRSRTbRURV/Ct!R1] RW&   / ]C]!Ct"R'RXR)RYR/RZR-R[/t#R1] R\&    ! R] R^]4      t$ ! R_ R`4      t%]! RaRb7       ! Rc Rd]4      4       t& ! Re Rf4      t' ! Rg Rh4      t(RiRiRjRjRkRkRlRmRnRoRoRoRpRmRqRrRsRrRtRrRuRrRvRrRwRwRxRxRyRy/t)R1] Rz&   R{ R| lt*R} R~ lt+R R lt,R R lt-R R lt.R R lt/R R lt0R R lt1RR R llt2R R lt3R# )    )annotations)	dataclassN)Enum)mesonlib)EnvironmentExceptionHoldableObject
Popen_safeExternalProgram)mlog)Path)ElementaryOptionValues)Compiler)VisualStudioLikeCompilercCCcppCXXcsCSCcythonCYTHONdDCfortranFCobjcOBJCobjcppOBJCXXrustRUSTCvalaVALACnasmNASMc_ldCC_LDcpp_ldCXX_LDd_ldDC_LD
fortran_ldFC_LDobjc_ldOBJC_LD	objcpp_ld	OBJCXX_LDrust_ldRUSTC_LDzT.Mapping[str, str]ENV_VAR_COMPILER_MAParARasASldLDnmNMobjcopyOBJCOPYobjdumpOBJDUMPranlibRANLIBreadelfREADELFsizeSIZEstringsSTRINGSstripSTRIPwindresWINDREScmakeCMAKEqmakeQMAKE
pkg-config
PKG_CONFIGmakeMAKEvapigenVAPIGENzllvm-configLLVM_CONFIGENV_VAR_TOOL_MAPD_LDF_LDRUST_LD	OBJCPP_LDDEPRECATED_ENV_PROG_MAPc                  "    ] tR t^tRtRtRtRtR# )CMakeSkipCompilerTestalwaysneverdep_only N)__name__
__module____qualname____firstlineno__ALWAYSNEVERDEP_ONLY__static_attributes__rd       9/usr/lib/python3.14/site-packages/mesonbuild/envconfig.pyr`   r`      s    FEHrm   r`   c                      ] tR t^tR#R R lltR R ltR R ltR R	 ltR
 R ltR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR#R  R! lltR"tR# )$
PropertiesNc                   V ^8  d   QhRR/# )   
propertiesz/T.Optional[T.Dict[str, ElementaryOptionValues]]rd   )formats   "rn   __annotate__Properties.__annotate__   s     + +G+rm   c                	(    T;'       g    / V n         R # Nrs   )selfrs   s   &&rn   __init__Properties.__init__   s     %**rm   c                    V ^8  d   QhRRRR/# )rr   languagestrreturnboolrd   )rt   s   "rn   ru   rv      s     7 73 74 7rm   c                	.    VR ,           V P                   9   # _stdlibry   )rz   r~   s   &&rn   
has_stdlibProperties.has_stdlib   s    )#t66rm   c                    V ^8  d   QhRRRR/# )rr   r~   r   r   T.Union[str, T.List[str]]rd   )rt   s   "rn   ru   rv      s      3 +D rm   c                	    V P                   VR ,           ,          p\        V\        4      '       d   V# \        V\        4      '       g   Q hV F  p\        V\        4      '       d   K  Q h	  V# r   )rs   
isinstancer   list)rz   r~   stdlibis   &&  rn   
get_stdlibProperties.get_stdlib   s\    I!56fc""M&$''''Aa%%%% rm   c                   V ^8  d   QhRR/# rr   r   T.Optional[str]rd   )rt   s   "rn   ru   rv      s      / rm   c                	v    V P                   P                  R R4      pVe   \        V\        4      '       g   Q hV# )rootNrs   getr   r   )rz   r   s   & rn   get_rootProperties.get_root   s4    ""640|z$4444rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   rv      s      o rm   c                	v    V P                   P                  R R4      pVe   \        V\        4      '       g   Q hV# )sys_rootNr   )rz   r   s   & rn   get_sys_rootProperties.get_sys_root   s5    ??&&z48:h#<#<<<rm   c                   V ^8  d   QhRR/# )rr   r   T.Optional[T.List[str]]rd   )rt   s   "rn   ru   rv      s      '> rm   c                	    V P                   P                  R R4      pVf   V# \        P                  ! V4      pV F  p\	        V\
        4      '       d   K  Q h	  V# )pkg_config_libdirN)rs   r   r   listifyr   r   )rz   presr   s   &   rn   get_pkg_config_libdir Properties.get_pkg_config_libdir   sU    OO 3T:9Hq!Aa%%%% 
rm   c                   V ^8  d   QhRR/# rr   r   r   rd   )rt   s   "rn   ru   rv      s      D rm   c                	    R V P                   9  d   R# V P                   R ,          p\        V\        4      '       g   Q hV# )cmake_defaultsTrs   r   r   rz   r   s   & rn   get_cmake_defaultsProperties.get_cmake_defaults   s8    4??2oo./#t$$$$
rm   c                   V ^8  d   QhRR/# rr   r   zT.Optional[Path]rd   )rt   s   "rn   ru   rv      s     $ $*: $rm   c                	    R V P                   9  d   R# V P                   R ,          p\        V\        4      '       g   Q h\        V4      pVP	                  4       '       g   \        RV R24      hV# )cmake_toolchain_fileNzcmake_toolchain_file (z) is not absolute)rs   r   r   r   is_absoluter   )rz   rawr   s   &  rn   get_cmake_toolchain_file#Properties.get_cmake_toolchain_file   sh    !8oo45#s#####Cy#//11&)?uDU'VWW##rm   c                   V ^8  d   QhRR/# )rr   r   r`   rd   )rt   s   "rn   ru   rv      s     
H 
H.C 
Hrm   c           
     	L   R V P                   9  d   \        P                  # V P                   R ,          p\        V\        4      '       g   Q h \        V4      #   \
         d@    \        RP                  T\         Uu. uF  q"P                  NK  	  Mu upi up4      4      hi ; i)cmake_skip_compiler_testzO"{}" is not a valid value for cmake_skip_compiler_test. Supported values are {})	rs   r`   rk   r   r   
ValueErrorr   rt   value)rz   r   es   &  rn   get_cmake_skip_compiler_test'Properties.get_cmake_skip_compiler_test   s    %T__<(111oo89#s####	H(-- 	H&a/DE/D!gg/DEFH H	Hs   
A $B#=BB#c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   rv      s      4 rm   c                	    R V P                   9  d   R# V P                   R ,          p\        V\        4      '       g   Q hV# )cmake_use_exe_wrapperTr   r   s   & rn   get_cmake_use_exe_wrapper$Properties.get_cmake_use_exe_wrapper   s8    "$//9oo56#t$$$$
rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   rv      s     . ./ .rm   c                	    \         P                  ! R V P                  P                  R4      4      pV'       d   \	        V4      # R# )r   	java_homeN)Tcastrs   r   r   rz   r   s   & rn   get_java_homeProperties.get_java_home   s3    ($//*=*=k*JK#tE{--rm   c                   V ^8  d   QhRR/# )rr   r   T.List[str]rd   )rt   s   "rn   ru   rv      s     , , ,rm   c                	   \         P                  ! V P                  P                  R . 4      4      p\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   \        R4      h\        P                  ! RV4      # )bindgen_clang_argumentsc              3  B   "   T F  p\        V\        4      x  K  	  R # 5irx   r   r   .0vs   & rn   	<genexpr>4Properties.get_bindgen_clang_args.<locals>.<genexpr>   s     5u!:a%%u   FTz?bindgen_clang_arguments must be a string or an array of stringsr   )r   r   rs   r   allr   r   r   r   s   & rn   get_bindgen_clang_args!Properties.get_bindgen_clang_args   sc      !4!45NPR!STs5u5sss5u555&'hiivvmU++rm   c                    V ^8  d   QhRRRR/# )rr   otherobjectr   r   rd   )rt   s   "rn   ru   rv      s      F t rm   c                	v    \        V\        V 4      4      '       d   V P                  VP                  8H  # \        # rx   )r   typers   NotImplemented)rz   r   s   &&rn   __eq__Properties.__eq__   s.    eT$Z((??e&6&666rm   c                    V ^8  d   QhRRRR/# )rr   keyr   r   0T.Optional[T.Union[str, bool, int, T.List[str]]]rd   )rt   s   "rn   ru   rv      s     $ $s $'W $rm   c                	(    V P                   V,          # rx   ry   )rz   r   s   &&rn   __getitem__Properties.__getitem__   s    s##rm   c                    V ^8  d   QhRRRR/# )rr   itemz$T.Union[str, bool, int, T.List[str]]r   r   rd   )rt   s   "rn   ru   rv     s     ' '!E '$ 'rm   c                	    WP                   9   # rx   ry   )rz   r   s   &&rn   __contains__Properties.__contains__  s    &&rm   c               $    V ^8  d   QhRRRRRR/# )rr   r   r   defaultr   r   rd   )rt   s   "rn   ru   rv     s'     1 1s 1%U 1  bR 1rm   c                	8    V P                   P                  W4      # rx   )rs   r   )rz   r   r   s   &&&rn   r   Properties.get  s    ""300rm   ry   rx   )re   rf   rg   rh   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rl   rd   rm   rn   rp   rp      sX    +7

$
H.,$'1 1rm   rp   T)unsafe_hashc                  Z   ] tR tRt$ R]R&   R]R&   R]R&   R]R&   R]R&   R]R	&   R
 R ltR R lt]R R l4       tR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR  R! ltR" R# ltR$ R% ltR& R' ltR( R) ltR* R+ ltR, R- ltR. R/ ltR0 R1 ltR2 R3 ltR4tR5# )6MachineInfoi
  r   system
cpu_familycpuendianr   kernel	subsystemc                   V ^8  d   QhRR/# )rr   r   Nonerd   )rt   s   "rn   ru   MachineInfo.__annotate__  s     F Ft Frm   c                	6    V P                   \        9   V n        R # rx   )r   CPU_FAMILIES_64_BIT	is_64_bitrz   s   &rn   __post_init__MachineInfo.__post_init__  s    #2EErm   c                   V ^8  d   QhRR/# rr   r   r   rd   )rt   s   "rn   ru   r     s     N N# Nrm   c                	V    R V P                    RV P                   RV P                   R2# )z<MachineInfo:  z (z)>)r   r   r   r  s   &rn   __repr__MachineInfo.__repr__  s*    }Adoo->b
"MMrm   c                    V ^8  d   QhRRRR/# )rr   r   z#T.Dict[str, ElementaryOptionValues]r   z'MachineInfo'rd   )rt   s   "rn   ru   r     s     R RB R} Rrm   c           	     	   \         ;QJ d*    R  VP                  4        4       F  '       d   K   RM	  RM! R  VP                  4        4       4      '       g   Q R4       h\        P                  ! RV4      p0 RmpV\	        V4      ,
          '       d6   \        R	V R
2RP                  V\	        V4      ,
          4      ,           4      hVR,          pV\        9  d   \        P                  ! RV R24       VR,          pVR9  d   \        P                  ! RV 24       VR,          pVP                  RR4      pVP                  RR4      pV ! WdVR,          WWV4      # )c              3  B   "   T F  p\        V\        4      x  K  	  R # 5irx   r   r   s   & rn   r   +MachineInfo.from_literal.<locals>.<genexpr>  s     <|!:a%%|r   FTzfor mypyzT.Dict[str, str]r   r   r   r   zMachine info is currently 
zbut is missing {}.Unknown CPU family zF, please report this at https://github.com/mesonbuild/meson/issues/newzUnknown endian r   Nr   >   r   r   r   r   )littlebig)r   valuesr   r   setr   rt   known_cpu_familiesr   warningr   )	clsr   literalminimum_literalr   r   r   r   r   s	   &&       rn   from_literalMachineInfo.from_literal  s3    s<szz|<sss<szz|<<<HjH<&&+S1CS\))&,WIR8$++Oc'l,JKLM M \*
//LL.zl  ;A  B  C"**LL?6(34"Xt,KKT2	6wu~vyQQrm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   5       ( (D (rm   c                     V P                   R8H  # )z
Machine is windows?
windowsr   r  s   &rn   
is_windowsMachineInfo.is_windows5       {{i''rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   ;       ' '4 'rm   c                     V P                   R8H  # )z
Machine is cygwin?
cygwinr  r  s   &rn   	is_cygwinMachineInfo.is_cygwin;       {{h&&rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   A       & &$ &rm   c                     V P                   R8H  # )z
Machine is linux?
linuxr  r  s   &rn   is_linuxMachineInfo.is_linuxA       {{g%%rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   G  s     O O4 Orm   c                     V P                   R9   # )z6
Machine is Darwin (macOS/iOS/tvOS/visionOS/watchOS)?
>   iostvosdarwinwatchosvisionosr  r  s   &rn   	is_darwinMachineInfo.is_darwinG  s     {{NNNrm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   M  r  rm   c                     V P                   R8H  # )z
Machine is Android?
androidr  r  s   &rn   
is_androidMachineInfo.is_androidM  r"  rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   S  r+  rm   c                     V P                   R8H  # )z
Machine is Haiku?
haikur  r  s   &rn   is_haikuMachineInfo.is_haikuS  r0  rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   Y  r$  rm   c                     V P                   R8H  # )z
Machine is NetBSD?
netbsdr  r  s   &rn   	is_netbsdMachineInfo.is_netbsdY  r)  rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   _  r  rm   c                     V P                   R8H  # )z
Machine is OpenBSD?
openbsdr  r  s   &rn   
is_openbsdMachineInfo.is_openbsd_  r"  rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   e  s     * * *rm   c                     V P                   R8H  # )zMachine is DragonflyBSD?	dragonflyr  r  s   &rn   is_dragonflybsdMachineInfo.is_dragonflybsde  s    {{k))rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   i  s     ( (D (rm   c                     V P                   R8H  # )zMachine is FreeBSD?freebsdr  r  s   &rn   
is_freebsdMachineInfo.is_freebsdi  s    {{i''rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   m  s     & &$ &rm   c                     V P                   R8H  # )zMachine is illumos or Solaris?sunosr  r  s   &rn   is_sunosMachineInfo.is_sunosm  s    {{g%%rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   q  s     $ $ $rm   c                     V P                   R8H  # )z
Machine is GNU/Hurd?
gnur  r  s   &rn   is_hurdMachineInfo.is_hurdq       {{e##rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   w  s     $ $ $rm   c                     V P                   R8H  # )z
Machine is aix?
aixr  r  s   &rn   is_aixMachineInfo.is_aixw  rb  rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r   }  s     . . .rm   c                8    V P                   P                  R4      # )zMachine is IRIX?irix)r   
startswithr  s   &rn   is_irixMachineInfo.is_irix}  s    {{%%f--rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r     s     % % %rm   c                     V P                   R8H  # )z
Machine is OS/2?
zos/2r  r  s   &rn   is_os2MachineInfo.is_os2  s     {{f$$rm   c                   V ^8  d   QhRR/# r  rd   )rt   s   "rn   ru   r     s       rm   c                	    V P                  4       '       g-   V P                  4       '       g   V P                  4       '       d   R # R# )exe )r   r'  rp  r  s   &rn   get_exe_suffixMachineInfo.get_exe_suffix  s+    ?? 0 0DKKMMrm   c                   V ^8  d   QhRR/# r  rd   )rt   s   "rn   ru   r     s      3 rm   c                	6    V P                  4       '       d   R # R# )objo)r   r  s   &rn   get_object_suffixMachineInfo.get_object_suffix  s    ??rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   r     s     5 5d 5rm   c                	R    V P                  4       ;'       g    V P                  4       # rx   )r   r'  r  s   &rn   libdir_layout_is_win MachineInfo.libdir_layout_is_win  s     44DNN$44rm   )r   N)re   rf   rg   rh   __annotations__r  r  classmethodr  r   r'  r.  r8  r=  rB  rG  rL  rQ  rV  r[  r`  rf  rl  rp  rv  r|  r  rl   rd   rm   rn   r   r   
  s    KO	HKFN R R6('&O(&'(*(&$$.%5 5rm   r   c                      ] tR tRtRR R llt]R R l4       t]R R l4       t]R	 R
 l4       t]	R R l4       t
R R ltRtR# )BinaryTablei  Nc                   V ^8  d   QhRR/# )rr   binariesz2T.Optional[T.Mapping[str, ElementaryOptionValues]]rd   )rt   s   "rn   ru   BinaryTable.__annotate__  s     / /H/rm   c                	l   / V n         V'       Ed$   VP                  4        Fc  w  r#\        V\        \        34      '       g    \
        P                  ! R V: RV: R24      h\
        P                  ! V4      V P                   V&   Ke  	  RV P                   9   d   RV P                   9  d:   \        P                  ! RRR7       V P                   R,          V P                   R&   M@V P                   R,          V P                   R,          8w  d   \
        P                  ! R4      h V P                   R R	# R	# R	# )
zInvalid type z for entry z in cross file	pkgconfigrR   zF"pkgconfig" entry is deprecated and should be replaced by "pkg-config"F)fatalzAMismatched pkgconfig and pkg-config binaries in the machine file.N)
r  itemsr   r   r   r   MesonExceptionr   r   deprecation)rz   r  namecommands   &&  rn   r{   BinaryTable.__init__  s     358!)!1!'D#;77"11'{+dX^TV V&.&6&6w&?d#	 "2
 dmm+t}}4$$%muz{26--2LDMM,/]];/4==3NN"112uvv MM+. , rm   c                   V ^8  d   QhRR/# rr   r   r   rd   )rt   s   "rn   ru   r    s     6 6? 6rm   c                 	    \        R RR7      # )ccacheTsilentr
   rd   rm   rn   detect_ccacheBinaryTable.detect_ccache  s    x55rm   c                   V ^8  d   QhRR/# r  rd   )rt   s   "rn   ru   r    s     7 7O 7rm   c                 	    \        R RR7      # )sccacheTr  r
   rd   rm   rn   detect_sccacheBinaryTable.detect_sccache  s    y66rm   c                   V ^8  d   QhRR/# r  rd   )rt   s   "rn   ru   r    s     + +? +rm   c                 	    \         P                  4       p V P                  4       '       d   V # \         P                  4       # rx   )r  r  foundr  )caches    rn   detect_compiler_cache!BinaryTable.detect_compiler_cache  s1     **,;;==L((**rm   c                    V ^8  d   QhRRRR/# )rr   entryr   r   z4T.Tuple[T.List[str], T.Union[None, ExternalProgram]]rd   )rt   s   "rn   ru   r    s         9  >r  rm   c                	   \         P                  ! V4      pV^ ,          R8X  d   VR,          pV P                  4       pM,V^ ,          R8X  d   VR,          pV P                  4       pMTpRpV'       g   \	        RV^ ,           24      hW43# )r   r  :   NNr  Nz+Compiler cache specified without compiler: )r   stringlistifyr  r  r   )r  r  partscompilerr  s   &&   rn   parse_entryBinaryTable.parse_entry  s    &&u-8xRyH&&(F1X"RyH'')FHF&)TUZ[\U]T^'_``rm   c                    V ^8  d   QhRRRR/# )rr   r  r   r   r   rd   )rt   s   "rn   ru   r    s       )@ rm   c                    V P                   P                  V4      pV'       g   R# V^ ,          P                  4       '       g   R# V# )zLookup binary in cross/native file and fallback to environment.

Returns command with args as list if found, Returns `None` if nothing is
found.
N)r  r   rJ   )rz   r  r  s   && rn   lookup_entryBinaryTable.lookup_entry  s9     --##D)!!##rm   )r  rx   )re   rf   rg   rh   r{   staticmethodr  r  r  r  r  r  rl   rd   rm   rn   r  r    sa    /4 6 6 7 7 + +    " rm   r  c                  2    ] tR tRtRR R lltR R ltRtR# )	CMakeVariablesi  Nc                    V ^8  d   QhRRRR/# )rr   	variableszT.Optional[T.Dict[str, T.Any]]r   r   rd   )rt   s   "rn   ru   CMakeVariables.__annotate__  s     	( 	("@ 	(D 	(rm   c                	4   T;'       g    / p/ V n         VP                  4        Fp  w  r#\        P                  ! V4      pV FA  p\	        V\
        4      '       d   K  \        R V RV R\        V4      P                   R24      h	  W0P                   V&   Kr  	  R# )zValue 'z' of CMake variable 'z!' defined in a machine file is a z and not a strN)	r  r  r   r   r   r   r   r   re   )rz   r  r   r   r   s   &&   rn   r{   CMakeVariables.__init__  s    OO	35#//+JC$$U+E!!S)).;PQTPUUvw{|}w~  xH  xH  wI  IW  0X  Y  Y  #(NN3 ,rm   c                   V ^8  d   QhRR/# )rr   r   zT.Dict[str, T.List[str]]rd   )rt   s   "rn   ru   r    s      7 rm   c                	    V P                   # rx   r  r  s   &rn   get_variablesCMakeVariables.get_variables  s    ~~rm   r  rx   )re   rf   rg   rh   r{   r  rl   rd   rm   rn   r  r    s    	( rm   r  rU  rK  rF  r  ntr<  r-  r&  r5  xnur3  r4  r7  r6  rP  rA  r_  KERNEL_MAPPINGSc                    V ^8  d   QhRRRR/# rr   	compilersT.Dict[str, Compiler]r   r   rd   )rt   s   "rn   ru   ru     s     ' '#8 'S 'rm   c                   \         P                  ! 4       pVR8X  d   V# V P                  4        F  p\        P                  ! RV4      pVP
                  R8X  d   VP                  R9   d    R# VP
                  R8X  d   VP                  R9   d    R# VP
                  R8X  g   Kw  VP                  R4      '       g   K   R# 	  V# )	a?  
Detecting the 'native' architecture of Windows is not a trivial task. We
cannot trust that the architecture that Python is built for is the 'native'
one because you can run 32-bit apps on 64-bit Windows using WOW64 and
people sometimes install 32-bit Python on 64-bit Windows.

We also can't rely on the architecture of the OS itself, since it's
perfectly normal to compile and run 32-bit applications on Windows as if
they were native applications. It's a terrible experience to require the
user to supply a cross-info file to compile 32-bit applications on 64-bit
Windows. Thankfully, the only way to compile things with Visual Studio on
Windows is by entering the 'msvc toolchain' environment, which can be
easily detected.

In the end, the sanest method is as follows:
1. Check environment variables that are set by Windows and WOW64 to find out
   if this is x86 (possibly in WOW64), if so use that as our 'native'
   architecture.
2. If the compiler toolchain target architecture is x86, use that as our
  'native' architecture.
3. Otherwise, use the actual Windows architecture

x86r   msvczclang-clgcc__i386__>   r  80x86>   r  i686)r   windows_detect_native_archr  r   r   idtargethas_builtin_define)r  os_archr  s   &  rn   detect_windows_archr    s    0 113G%
 $$&664h?;;& hoo9I&I;;*$(//_*L;;%H$?$?
$K$K ' Nrm   c               $    V ^8  d   QhRRRRRR/# )rr   r  r  definer   r   r   rd   )rt   s   "rn   ru   ru   1  s"      '< c d rm   c                    V P                  4        F  p VP                  V4      '       d    R # K   	  R#   \        P                   d     K<  i ; i)TF)r  r  r   r  )r  r  r   s   && rn   any_compiler_has_definer  1  sR    	##F++ ,    && 		s   5AAc                    V ^8  d   QhRRRR/# r  rd   )rt   s   "rn   ru   ru   ;  s     F F!6 F3 Frm   c                V   \         P                  ! 4       '       d   \        V 4      pM\         P                  ! 4       '       gm   \         P                  ! 4       '       gR   \         P
                  ! 4       '       g7   \         P                  ! 4       '       g   \         P                  ! 4       '       d%   \        P                  ! 4       P                  4       pM#\        P                  ! 4       P                  4       pVP                  R4      '       d   VP                  R4      '       d   RpMVR8X  d   RpMVR8X  d   RpMVP                  R4      '       d   RpMVP                  R4      '       g   VP                  R4      '       d   RpM|VP                  R4      '       d   R	pMbVP                  R4      '       g   VR9   d   R
pMAVR9   d   RpM7VR9   d   RpM-VP                  R4      '       d   RV9  d   RpMRpM	VR9   d   RpVR8X  d   \        V R4      '       d   RpMeVR8X  d   \        V R4      '       d   RpMIVR8X  d   RpM?VR
8X  d   \        V R4      '       d   R	pM#VR8X  d   V '       d   \        V R4      '       g   RpV\        9  d   \         P"                  ! RV: R24       V# )z
Python is inconsistent in its platform module.
It returns different values for the same cpu.
For x86 it might return 'x86', 'i686' or some such.
Do some canonicalization.
r   86r  bepcarm64aarch64armearmppc64ppcx86_64sparc64mips64mips64r  __arm__parisc64parisc	__64BIT____mips64r  z|, please report this at https://github.com/mesonbuild/meson/issues/new with the output of `uname -a` and `cat /proc/cpuinfo`)	powerpc64r  )powerpcr  >   macppcpower macintosh>   x64amd64i86pc>   sun4usun4v>   ip30ip35)r   r   r  rV  rG  rL  is_qnxrf  platform	processorlowermachinerk  endswithr  r  r   r  r  trials   & rn   detect_cpu_familyr  ;  sB    #I.					("4"4"6"6(:M:M:O:OS[SbSbSdSdhphwhwhyhy""$**,  "((*!5!5	&	'				)	$	$			%	 	 E$4$4V$<$<			0	1	1			,	-	-:W1W	+	+	$	$			&	!	!uEE	"	"
 "9j99E	)	"9i88E 
*	 	%"9k::E 
(	4Y
KKE&&*5) 4D D 	E Lrm   c                    V ^8  d   QhRRRR/# r  rd   )rt   s   "rn   ru   ru     s     ) )/ )C )rm   c                   \         P                  ! 4       '       d   \        V 4      pM\         P                  ! 4       '       gR   \         P                  ! 4       '       g7   \         P
                  ! 4       '       g   \         P                  ! 4       '       d%   \        P                  ! 4       P                  4       pM#\        P                  ! 4       P                  4       pVR9   d   RpVR8X  d   \        V R4      '       d   RpV# VP                  R4      '       g   VP                  R4      '       d   \        V R4      '       d   RpV# Rp V# VP                  R4      '       d   RpV# VR	8X  d&   \        P                  ! 4       P                  4       pV# VP                  R
4      '       d/   RV9  d   R
pV# V '       d   \        V R4      '       g   R
pV# Rp V# VR8X  d   \        V R4      '       d   RpV# )r  r  r  r  r  r  r  r  r  e2kr  r  r  r  r  r  r  >   r  r  r  )r   r   r  rV  rG  rL  rf  r  r  r  r  r  rk  r  s   & rn   
detect_cpur    s   #I.					("4"4"6"6(:M:M:O:OS[SbSbSdSd""$**,  "((*))"9j99E8 L7 
		)	$	$(8(8(A(A"9i88E0 L+ E* L) 
		&	!	!& L% 
%""$**,  L 
		&	!	!uE L !8J!O!O L ! L 
%"9k::E Lrm   c                    V ^8  d   QhRRRR/# rr   r   r   r   r   rd   )rt   s   "rn   ru   ru     s     - -# -/ -rm   c                   V R 8X  d   \         P                  ! \        P                  ! 4       P                  R4      '       d   R# \        RR.4      w  rpVP                  ^ 8w  d   \         P                  ! R4      hVP                  4       P                  4       pVR	9  d   \        P                  ! RV R24       R# V# \        P                  V R4      # )
rZ  z<=5.10solarisz/usr/bin/unamez-oz!Failed to run "/usr/bin/uname -o"zqGot an unexpected value for kernel on a SunOS derived platform, expected either "illumos" or "solaris", but got "z^".Please open a Meson issue with the OS you're running and the value detected for your kernel.N>   illumosr  )r   version_comparer  unamereleaser	   
returncoder  r  rJ   r   r  r  r   )r   r   out_s   &   rn   detect_kernelr    s     ##HNN$4$<$<hGG  0$78	<<1))*MNNiik!,,LL  M  NQ  MR Rx x y
vt,,rm   c                    V ^8  d   QhRRRR/# r  rd   )rt   s   "rn   ru   ru     s      S _ rm   c                    V R 8X  d   R# V # )r5  macosrd   r  s   &rn   detect_subsystemr    s    Mrm   c                   V ^8  d   QhRR/# r  rd   )rt   s   "rn   ru   ru     s     % %s %rm   c                 v    \         P                  R 8X  d   R # \        P                  ! 4       P                  4       # )r&  )sysr  r   r  rd   rm   rn   detect_systemr    s'    
||x??""$$rm   c                   V ^8  d   QhRR/# r   rd   )rt   s   "rn   ru   ru     s     1 1? 1rm   c                 B    \         P                  P                  R R4      # )MSYSTEM_CARCHN)osenvironr   rd   rm   rn   detect_msys2_archr    s    ::>>/400rm   c                    V ^8  d   QhRRRR/# )rr   r  z!T.Optional[T.Dict[str, Compiler]]r   r   rd   )rt   s   "rn   ru   ru     s     " "#D "P[ "rm   c           
         \        4       p\        TV e   \        V 4      MRV e   \        V 4      MR\        P
                  \        V4      \        V4      4      # )a  Detect the machine we're running on

If compilers are not provided, we cannot know as much. None out those
fields to avoid accidentally depending on partial knowledge. The
underlying ''detect_*'' method can be called to explicitly use the
partial information.
N)r  r   r  r  r  	byteorderr  r  )r  r   s   & rn   detect_machine_infor     sQ     _F(1(=)$4!*!6
9Df " "rm   c                    V ^8  d   QhRRRR/# )rr   machine_infor   r   r   rd   )rt   s   "rn   ru   ru     s     V V{ Vt Vrm   c                &   V P                   \        4       8w  d   R# \        / 4      pV P                  f   Q R4       hV P                  V8H  ;'       gA    VR8H  ;'       d    V P                  R8H  ;'       g    VR8H  ;'       d    V P                  R8H  # )aC  Whether we can run binaries for this machine on the current machine.

Can almost always run 32-bit binaries on 64-bit natively if the host
and build systems are the same. We don't pass any compilers to
detect_cpu_family() here because we always want to know the OS
architecture, not what the compiler environment tells us.
Fz!called on incomplete machine_infor  r  r  r  )r   r  r  r   )r"  true_build_cpu_familys   & rn   machine_info_can_runr%    s     mo--b1"".S0SS.		 	 $9	9 	V 	V
8
+	S	S,2I2IU2R	V 	V
8
+	T	T,2I2IV2SVrm   )&r  alphaarcr  avrc2000c6000cskydspicr  ft32ia64loongarch64m68k
microblazer  r  msp430r  pic24pic32r  r  riscv32riscv64rl78rxs390s390xsh4sparcr  sw_64wasm32wasm64r  r  tricore)r  r&  r.  r/  r  r  r6  r:  r  r=  r?  r  rx   )4__conditional_annotations__
__future__r   dataclassesr   typingr   enumr   r  r  r  ru  r   r   r   r	   programsr   r   pathlibr   TYPE_CHECKINGoptionsr   r  r   compilers.mixins.visualstudior   r  r   r5   r  rY   ENV_VAR_PROG_MAPr^   r`   rp   r   r  r  r  r  r  r  r  r  r  r  r  r   r%  )rA  s   @rn   <module>rL     sC   # " !   	  
  F F %  ???/#G ' V  -- 
5- 	%	-
 h- - t- F- h- G- G- F- G-  h!-" G#-$ '%-& y'-( )-* z+- ) 2)$) 	$) 	$	)
 	$) y) y) h) y) F) y) W) y)  W!)" W#)$ ,%)& F')( y))* =+) % 0 @*?.>? 
 F&y	0 , D 
f1 f1P tL5. L5 L5\I IV & )29(19(0((14(17(/(0$(0%(-u(.(2E(15(3[(/(-u(*$ *"'RFP)V-(
%
1"&Vrm   