ó
ŠM(^c           @   sý  d  Z  d d l Z d d l Z i  Z i  Z i  Z i  Z d e f d „  ƒ  YZ d „  Z	 d „  Z
 d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ e ƒ  Z e ƒ  Z e ƒ  Z e ƒ  Z e ƒ  Z e ƒ  Z e ƒ  Z e ƒ  Z e d d d g ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d¤Z" e j# d  d! j$ e" ƒ ƒ Z% e j# d" ƒ Z& e j' d# „ Z( d$ „  Z) d% „  Z* e j' d& „ Z+ e j' d' „ Z, e j' d( „ Z- d) „  Z. e d* d+ ƒ Z/ e d, d- ƒ Z0 e d. d/ ƒ Z1 e d0 d1 ƒ Z2 e d2 d3 ƒ Z3 e d4 d5 ƒ Z4 e d6 d6 ƒ Z5 e	 e/ ƒ e	 e0 ƒ e	 e1 ƒ e	 e2 ƒ e	 e3 ƒ e	 e4 ƒ e	 e5 ƒ i  e d <i  e d7 <i  e d8 <e e/ d9 e ƒ e e/ d: e ƒ e e/ d; e ƒ e e/ d< e ƒ e e/ d= e ƒ e e/ d> e ƒ e e/ d? e ƒ e e/ d@ e ƒ e e/ dA e ƒ e e/ dB e ƒ e e/ dC e ƒ e e/ dD e ƒ e e/ dE e ƒ e e/ dF e ƒ e e/ dG e ƒ e e/ dH e ƒ e e/ dI e ƒ e e/ dJ e ƒ e e/ dK e ƒ e e/ dL e ƒ e e/ dM e ƒ e e/ dN e ƒ e e/ dO e ƒ e e/ dP e ƒ e e/ dQ e ƒ e e/ dR e ƒ e e/ dS e ƒ e e/ dT e ƒ e e/ dU e ƒ e e/ dV e ƒ e e/ dW e ƒ e e/ dX e ƒ e e/ dY e ƒ e e/ dZ e ƒ e e/ d[ e d\ d] d^ d_ d` g ƒ ƒ e e/ da e db dc dd de g ƒ ƒ e e/ df e d d d g ƒ ƒ e e/ dg e dh di dj dk g ƒ ƒ e e/ dl e db dm dn g ƒ ƒ e e/ do e d dp d dq dr g ƒ ƒ e e/ ds e dt du dv dw dx dy g ƒ ƒ e e/ dz e d{ d| d} g d~ d g ƒƒ e e/ d€ e d d d‚ g d~ dƒ g ƒƒ e e/ d„ e d… d† d‡ g ƒ ƒ e e/ dˆ e d‰ dŠ d‹ g ƒ ƒ e e/ dŒ e db d dŽ g d~ d g ƒƒ e e/ d e d d‘ d’ d“ g ƒ ƒ e e/ d” e d• d– d— d˜ g ƒ ƒ e e/ d™ e db dš d› dœ d dž g ƒ ƒ e e/ dŸ e d  d¡ d¢ d£ d¤ g d~ d¥ g ƒƒ e e/ d¦ d§ e ƒ e e/ d¨ d© e ƒ e e/ dª d« e ƒ e e/ d¬ d­ e ƒ e e/ d® d¯ e ƒ e e/ d° d± e ƒ e e/ d± d² e ƒ e e/ d³ d´ e dµ d¶ d· g ƒ ƒ e e/ d¸ d¹ e ƒ e  e/ dº d» ƒ e e/ d¼ e ƒ e e/ d½ e ƒ e e/ d¾ e ƒ e e/ d¿ e g  d~ d d g ƒƒ e e/ dÀ e ƒ e e/ dÁ e ƒ e e/ dÂ e ƒ e e/ dÃ e ƒ e e/ dÄ e ƒ e e/ dÅ e ƒ e e/ dÆ e ƒ e! e/ dÇ ƒ e e0 dÈ e ƒ e e0 dÉ e ƒ e e0 dÊ e ƒ e e0 d: e ƒ e e0 dË e ƒ e e0 dÌ e ƒ e e0 dÍ e ƒ e e0 dÎ e ƒ e e0 dÏ e ƒ e e0 dÐ e ƒ e e0 dÑ e ƒ e e0 dÒ e ƒ e e0 dÓ e ƒ e e0 dÔ e ƒ e e0 dÕ e ƒ e e0 dÖ e ƒ e e0 d× e ƒ e e0 dØ e ƒ e e0 dÙ e ƒ e e0 dÚ e ƒ e e0 dÛ e ƒ e e0 dÜ e ƒ e e0 dÝ e ƒ e e0 dÞ e ƒ e e0 dß e ƒ e e0 dà e ƒ e e0 dá e ƒ e e0 dâ e ƒ e e0 dã e ƒ e e0 dä e ƒ e e0 då e ƒ e e0 dæ e ƒ e e0 dç e ƒ e e0 dè e ƒ e e0 dé e ƒ e e0 dê e ƒ e e0 dë e ƒ e e0 dì e ƒ e e0 dí e ƒ e e0 dî e ƒ e e0 dï e ƒ e e0 dð e ƒ e e0 dñ e ƒ e e0 dS e ƒ e e0 dò e ƒ e e0 dó e ƒ e e0 dô e ƒ e e0 dõ e ƒ e e0 dö e ƒ e e0 d÷ e ƒ e e0 dø e ƒ e e0 dù e ƒ e e0 dú e ƒ e e0 dû e ƒ e e0 dü e ƒ e e0 dý e ƒ e dt dþ dÿ d dddddg	 d~ dg ƒZ7 e dt dd dd	d
d ddddd d d dd ddg ƒ Z8 e e0 de d d d g ƒ ƒ e e0 de db dddg ƒ ƒ e e0 de dddg ƒ ƒ e e0 de d d d g ƒ ƒ e e0 de dt dddg ƒ ƒ e e0 de db d d!d"d#g ƒ ƒ e e0 d$e dt d%d&g d~ d'd(d)d*g ƒƒ e e0 d+e7 ƒ e e0 d,e8 ƒ e e0 d-e d.d/d0g ƒ ƒ e e0 d1e ƒ e e0 d2e ƒ e e0 dz d3e d4d5d6g d~ d7g ƒƒ e e0 d8d9e ƒ e e0 d:d;e ƒ e e0 d<d=e ƒ e e0 d>d e ƒ e e0 d?d e ƒ e e0 d@d e ƒ e e0 dAd7 e ƒ e e0 dBd7 e ƒ e e0 dCe ƒ e e0 d½ e ƒ e e0 d¾ e ƒ e e0 dDe ƒ e e0 dEe ƒ e e0 dFe ƒ e e0 dGe ƒ e e0 dHe ƒ e e0 dÄ e ƒ e e0 dIe ƒ e e0 dJe ƒ e e0 dKe ƒ e e0 dLe g  d~ dMdNdOg ƒƒ e e0 dPe g  d~ dMdQdRdSg ƒƒ e e0 dTe g  d~ dMd dUg ƒƒ e e2 d: e ƒ e e2 d9 e ƒ e e2 dVe dWdXƒ ƒ e e2 dI e ƒ e e2 dM e ƒ e e2 dYe ƒ e e2 d$e ƒ e e2 dS e ƒ e e2 dV e ƒ e e2 dZe ƒ e e2 dÄ e ƒ e e1 d9 e ƒ e e1 d: e ƒ e e1 d[e ƒ e e1 d\e ƒ e e1 d]e ƒ e e1 d^e ƒ e e1 d_e ƒ e e1 d`e ƒ e e1 dae ƒ e e1 dbe ƒ e e1 dce ƒ e e1 dI e ƒ e e1 dde ƒ e e1 dee ƒ e e1 dfe ƒ e e1 dM e ƒ e e1 dge ƒ e e1 dhe ƒ e e1 dS e ƒ e e1 die ƒ e e1 dV e ƒ e e1 d¸ e ƒ e e1 dje dkdldmg ƒ ƒ e e1 dne dt dodpdqg ƒ ƒ e e1 dre dsd{ d^ g ƒ ƒ e e1 d™ e dt dtdudvdwg ƒ ƒ e e1 dŸ e dxdtdudydvg ƒ ƒ e e1 dzd{e ƒ e e1 d|d}e ƒ e e1 d~e ƒ e e1 de ƒ e e1 d€e g  d~ dd{ g ƒƒ e e1 d‚e g  d~ dd{ g ƒƒ e e1 dƒe ƒ e e1 d„e ƒ e e1 d…e ƒ e e1 dÄ e ƒ e e1 d†e g  d~ d‡dˆg ƒƒ e e3 dÈ e ƒ e e3 dÉ e ƒ e e3 d: e ƒ e e3 d‰e ƒ e e3 dÕ e ƒ e e3 dÛ e ƒ e e3 d9e ƒ e e3 dæ e ƒ e e3 dç e ƒ e e3 dS e ƒ e e3 d½ e ƒ e e3 de ƒ e e3 d,e8 ƒ e e3 dAd7 e ƒ e e3 dŠe ƒ e e3 dz e g  d~ d5d6d7d4g ƒƒ e e3 d1e ƒ e e3 d‹e ƒ e e3 dŒe ƒ e e3 d+e7 ƒ e e3 dÄ e ƒ e e3 de ƒ e e3 dŽe ƒ e e4 de ƒ e e4 d: e ƒ e e4 de ƒ e e4 d‘e ƒ e e4 d’e ƒ e e4 d“e ƒ e e4 d”e ƒ e e4 d•e ƒ e e4 d–e ƒ e e4 dS e ƒ e e4 dô e ƒ e e4 d—e ƒ e e4 d˜e ƒ e e4 d™e ƒ e e4 dšd8 dYe ƒ e e4 d›d e ƒ e e4 dœe ƒ e e4 de ƒ e e4 d½ e ƒ e e4 dže ƒ e e4 dŸe ƒ e e4 d e ƒ e e4 d¡e ƒ e e4 d¢e ƒ e e4 dÄ e ƒ e e5 d£e ƒ d S(¥  s9  Code to validate and convert settings of the Microsoft build tools.

This file contains code to validate and convert settings of the Microsoft
build tools.  The function ConvertToMSBuildSettings(), ValidateMSVSSettings(),
and ValidateMSBuildSettings() are the entry points.

This file was created by comparing the projects created by Visual Studio 2008
and Visual Studio 2010 for all available settings through the user interface.
The MSBuild schemas were also considered.  They are typically found in the
MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
iÿÿÿÿNt   _Toolc           B   s   e  Z d  Z d „  Z RS(   s    Represents a tool used by MSVS or MSBuild.

  Attributes:
      msvs_name: The name of the tool in MSVS.
      msbuild_name: The name of the tool in MSBuild.
  c         C   s   | |  _  | |  _ d  S(   N(   t	   msvs_namet   msbuild_name(   t   selfR   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   __init__+   s    	(   t   __name__t
   __module__t   __doc__R   (    (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR    #   s   c         C   s;   i  t  |  j <i  t |  j <i  t |  j <|  j t |  j <d S(   s·   Adds a tool to the four dictionaries used to process settings.

  This only defines the tool.  Each setting also needs to be added.

  Args:
    tool: The _Tool object to be added.
  N(   t   _msvs_validatorsR   t   _msbuild_validatorsR   t   _msvs_to_msbuild_converterst   _msbuild_name_of_tool(   t   tool(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   _AddTool0   s    c         C   s   |  j  | j i  ƒ S(   s:   Returns an MSBuild tool dictionary.  Creates it if needed.(   t
   setdefaultR   (   t   msbuild_settingsR   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   _GetMSBuildToolSettings>   s    t   _Typec           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s   Type of settings (Base class).c         C   s   d S(   s§   Verifies that the value is legal for MSVS.

    Args:
      value: the value to check for this type.

    Raises:
      ValueError if value is not valid for MSVS.
    N(    (   R   t   value(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   ValidateMSVSF   t    c         C   s   d S(   s­   Verifies that the value is legal for MSBuild.

    Args:
      value: the value to check for this type.

    Raises:
      ValueError if value is not valid for MSBuild.
    N(    (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   ValidateMSBuildP   R   c         C   s   | S(   sÐ   Returns the MSBuild equivalent of the MSVS value given.

    Args:
      value: the MSVS value to convert.

    Returns:
      the MSBuild equivalent.

    Raises:
      ValueError if value is not valid.
    (    (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   ConvertToMSBuildZ   s    (   R   R   R   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   C   s   	
	
t   _Stringc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s   A setting that's just a string.c         C   s&   t  | t ƒ s" t d | ƒ ‚ n  d  S(   Ns   expected string; got %r(   t
   isinstancet
   basestringt
   ValueError(   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   l   s    c         C   s&   t  | t ƒ s" t d | ƒ ‚ n  d  S(   Ns   expected string; got %r(   R   R   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   p   s    c         C   s
   t  | ƒ S(   N(   t   ConvertVCMacrosToMSBuild(   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   t   s    (   R   R   R   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   i   s   		t   _StringListc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s$   A settings that's a list of strings.c         C   s7   t  | t ƒ r3 t  | t ƒ r3 t d | ƒ ‚ n  d  S(   Ns   expected string list; got %r(   R   R   t   listR   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   |   s     c         C   s7   t  | t ƒ r3 t  | t ƒ r3 t d | ƒ ‚ n  d  S(   Ns   expected string list; got %r(   R   R   R   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   €   s     c         C   s:   t  | t ƒ r, g  | D] } t | ƒ ^ q St | ƒ Sd  S(   N(   R   R   R   (   R   R   t   i(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   „   s    (   R   R   R   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   y   s   		t   _Booleanc           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s8   Boolean settings, can have the values 'false' or 'true'.c         C   s/   | d k r+ | d k r+ t  d | ƒ ‚ n  d  S(   Nt   truet   falses   expected bool; got %r(   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt	   _Validate   s    c         C   s   |  j  | ƒ d  S(   N(   R"   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   “   s    c         C   s   |  j  | ƒ d  S(   N(   R"   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   –   s    c         C   s   |  j  | ƒ | S(   N(   R"   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   ™   s    (   R   R   R   R"   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   Œ   s
   			t   _Integerc           B   s5   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z RS(   s   Integer settings.i
   c         C   s   t  j |  ƒ | |  _ d  S(   N(   R   R   t   _msbuild_base(   R   t   msbuild_base(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   ¡   s    c         C   s   |  j  | ƒ d  S(   N(   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   ¥   s    c         C   s   t  | |  j ƒ d  S(   N(   t   intR$   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   ©   s    c         C   s)   |  j  d k r d p d } | t | ƒ S(   Ni
   s   %ds   0x%04x(   R$   R&   (   R   R   t   msbuild_format(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   ­   s    (   R   R   R   R   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR#   ž   s
   		t   _Enumerationc           B   s5   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z RS(   sÅ  Type of settings that is an enumeration.

  In MSVS, the values are indexes like '0', '1', and '2'.
  MSBuild uses text labels that are more representative, like 'Win32'.

  Constructor args:
    label_list: an array of MSBuild labels that correspond to the MSVS index.
        In the rare cases where MSVS has skipped an index value, None is
        used in the array to indicate the unused spot.
    new: an array of labels that are new to MSBuild.
  c         C   sR   t  j |  ƒ | |  _ t d „  | Dƒ ƒ |  _ | d  k	 rN |  j j | ƒ n  d  S(   Nc         s   s!   |  ] } | d  k	 r | Vq d  S(   N(   t   None(   t   .0R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pys	   <genexpr>Â   s    (   R   R   t   _label_listt   sett   _msbuild_valuesR)   t   update(   R   t
   label_listt   new(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   ¿   s
    	c         C   s   |  j  | ƒ d  S(   N(   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   Ç   s    c         C   s&   | |  j  k r" t d | ƒ ‚ n  d  S(   Ns    unrecognized enumerated value %s(   R-   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   Ë   s    c         C   s   t  | ƒ } | d k  s- | t |  j ƒ k rO t d | t |  j ƒ f ƒ ‚ n  |  j | } | d  k r{ t d | ƒ ‚ n  | S(   Ni    s.   index value (%d) not in expected range [0, %d)s%   converted value for %s not specified.(   R&   t   lenR+   R   R)   (   R   R   t   indext   label(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   Ï   s    !N(   R   R   R   R)   R   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR(   ²   s
   		R   R!   R    c         C   s   t  |  | | | ƒ d S(   sæ   Defines a setting that has the same name in MSVS and MSBuild.

  Args:
    tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
    name: the name of the setting.
    setting_type: the type of this setting.
  N(   t   _Renamed(   R   t   namet   setting_type(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   _Sameé   s    c            sR   ‡  ‡ ‡ f d †  } ˆ j  t ˆ j | <ˆ j t ˆ j ˆ  <| t ˆ j | <d S(   s  Defines a setting for which the name has changed.

  Args:
    tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
    msvs_name: the name of the MSVS setting.
    msbuild_name: the name of the MSBuild setting.
    setting_type: the type of this setting.
  c            s&   t  | ˆ ƒ } ˆ j |  ƒ | ˆ  <d  S(   N(   R   R   (   R   R   t   msbuild_tool_settings(   R   R6   R   (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt
   _Translateþ   s    N(   R   R   R   R   R	   R   R
   (   R   R   R   R6   R9   (    (   R   R6   R   s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR4   ô   s    
c         C   s   t  |  | | | | ƒ d  S(   N(   t   _MovedAndRenamed(   R   t   settings_namet   msbuild_tool_nameR6   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   _Moved  s    c            sU   ‡  ‡ ‡ f d †  } ˆ j  t |  j | <ˆ j } | t ˆ ˆ  <| t |  j | <d S(   s  Defines a setting that may have moved to a new section.

  Args:
    tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
    msvs_settings_name: the MSVS name of the setting.
    msbuild_tool_name: the name of the MSBuild tool to place the setting under.
    msbuild_settings_name: the MSBuild name of the setting.
    setting_type: the type of this setting.
  c            s)   | j  ˆ i  ƒ } ˆ j |  ƒ | ˆ  <d  S(   N(   R   R   (   R   R   t   tool_settings(   t   msbuild_settings_nameR<   R6   (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR9     s    N(   R   R   R   R   R	   R
   (   R   t   msvs_settings_nameR<   R?   R6   R9   t	   validator(    (   R?   R<   R6   s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR:     s
    	c         C   s2   d „  } | j  t |  j | <| t |  j | <d S(   sÖ   Defines a setting that is only found in MSVS.

  Args:
    tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
    name: the name of the setting.
    setting_type: the type of this setting.
  c         S   s   d  S(   N(    (   t   unused_valuet   unused_msbuild_settings(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR9   -  s    N(   R   R   R   R
   (   R   R5   R6   R9   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt	   _MSVSOnly$  s    		c            s;   ‡  ‡ f d †  } | j  t ˆ j ˆ  <| t ˆ j ˆ  <d S(   sÙ   Defines a setting that is only found in MSBuild.

  Args:
    tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
    name: the name of the setting.
    setting_type: the type of this setting.
  c            s#   | j  ˆ j i  ƒ } |  | ˆ  <d  S(   N(   R   R   (   R   R   R>   (   R5   R   (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR9   >  s    N(   R   R	   R   R
   R   (   R   R5   R6   R9   (    (   R5   R   s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   _MSBuildOnly5  s    	c            s;   ‡  ‡ f d †  } t  j t ˆ j | <| t ˆ j | <d S(   s+  Defines a setting that's handled via a command line option in MSBuild.

  Args:
    tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
    msvs_name: the name of the MSVS setting that if 'true' becomes a flag
    flag: the flag to insert at the end of the AdditionalOptions
  c            sU   |  d k rQ t  | ˆ ƒ } d | k r> d | d ˆ  f } n ˆ  } | | d <n  d  S(   NR    t   AdditionalOptionss   %s %s(   R   (   R   R   R>   t	   new_flags(   t   flagR   (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR9   P  s    N(   t   _booleanR   R   R   R
   (   R   R   RH   R9   (    (   RH   R   s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   _ConvertedToAdditionalOptionG  s    	c            sw   ‡  f d †  } t  d d d g ƒ j } | t ˆ  j | <t j } t ˆ  j } | | d <| | d <| t ˆ  j | <d  S(   Nc            sŒ   t  | ˆ  ƒ } |  d k r2 d | d <d | d <nV |  d k rU d | d <d | d <n3 |  d k rx d | d <d | d <n t d |  ƒ ‚ d  S(	   Nt   0R!   t   PreprocessToFilet   PreprocessSuppressLineNumberst   1R    t   2s&   value must be one of [0, 1, 2]; got %s(   R   R   (   R   R   R>   (   R   (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR9   ]  s    


t   at   bt   cRL   RM   (	   R(   R   R   R   RI   R   R	   R   R
   (   R   R   R9   t   msvs_validatort   msbuild_validatort   msbuild_tool_validators(    (   R   s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   _CustomGeneratePreprocessedFile\  s    	

t   IntDirt   OutDirs   (\$\((?:%s)\))(?:[\\/]+)t   |s   ^(.*)_excluded$c         C   sS   t  } t j t |  ƒ } | r< | j d ƒ } | | k } n  | rO | | IJn  d S(   s§  Verify that 'setting' is valid if it is generated from an exclusion list.

  If the setting appears to be generated from an exclusion list, the root name
  is checked.

  Args:
      setting:   A string that is the setting name to validate
      settings:  A dictionary where the keys are valid settings
      error_msg: The message to emit in the event of error
      stderr:    The stream receiving the error messages.
  i   N(   t   Truet   ret   matcht   _EXCLUDED_SUFFIX_REt   group(   t   settingt   settingst	   error_msgt   stderrt   unrecognizedt   mt   root_setting(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   _ValidateExclusionSetting}  s    c         C   s%   d |  k r! t  j d |  ƒ }  n  |  S(   s  Replace macros which have excessive following slashes.

  These macros are known to have a built-in trailing slash. Furthermore, many
  scripts hiccup on processing paths with extra slashes in the middle.

  This list is probably not exhaustive.  Add as needed.
  t   $s   \1(   t   fix_vc_macro_slashes_regext   sub(   t   s(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   FixVCMacroSlashes–  s    c         C   s“   d |  k r i	 d d 6d d 6d d 6d d	 6d
 d 6d d 6d d 6d d 6d
 d 6} x, | j  ƒ  D] \ } } |  j | | ƒ }  q^ Wt |  ƒ }  n  |  S(   s‚   Convert the MSVS macros found in the string to the MSBuild equivalent.

  This list is probably not exhaustive.  Add as needed.
  Rg   s   $(Configuration)s   $(ConfigurationName)s   %(RelativeDir)s   $(InputDir)s   %(Extension)s   $(InputExt)s   %(Filename)%(Extension)s   $(InputFileName)s   %(Filename)s   $(InputName)s   %(Identity)s   $(InputPath)s   $(ProjectFileName)s   $(ParentName)s   $(Platform)s   $(PlatformName)s   $(SafeInputName)(   t	   iteritemst   replaceRk   (   Rj   t   replace_mapt   oldR0   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyR   £  s    
c   	      C   sÙ   i  } xÌ |  j  ƒ  D]¾ \ } } | t k rÃ t | } x™ | j  ƒ  D]z \ } } | | k rŸ y | | | | ƒ Wq¼ t k
 r› } | d | | | f IJq¼ XqB t | | d | | f | ƒ qB Wq | d | IJq W| S(   sù  Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+).

  Args:
      msvs_settings: A dictionary.  The key is the tool name.  The values are
          themselves dictionaries of settings and their values.
      stderr: The stream receiving the error messages.

  Returns:
      A dictionary of MSBuild settings.  The key is either the MSBuild tool name
      or the empty string (for the global settings).  The values are themselves
      dictionaries of settings and their values.
  s.   Warning: while converting %s/%s to MSBuild, %ss@   Warning: unrecognized setting %s/%s while converting to MSBuild.s:   Warning: unrecognized tool %s while converting to MSBuild.(   Rl   R
   R   Rf   (	   t   msvs_settingsRb   R   t   msvs_tool_namet   msvs_tool_settingst	   msvs_toolt   msvs_settingt
   msvs_valuet   e(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   ConvertToMSBuildSettingsº  s&    

c         C   s   t  t |  | ƒ d S(   s  Validates that the names of the settings are valid for MSVS.

  Args:
      settings: A dictionary.  The key is the tool name.  The values are
          themselves dictionaries of settings and their values.
      stderr: The stream receiving the error messages.
  N(   t   _ValidateSettingsR   (   R`   Rb   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   ValidateMSVSSettingsà  s    c         C   s   t  t |  | ƒ d S(   s  Validates that the names of the settings are valid for MSBuild.

  Args:
      settings: A dictionary.  The key is the tool name.  The values are
          themselves dictionaries of settings and their values.
      stderr: The stream receiving the error messages.
  N(   Rx   R	   (   R`   Rb   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   ValidateMSBuildSettingsë  s    c         C   sÈ   xÁ | D]¹ } | |  k r² |  | } xš | | j  ƒ  D]w \ } } | | k rŽ y | | | ƒ Wq« t k
 rŠ } | d | | | f IJq« Xq4 t | | d | | f | ƒ q4 Wq | d | IJq Wd S(   s  Validates that the settings are valid for MSBuild or MSVS.

  We currently only validate the names of the settings, not their values.

  Args:
      validators: A dictionary of tools and their validators.
      settings: A dictionary.  The key is the tool name.  The values are
          themselves dictionaries of settings and their values.
      stderr: The stream receiving the error messages.
  s   Warning: for %s/%s, %ss#   Warning: unrecognized setting %s/%ss   Warning: unrecognized tool %sN(   Rl   R   Rf   (   t
   validatorsR`   Rb   t	   tool_namet   tool_validatorsR_   R   Rv   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyRx   ö  s     

t   VCCLCompilerToolt	   ClCompilet   VCLinkerToolt   Linkt
   VCMIDLToolt   Midlt   VCResourceCompilerToolt   ResourceCompilet   VCLibrarianToolt   Libt   VCManifestToolt   Manifestt   MASMt   ProjectReferencet   ManifestResourceCompilet   AdditionalIncludeDirectoriesRF   t   AdditionalUsingDirectoriest   AssemblerListingLocationt   BrowseInformationFilet   BufferSecurityCheckt   DisableLanguageExtensionst   DisableSpecificWarningst   EnableFiberSafeOptimizationst   EnablePREfastt   ExpandAttributedSourcet   FloatingPointExceptionst   ForceConformanceInForLoopScopet   ForcedIncludeFilest   ForcedUsingFilest   GenerateXMLDocumentationFilest   IgnoreStandardIncludePatht   MinimalRebuildt   OmitDefaultLibNamet   OmitFramePointerst   PreprocessorDefinitionst   ProgramDataBaseFileNamet   RuntimeTypeInfot   ShowIncludest   SmallerTypeCheckt   StringPoolingt   SuppressStartupBannert   TreatWChar_tAsBuiltInTypet"   UndefineAllPreprocessorDefinitionst   UndefinePreprocessorDefinitionst   UseFullPathst   WholeProgramOptimizationt   XMLDocumentationFileNamet   CompileAsWinRTt   AssemblerOutputt	   NoListingt   AssemblyCodet   Allt   AssemblyAndMachineCodet   AssemblyAndSourceCodet   BasicRuntimeCheckst   Defaultt   StackFrameRuntimeCheckt   UninitializedLocalUsageCheckt   EnableFastCheckst   BrowseInformationt   CallingConventiont   Cdeclt   FastCallt   StdCallt
   VectorCallt	   CompileAst
   CompileAsCt   CompileAsCppt   DebugInformationFormatt   OldStylet   ProgramDatabaset   EditAndContinuet   EnableEnhancedInstructionSett   NotSett   StreamingSIMDExtensionst   StreamingSIMDExtensions2t   AdvancedVectorExtensionst   NoExtensionst   AdvancedVectorExtensions2t   ErrorReportingR)   t   Promptt   QueueR0   t   Sendt   ExceptionHandlingt   Synct   Asynct
   SyncCThrowt   FavorSizeOrSpeedt   Neithert   Speedt   Sizet   FloatingPointModelt   Preciset   Strictt   Fastt   InlineFunctionExpansiont   OnlyExplicitInlinet   AnySuitablet   Disabledt   Optimizationt   MinSpacet   MaxSpeedt   Fullt   RuntimeLibraryt   MultiThreadedt   MultiThreadedDebugt   MultiThreadedDLLt   MultiThreadedDebugDLLt   StructMemberAlignmentt   1Bytet   2Bytest   4Bytest   8Bytest   16Bytest   WarningLevelt   TurnOffAllWarningst   Level1t   Level2t   Level3t   Level4t   EnableAllWarningst   EnableFunctionLevelLinkingt   FunctionLevelLinkingt   EnableIntrinsicFunctionst   IntrinsicFunctionst   KeepCommentst   PreprocessKeepCommentst
   ObjectFilet   ObjectFileNamet   OpenMPt   OpenMPSupportt   PrecompiledHeaderThrought   PrecompiledHeaderFilet   PrecompiledHeaderOutputFilet   UsePrecompiledHeadert   PrecompiledHeadert   NotUsingt   Createt   Uset   WarnAsErrort   TreatWarningAsErrort   DefaultCharIsUnsigneds   /Jt   Detect64BitPortabilityProblemst   UseUnicodeResponseFilest   BuildingInIDEt   CompileAsManagedt   CreateHotpatchableImaget   MultiProcessorCompilationt   PreprocessOutputPatht   ProcessorNumbert   TrackerLogDirectoryt   TreatSpecificWarningsAsErrorst   UseUnicodeForAssemblerListingt   GeneratePreprocessedFilet   AdditionalDependenciest   AdditionalLibraryDirectoriest   AdditionalManifestDependenciest   AddModuleNamesToAssemblyt   AllowIsolationt   AssemblyLinkResourcet   BaseAddresst   CLRUnmanagedCodeCheckt   DelayLoadDLLst	   DelaySignt   EmbedManagedResourceFilet	   EnableUACt   EntryPointSymbolt   ForceSymbolReferencest   FunctionOrdert   GenerateDebugInformationt   GenerateMapFilet   HeapCommitSizet   HeapReserveSizet   IgnoreAllDefaultLibrariest   IgnoreEmbeddedIDLt   ImportLibraryt   KeyContainert   KeyFilet   ManifestFilet
   MapExportst   MapFileNamet   MergedIDLBaseFileNamet   MergeSectionst   MidlCommandFilet   ModuleDefinitionFilet
   OutputFilet   PerUserRedirectiont   Profilet   ProfileGuidedDatabaset   ProgramDatabaseFilet   RegisterOutputt   SetChecksumt   StackCommitSizet   StackReserveSizet   StripPrivateSymbolst   SupportUnloadOfDelayLoadedDLLt   SwapRunFromCDt   TurnOffAssemblyGenerationt   TypeLibraryFilet   TypeLibraryResourceIDt   UACUIAccesst   Versiont   EnableCOMDATFoldingt   FixedBaseAddresst   LargeAddressAwaret   OptimizeReferencest   RandomizedBaseAddresst   TerminalServerAwaret   Consolet   Windowst   Natives   EFI Applications   EFI Boot Service Drivers   EFI ROMs   EFI Runtimet	   WindowsCEt   POSIXt
   MachineX86t
   MachineARMt
   MachineEBCt   MachineIA64t   MachineMIPSt   MachineMIPS16t   MachineMIPSFPUt   MachineMIPSFPU16t
   MachineSH4t   MachineTHUMBt
   MachineX64t   AssemblyDebugt   CLRImageTypet   ForceIJWImaget   ForcePureILImaget   ForceSafeILImaget   CLRThreadAttributet   DefaultThreadingAttributet   MTAThreadingAttributet   STAThreadingAttributet   DataExecutionPreventiont   Drivert   UpOnlyt   WDMt   LinkTimeCodeGenerationt   UseLinkTimeCodeGenerationt   PGInstrumentt   PGOptimizationt   PGUpdatet   ShowProgresst   LinkVerboset   LinkVerboseLibt   LinkVerboseICFt   LinkVerboseREFt   LinkVerboseSAFESEHt   LinkVerboseCLRt	   SubSystemt   TargetMachinet   UACExecutionLevelt	   AsInvokert   HighestAvailablet   RequireAdministratort   MinimumRequiredVersiont   TreatLinkerWarningAsErrorst   LinkErrorReportingt   NoErrorReportt   PromptImmediatelyt   QueueForNextLogint   SendErrorReportt   IgnoreDefaultLibraryNamest   IgnoreSpecificDefaultLibrariest   ResourceOnlyDLLt   NoEntryPointt   SwapRunFromNett   SwapRunFromNETt   GenerateManifestt   IgnoreImportLibraryt   LinkIncrementalt   LinkLibraryDependenciest   UseLibraryDependencyInputst   OptimizeForWindows98t   ImageHasSafeExceptionHandlerst   LinkDLLt
   LinkStatust   PreventDllBindingt   SupportNobindOfDelayLoadedDLLt   MSDOSStubFileNamet   SectionAlignmentt   SpecifySectionAttributest   ForceFileOutputt   Enabledt   MultiplyDefinedSymbolOnlyt   UndefinedSymbolOnlyt   CreateHotPatchableImaget   X86Imaget   X64Imaget   ItaniumImaget   CLRSupportLastErrort
   SystemDllst   CultureR%   i   t   ResourceOutputFileNamet   NullTerminateStringst   CPreprocessOptionst   ErrorCheckAllocationst   ErrorCheckBoundst   ErrorCheckEnumRanget   ErrorCheckRefPointerst   ErrorCheckStubDatat   GenerateStublessProxiest   GenerateTypeLibraryt   HeaderFileNamet   InterfaceIdentifierFileNamet   MkTypLibCompatiblet   OutputDirectoryt   ProxyFileNamet   RedirectOutputAndErrorst   TypeLibraryNamet   DefaultCharTypet   Unsignedt   Signedt   Asciit   TargetEnvironmentt   Win32t   Itaniumt   X64t   EnableErrorCheckst   EnableCustomRN   RO   t   4t   8RK   t   3t   DLLDataFileNamet   DllDataFileNamet   ValidateParameterst   ValidateAllParameterst   ApplicationConfigurationModet   ClientStubFilet   GenerateClientFilest   Stubt   GenerateServerFilest   LocaleIDt   ServerStubFilet   SuppressCompilerWarningst   TypeLibFormatt	   NewFormatt	   OldFormatt   ExportNamedFunctionst   DisplayLibraryt   Namet   RemoveObjectst   TreatLibWarningAsErrorst   Verboset   AdditionalManifestFilest   AssemblyIdentityt   ComponentFileNamet   GenerateCatalogFilest   InputResourceManifestst   OutputManifestFilet   RegistrarScriptFilet   ReplacementsFilet   UpdateFileHashest   UpdateFileHashesSearchPatht   VerboseOutputt   ManifestResourceFilet   EmbedManifestt   DependencyInformationFilet   UseFAT32Workaroundt   EnableDPIAwarenesst   GenerateCategoryTagst   ManifestFromManagedAssemblyt   OutputResourceManifestst   SuppressDependencyElementt   UseSafeExceptionHandlers(   RW   RX   (9   R   t   sysR[   R   R	   R
   R   t   objectR    R   R   R   R   R   R   R#   R(   RI   t   _integert   _stringt
   _file_namet   _folder_namet
   _file_listt   _folder_listt   _string_listt   _newly_booleanR7   R4   R=   R:   RD   RE   RJ   RV   t   fix_vc_macro_slashes_regex_listt   compilet   joinRh   R]   Rb   Rf   Rk   R   Rw   Ry   Rz   Rx   t   _compilet   _linkt   _midlt   _rct   _libt	   _manifestt   _masmR)   t   _subsystem_enumerationt   _target_machine_enumeration(    (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSSettings.pyt   <module>   sþ  		&)																		&	!









																																														