�
��Zc�����������@���sl��d��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�g��Z�d�e
�f�d�������YZ�d�e
�f�d�������YZ�d����Z�d	����Z�d
����Z�d����Z�d����Z�d
����Z�d����Z�e�d���Z�d����Z�d����Z�d����Z�e�d���Z�e�d���Z�d����Z�d����Z �d����Z!�d����Z"�d����Z#�d����Z$�d�S(���s~���
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
i����N(���t���GypErrort
���XcodeSettingsc�����������B���s]��e��Z�d��Z�i��Z�i��Z�i��Z�i��Z�d����Z�d����Z�d����Z	�d����Z
�d<�d���Z�d����Z
�d����Z�d����Z�d	����Z�d
����Z�d����Z�d����Z�d
����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z �d����Z!�d<�d���Z"�d����Z#�d����Z$�d<�d���Z%�d����Z&�d ����Z'�d!����Z(�d"����Z)�d#����Z*�d$����Z+�d%����Z,�d&����Z-�d'����Z.�d(����Z/�d)����Z0�d<�d*���Z1�d+����Z2�d,����Z3�d<�d-���Z4�d<�d.���Z5�d/����Z6�d0����Z7�e8�d1���Z9�d2����Z:�d3����Z;�g��e8�d4���Z<�d<�d5���Z=�d<�d6���Z>�d7����Z?�d8����Z@�d<�d9���ZA�d:����ZB�d;����ZC�RS(=���s9���A class that understands the gyp 'xcode_settings' object.c���������C���s����|�|��_��t�|��_�i��|��_�|�d�}�xe�|�j����D]W�\�}�}�|�j�d�i����|��j�|�<|��j�|���|��j�|�j�d�d����r2�t�|��_�q2�q2�Wd��|��_	�t
�j�d���|��_�d��S(���Nt���configurationst���xcode_settingst���IPHONEOS_DEPLOYMENT_TARGETs���^lib([^/]+)\.(a|dylib)$(
���t���spect���Falset���isIOSR���t	���iteritemst���gett���_ConvertConditionalKeyst���Nonet���Truet
���confignamet���ret���compilet
���library_re(���t���selfR���t���configsR
���t���config(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���__init__*���s����			

		c���������C���s����|��j��|�}�g��|�D]�}�|�j�d���r�|�^�q�}�xl�|�D]d�}�|�j�d���r��|�j�d���r��|�j�d���d�}�|�|�|�|�<q��n�d�Gd�j�|���GH|�|�=q<�Wd�S(	���s����Converts or warns on conditional keys.  Xcode supports conditional keys,
    such as CODE_SIGN_IDENTITY[sdk=iphoneos*].  This is a partial implementation
    with some keys converted while the rest force a warning.t���]s���[sdk=iphoneos*]t���iphoneost���[i����s4���Warning: Conditional keys not implemented, ignoring:t��� N(���R���t���endswitht���splitt���join(���R���R
���t���settingst���keyt���conditional_keyst���new_key(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyR
���B���s����
(
c���������C���s���|��j��s�t���|��j�|��j��S(���N(���R
���t���AssertionErrorR���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt	���_SettingsS���s����c���������C���s���|��j�����j�|�|���|�k�S(���N(���R!���R	���(���R���t���test_keyt���cond_keyt���default(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_TestW���s����c���������C���sZ���|�|��j�����k�r6�|�j�|�t�|��j�����|�����n �|�rV�|�j�|�t�|�����n��d��S(���N(���R!���t���appendt���str(���R���t���lstR"���t
���format_strR$���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_AppendfZ���s����$c���������C���s"���|�|��j�����k�r�d�|�GHn��d��S(���Ns/���Warning: Ignoring not yet implemented key "%s".(���R!���(���R���R"���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_WarnUnimplemented`���s����c���������C���s���t��|��j�j�d�d�����d�k�S(���Nt
���mac_bundlei����(���t���intR���R	���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt	���_IsBundled���s����c���������C���s%���|��j�����s�t���|��j�d�d�d��S(���sP���Returns the framework version of the current target. Only valid for
    bundles.t���FRAMEWORK_VERSIONR$���t���A(���R.���R ���t���GetPerTargetSetting(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetFrameworkVersiong���s����c���������C���s����|��j�����s�t���|��j�d�d�k�rp�i�d�d�6d�d�6|��j�d�}�|��j�d�d�|��}�d�|��j�j�d	�|���S|��j�d�d
�k�r��d�|��j�j�d	�d���St�s��t�d�|��j�d�|��j�d
�f�����d�S(���s[���Returns the bundle extension (.app, .framework, .plugin, etc).  Only
    valid for bundles.t���typet���loadable_modulet���shared_libraryt���bundlet	���frameworkt���WRAPPER_EXTENSIONR$���t���.t���product_extensiont
���executablet���apps*���Don't know extension for '%s', target '%s't���target_nameN(���s���loadable_modules���shared_library(���R.���R ���R���R1���R	���R���(���R���t���default_wrapper_extensiont���wrapper_extension(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetWrapperExtensionm���s����c���������C���s���|��j��j�d�|��j��d���S(���s���Returns PRODUCT_NAME.t���product_nameR=���(���R���R	���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetProductName���s����c���������C���s$���|��j�����r�|��j����S|��j����Sd�S(���s���Returns FULL_PRODUCT_NAME.N(���R.���t���GetWrapperNamet���_GetStandaloneBinaryPath(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetFullProductName����s����
c���������C���s&���|��j�����s�t���|��j����|��j����S(���s`���Returns the directory name of the bundle represented by this target.
    Only valid for bundles.(���R.���R ���RB���R@���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyRC�������s����c���������C���sw���|��j��r�|��j����S|��j����s%�t���|��j�d�d�k�rZ�t�j�j�|��j����d�|��j������St�j�j�|��j����d���Sd�S(���s����Returns the qualified path to the bundle's contents folder. E.g.
    Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.R3���R5���t���Versionst���ContentsN(	���R���RC���R.���R ���R���t���ost���pathR���R2���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetBundleContentsFolderPath����s����	
	c���������C���s>���|��j�����s�t���|��j�r%�|��j����St�j�j�|��j����d���S(���s}���Returns the qualified path to the bundle's resource folder. E.g.
    Chromium.app/Contents/Resources. Only valid for bundles.t	���Resources(���R.���R ���R���RJ���RH���RI���R���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetBundleResourceFolder����s����	
c���������C���s^���|��j�����s�t���|��j�d�d�k�r>�t�j�j�|��j����d���St�j�j�|��j����d�d���Sd�S(���sy���Returns the qualified path to the bundle's plist file. E.g.
    Chromium.app/Contents/Info.plist. Only valid for bundles.R3���R;���R4���s
���Info.plistRK���N(���s
���executables���loadable_module(���R.���R ���R���RH���RI���R���RJ���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetBundlePlistPath����s
����c���������C���s_���|��j�����r0�i�d�d�6d�d�6d�d�6|��j�d�Si�d�d�6d	�d�6d	�d�6d
�d�6|��j�d�Sd�S(
���s(���Returns the PRODUCT_TYPE of this target.s"���com.apple.product-type.applicationR;���s���com.apple.product-type.bundleR4���s ���com.apple.product-type.frameworkR5���R3���s���com.apple.product-type.tools&���com.apple.product-type.library.dynamics%���com.apple.product-type.library.statict���static_libraryN(���R.���R���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetProductType����s����c���������C���sO���|��j�����r$�|��j�d�d�k�r$�d�Si�d�d�6d�d�6d�d�6d	�d
�6|��j�d�S(���s'���Returns the MACH_O_TYPE of this target.R3���R;���t����t
���mh_executet	���staticlibRN���t���mh_dylibR5���t	���mh_bundleR4���(���R.���R���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetMachOType����s���� c���������C���s����|��j�����s�t���|��j�d�d�k�s.�|��j�r=�|��j����}�n1�|��j�d�d�k�rn�t�j�j�|��j����d���}�n��t�j�j�|�|��j������S(���s���Returns the name of the bundle binary of by this target.
    E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.R3���R5���R;���R4���t���MacOS(���s
���executables���loadable_module(	���R.���R ���R���R���RJ���RH���RI���R���t���GetExecutableName(���R���RI���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_GetBundleBinaryPath����s����c���������C���sI���d�|��j��k�r�d�|��j��d�Si�d�d�6d�d�6d�d�6d	�d
�6|��j��d�S(���NR:���R9���RP���R;���s���.aRN���s���.dylibR5���s���.soR4���R3���(���R���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_GetStandaloneExecutableSuffix����s����c���������C���s:���|��j��j�d�i�d�d�6d�d�6d�d�6d�d�6|��j��d���S(	���Nt���product_prefixRP���R;���t���libRN���R5���R4���R3���(���R���R	���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_GetStandaloneExecutablePrefix����s����c���������C���s����|��j�����s�t���|��j�d�d�k�s=�t�d�|��j�d�����|��j�d�}�|��j�d�d�k�r}�|�d� d	�k�r��|�d�}�q��n3�|��j�d�d�k�r��|�d� d	�k�r��|�d�}�q��n��|��j����}�|��j�j�d
�|���}�|��j����}�|�|�|�S(
���sw���Returns the name of the non-bundle binary represented by this target.
    E.g. hello_world. Only valid for non-bundles.R3���R;���R5���RN���R4���s���Unexpected type %sR=���i���R[���RA���(���s
���executables���shared_librarys���static_librarys���loadable_module(���s���loadable_modules���shared_library(���R.���R ���R���R\���R	���RY���(���R���t���targett
���target_prefixt
���target_ext(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyRD�������s����

c���������C���s4���|��j�����r&�|��j�j�d�|��j�d���S|��j����Sd�S(���sX���Returns the executable name of the bundle represented by this target.
    E.g. Chromium.RA���R=���N(���R.���R���R	���RD���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyRW�������s����c���������C���s$���|��j�����r�|��j����S|��j����Sd�S(���ss���Returns the directory name of the bundle represented by this target. E.g.
    Chromium.app/Contents/MacOS/Chromium.N(���R.���RX���RD���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetExecutablePath��s����
c���������C���s ���|��j��|�j�d�|��j����g���S(���s:���Returns the architectures this target should be built for.t���ARCHS(���R���R	���t���_DefaultArch(���R���R
���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetActiveArchs
��s����c���������C���s+���y�t��d�d�d�|�|�g���SWn�n�Xd��S(���Nt
���xcodebuilds���-versions���-sdk(���t	���GetStdout(���R���t���sdkt���infoitem(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_GetSdkVersionInfoItem��s����c���������C���s.���|�d��k�r�|��j�}�n��|��j�d�|�d�d��S(���Nt���SDKROOTR$���RP���(���R���R
���t���GetPerConfigSetting(���R���R
���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_SdkRoot��s����c���������C���s/���|��j��|���}�|�j�d���r"�|�S|��j�|���S(���Nt���/(���Rk���t
���startswitht
���_XcodeSdkPath(���R���R
���t���sdk_root(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_SdkPath"��s����c���������C���sR���|�t��j�k�rG�|��j�|�d���}�|�t��j�|�<|�rG�|�t��j�|�<qG�n��t��j�|�S(���Nt���Path(���R���t���_sdk_path_cacheRh���t���_sdk_root_cache(���R���Ro���t���sdk_path(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyRn���(��s����
c���������C���s����|��j��|�d�d���d�|��j����k�r~�t�j�j�|��j������}�|�j����j�d���rh�|��j��|�d�d���q~�|��j��|�d�d���n��d��S(���Nt���MACOSX_DEPLOYMENT_TARGETs���-mmacosx-version-min=%sR���t���iphonesimulators���-mios-simulator-version-min=%ss���-miphoneos-version-min=%s(���R*���R!���RH���RI���t���basenameRp���t���lowerRm���(���R���R(���t���sdk_path_basename(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_AppendPlatformVersionMinFlags0��s����
c���������C���s���|�|��_��g��}�|��j����}�d�|��j����k�rG�|�rG�|�j�d�|���n��|��j�d�d�d�d��ro�|�j�d���n��|��j�d�d�d�d��r��|�j�d	���n��|��j�d
�d�d�d��r��|�j�d���n��d�|��j����k�r��|��j����d�d�k�r��|�j�d
���q��n��|��j�d�d�d�d��r"|�j�d���n��|��j�|�d�d�d�d��|��j�d�d�d�d��r�|��j����j�d�d���}�|�d�k�r�|�j�d���q�|�d�k�r�t�d�����q�|�d�k�r�|�j�d���q�t�d�|�����n��|��j����j�d���d�k�r�|�j�d���n+�|��j����j�d���d�k�r'|�j�d���n��|��j�d�d�d�d��rO|�j�d���n��|��j�d �d�d�d��rw|�j�d!���n��|��j�d"�d�d�d��r�|�j�d#���n��|��j�|���|��j�d$�d�d�d��r�|��j	�d$���n��|��j	�d%���|��j	�d&���|��j	�d'���|��j	�d(���|�d=�k	�r |�g�}�n!�|��j����j�d)�|��j����g���}�t�|���d*�k�rl|��j	�d)���d+�g�}�n��|�j�d,�|�d-���|�d-�d>�k�r4|��j�d/�d�d�d��r�|�j�d0���n��|��j�d1�d�d�d��r�|�j�d2���n��|��j�d3�d�d�d��r	|�j�d4���n��|��j�d5�d�d�d��r4|�j�d6���q4n��|�|��j����j�d7�g����7}�|�r_|�}�n�d8�}�|��j
�d9�|��j��}�|�j�d:�g����}	�x+�|	�D]#�}
�|�j�d;�|
�j�d<�|�����q�Wd=�|��_��|�S(?���sM���Returns flags that need to be added to .c, .cc, .m, and .mm
    compilations.Ri���s���-isysroot %st���CLANG_WARN_CONSTANT_CONVERSIONt���YESR$���t���NOs���-Wconstant-conversiont���GCC_CHAR_IS_UNSIGNED_CHARs���-funsigned-chart���GCC_CW_ASM_SYNTAXs���-fasm-blockst���GCC_DYNAMIC_NO_PICs���-mdynamic-no-pict���GCC_ENABLE_PASCAL_STRINGSs���-mpascal-stringst���GCC_OPTIMIZATION_LEVELs���-O%st���st���GCC_GENERATE_DEBUGGING_SYMBOLSt���DEBUG_INFORMATION_FORMATt���dwarfs	���-gdwarf-2t���stabss(���stabs debug format is not supported yet.s���dwarf-with-dsyms���Unknown debug format %st���GCC_STRICT_ALIASINGs���-fstrict-aliasings���-fno-strict-aliasingt���GCC_SYMBOLS_PRIVATE_EXTERNs���-fvisibility=hiddent���GCC_TREAT_WARNINGS_AS_ERRORSs���-Werrort���GCC_WARN_ABOUT_MISSING_NEWLINEs
���-Wnewline-eoft���COPY_PHASE_STRIPt���GCC_DEBUGGING_SYMBOLSt���GCC_ENABLE_OBJC_EXCEPTIONSt���MACH_O_TYPEt���PRODUCT_TYPERa���i���t���i386s���-arch i����t���x86_64t���GCC_ENABLE_SSE3_EXTENSIONSs���-msse3t)���GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONSs���-mssse3t���GCC_ENABLE_SSE41_EXTENSIONSs���-msse4.1t���GCC_ENABLE_SSE42_EXTENSIONSs���-msse4.2t���WARNING_CFLAGSRP���R���t���mac_framework_dirss���-Fs
���$(SDKROOT)N(���s���i386s���x86_64(���R
���Rp���R!���R&���R%���R*���R	���t���NotImplementedErrorRz���R+���R���Rb���t���lenR���t���replace(���R���R
���t���archt���cflagsRo���t
���dbg_formatt���archst���framework_rootR���t���framework_dirst	���directory(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt	���GetCflags<��s�����	




!
		
!	c���������C���sy���|�|��_��g��}�|��j����j�d�d���d�k�r=�|�j�d���n�|��j�|�d�d���|�|��j����j�d�g����7}�d�|��_��|�S(���s?���Returns flags that need to be added to .c, and .m compilations.t���GCC_C_LANGUAGE_STANDARDRP���t���ansis���-ansis���-std=%st���OTHER_CFLAGSN(���R
���R!���R	���R&���R*���R���(���R���R
���t���cflags_c(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt
���GetCflagsC���s����		c���������C���s���|�|��_��g��}�|��j����j�d���}�|�r>�|�j�d�|���n��|��j�|�d�d���|��j�d�d�d�d��ry�|�j�d	���n��|��j�d
�d�d�d��r��|�j�d���n��|��j�d�d�d�d��r��|�j�d
���n��|��j�d�d�d�d��r��|�j�d���n��|��j�d�d�d�d��r|�j�d���n��g��}�xp�|��j����j�d�d�g���D]S�}�|�d�k�rVd�}�n��|�d�k�r�|�|��j����j�d�g����7}�q;|�j�|���q;W|�|�7}�d�|��_��|�S(���sA���Returns flags that need to be added to .cc, and .mm compilations.t���CLANG_CXX_LANGUAGE_STANDARDs���-std=%st���CLANG_CXX_LIBRARYs
���-stdlib=%st���GCC_ENABLE_CPP_RTTIR}���R$���R|���s	���-fno-rttit���GCC_ENABLE_CPP_EXCEPTIONSs���-fno-exceptionst���GCC_INLINES_ARE_PRIVATE_EXTERNs���-fvisibility-inlines-hiddent���GCC_THREADSAFE_STATICSs���-fno-threadsafe-staticst%���GCC_WARN_ABOUT_INVALID_OFFSETOF_MACROs���-Wno-invalid-offsetoft���OTHER_CPLUSPLUSFLAGSs���$(inherited)s
���$inheriteds���${inherited}s
���$OTHER_CFLAGSs���$(OTHER_CFLAGS)s���${OTHER_CFLAGS}R����(���s
���$inheriteds���$(inherited)s���${inherited}(���s
���$OTHER_CFLAGSs���$(OTHER_CFLAGS)s���${OTHER_CFLAGS}N(���R
���R!���R	���R&���R*���R%���R���(���R���R
���t	���cflags_cct���clang_cxx_language_standardt
���other_ccflagst���flag(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetCflagsCC���s6����		"	
	c���������C���sT���|��j�����j�d�d���}�|�d�k�r4�|�j�d���n�|�d�k�rP�|�j�d���n��d��S(���Nt���GCC_ENABLE_OBJC_GCt���unsupportedt	���supporteds	���-fobjc-gct���requireds���-fobjc-gc-only(���R!���R	���R&���(���R���t���flagst	���gc_policy(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt$���_AddObjectiveCGarbageCollectionFlags���s
����c���������C���s,���|��j��d�d�d�d��r(�|�j�d���n��d��S(���Nt���CLANG_ENABLE_OBJC_ARCR|���R$���R}���s
���-fobjc-arc(���R%���R&���(���R���R����(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_AddObjectiveCARCFlags���s����c���������C���s,���|��j��d�d�d�d��r(�|�j�d���n��d��S(���Nt*���CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESISR|���R$���R}���s!���-Wobjc-missing-property-synthesis(���R%���R&���(���R���R����(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt+���_AddObjectiveCMissingPropertySynthesisFlags���s����	c���������C���sC���|�|��_��g��}�|��j�|���|��j�|���|��j�|���d�|��_��|�S(���s7���Returns flags that need to be added to .m compilations.N(���R
���R����R����R����R���(���R���R
���t���cflags_objc(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt
���GetCflagsObjC���s����	


	c���������C���sk���|�|��_��g��}�|��j�|���|��j�|���|��j�|���|��j�d�d�d�d��r^�|�j�d���n��d�|��_��|�S(���s8���Returns flags that need to be added to .mm compilations.t���GCC_OBJC_CALL_CXX_CDTORSR|���R$���R}���s���-fobjc-call-cxx-cdtorsN(���R
���R����R����R����R%���R&���R���(���R���R
���t���cflags_objcc(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetCflagsObjCC���s����	


	c���������C���sa���|��j��d�d�k�r6�|��j��d�d�k�s2�|��j����r6�d�S|��j�d�d�|��j����rT�d�n�d��}�|�S(	���s/���Return DYLIB_INSTALL_NAME_BASE for this target.R3���R5���R4���t���DYLIB_INSTALL_NAME_BASER$���s���/Library/Frameworkss���/usr/local/libN(���R���R.���R���R1���(���R���t���install_base(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetInstallNameBase��s����c���������C���sq���d�|�k�rm�d�|�}�}�|�j��d���rC�|�j�d�d���\�}�}�n��t�j�j�|���}�t�j�j�|�|���}�n��|�S(���s(���Do :standardizepath processing for path.Rl���RP���t���@i���(���Rm���R���RH���RI���t���normpathR���(���R���RI���t���prefixt���rest(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_StandardizePath��s����
c���������C���s/��|��j��d�d�k�r6�|��j��d�d�k�s2�|��j����r6�d�Sd�}�|��j�d�d�|��}�d�|�k�r+|�d�|�f�k�s��t�d	�|��j��d
�|�f�����|�j�d�|��j�|��j��������}�|��j����r��|�j�d�|��j������}�|�j�d
�|��j	������}�n$�d�|�k�s��t���d
�|�k�st���|�j�d�|��j
������}�n��|�S(���s-���Return LD_DYLIB_INSTALL_NAME for this target.R3���R5���R4���s=���$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)t���LD_DYLIB_INSTALL_NAMER$���t���$sJ���$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(WRAPPER_NAME)/$(PRODUCT_NAME)s\���Variables in LD_DYLIB_INSTALL_NAME are not generally supported yet in target '%s' (got '%s')R=���s*���$(DYLIB_INSTALL_NAME_BASE:standardizepath)s���$(WRAPPER_NAME)s���$(PRODUCT_NAME)s���$(EXECUTABLE_PATH)N(���R���R.���R���R1���R ���R����R����R����RC���RB���R`���(���R���t���default_install_namet���install_name(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetInstallName��s0����c���	������C���s����d�}�d�}�d�|�g�d�|�g�d�|�g�d�|�|�|�g�g�}�xy�|�D]q�}�t��j�d�d�j�|�����}�|�j�|���}�|�rC�|�|�j�d	��� |�|�j�d	�����|�|�j�d	���}�qC�qC�W|�j�d
���r��d
�|�|�t�d
�����}�n��|�S(���su���Checks if ldflag contains a filename and if so remaps it from
    gyp-directory-relative to build-directory-relative.s���(\S+)s���\S+s���-exported_symbols_lists���-unexported_symbols_lists���-reexported_symbols_lists���-sectcreates	���(?:-Wl,)?s���[ ,]i���s���-L(	���R���R���R���t���matcht���startt���groupt���endRm���R����(	���R���t���ldflagt���gyp_to_build_patht���LINKER_FILEt���WORDt���linker_flagst���flag_patternt���regext���m(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_MapLinkerFlagFilename@��s����			
#c���������C���s���|�|��_��g��}�x9�|��j����j�d�g����D]�}�|�j�|��j�|�|�����q(�W|��j�d�d�d�d��rs�|�j�d���n��|��j�d�d�d�d��r��|�j�d���n��|��j�|�d	�d
���|��j�|�d�d���|��j�|���d
�|��j����k�r|��j����r|�j�d�|��j������n��x7�|��j����j�d�g����D]�}�|�j�d�|�|�����qWd�|��j����k�rv|�j�d%�|�|��j����d�����n��|�d&�k	�r�|�g�}�n!�|��j����j�d�|��j
����g���}�t�|���d�k�r�|��j�d���d�g�}�n��|�j�d�|�d���|�j�d�|���|��j
����}	�|	�rE|��j�d�d�k�rE|�j�d�|	�j�d�d�����n��x1�|��j����j�d�g����D]�}
�|�j�d�|
���q^W|��j����}�|�s�d �}�n��|��j�d!�|��j��}�|�j�d"�g����}
�x+�|
�D]#�}�|�j�d#�|�j�d$�|�����q�Wd&�|��_��|�S('���s���Returns flags that need to be passed to the linker.

    Args:
        configname: The name of the configuration to get ld flags for.
        product_dir: The directory where products such static and dynamic
            libraries are placed. This is added to the library search path.
        gyp_to_build_path: A function that converts paths relative to the
            current gyp file to paths relative to the build direcotry.
    t
���OTHER_LDFLAGSt���DEAD_CODE_STRIPPINGR|���R$���R}���s���-Wl,-dead_stript
���PREBINDINGs���-Wl,-prebindt���DYLIB_COMPATIBILITY_VERSIONs���-compatibility_version %st���DYLIB_CURRENT_VERSIONs���-current_version %sRi���s
���-isysroot t���LIBRARY_SEARCH_PATHSs���-Lt
���ORDER_FILEs���-Wl,-order_file s���-Wl,Ra���i���R����s���-arch i����R3���R4���s���-install_name R���s���\ t���LD_RUNPATH_SEARCH_PATHSs���-Wl,-rpath,RP���R���R����s���-Fs
���$(SDKROOT)s���-Wl,-order_file -Wl,N(���R
���R!���R	���R&���R����R%���R*���Rz���Rp���R���Rb���R����R+���R����R���R����(���R���R
���t���product_dirR����R����t���ldflagsR����t���library_pathR����R����t���rpathRo���R���R����R����(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt
���GetLdflags\��sV����
	


!
 	
!	c���������C���sL���|�|��_��g��}�x-�|��j����j�d�g����D]�}�|�j�|���q(�Wd�|��_��|�S(���s����Returns flags that need to be passed to the static linker.

    Args:
        configname: The name of the configuration to get ld flags for.
    R����N(���R
���R!���R	���R&���R���(���R���R
���t���libtoolflagst���libtoolflag(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetLibtoolflags���s����		c���������C���s����t��}�i��}�x��t�|��j�j������D]x�}�|�rJ�t�|��j�|���}�t�}�q"�xM�|��j�|�j����D]8�\�}�}�|�|�k�r|�q^�q^�|�|�|�k�r^�|�|�=q^�q^�Wq"�W|�S(���s~���Gets a list of all the per-target settings. This will only fetch keys
    whose values are the same across all configurations.(���R���t���sortedR���t���keyst���dictR���R���(���R���t
���first_passt���resultR
���R���t���value(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetPerTargetSettings���s����	 c���������C���s:���|�|��j��k�r&�|��j��|�j�|�|���S|��j�|�|���Sd��S(���N(���R���R	���R1���(���R���t���settingR
���R$���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyRj������s����c���������C���s����t��}�d�}�x��t�|��j�j������D]j�}�|�rP�|��j�|�j�|�d���}�t�}�q"�|�|��j�|�j�|�d���k�s"�t�d�|�|��j�d�f�����q"�W|�d�k�r��|�S|�S(���s����Tries to get xcode_settings.setting from spec. Assumes that the setting
       has the same value in all configurations and throws otherwise.sH���Expected per-target setting for '%s', got per-config setting (target %s)R=���N(	���R���R���R����R���R����R	���R���R ���R���(���R���R����R$���t
���is_first_passR����R
���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyR1������s����	"c���	������C���s=��|�|��_��g��}�|��j�d�d�d�d��r0|��j�d�d�d�d��r0d�}�|��j�d�d�k�rm�|��j����rm�d	�}�n�|��j�d�d
�k�r��d�}�n��|��j����j�d�|���}�i�d
�d�6d�d	�6d�d�6|�}�|��j����j�d�d
���}�|�r��|�d�t�|���7}�n��|�s|�j�d�|��j�d���n��|�j�d�|�|�f���n��d�|��_��|�S(���s����Returns a list of shell commands that contain the shell commands
    neccessary to strip this target's binary. These should be run as postbuilds
    before the actual postbuilds run.t���DEPLOYMENT_POSTPROCESSINGR|���R$���R}���t���STRIP_INSTALLED_PRODUCTt	���debuggingR3���R4���s
���non-globalR;���t���allt���STRIP_STYLERP���s���-xs���-St
���STRIPFLAGSR���s���echo STRIP\(%s\)R=���s���strip %s %sN(	���R
���R%���R���R.���R!���R	���t���_NormalizeEnvVarReferencesR&���R���(	���R���R
���t
���output_binaryt���quietR����t���default_strip_stylet���strip_stylet���strip_flagst���explicit_strip_flags(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_GetStripPostbuilds���s.����				c���������C���s����|�|��_��g��}�|��j�d�d�d�d��r��|��j�d�d�d�d��r��|��j�d�d�k�r��|�ss�|�j�d	�|��j�d
���n��|�j�d�|�|�d�f���n��d
�|��_��|�S(���s����Returns a list of shell commands that contain the shell commands
    neccessary to massage this target's debug information. These should be run
    as postbuilds before the actual postbuilds run.R����R|���R$���R����s���dwarf-with-dsymR����R3���RN���s���echo DSYMUTIL\(%s\)R=���s���dsymutil %s -o %ss���.dSYMN(���R
���R%���R���R&���R���(���R���R
���t���outputR���R��R����(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_GetDebugInfoPostbuilds���s����		c���������C���s)���|��j��|�|�|�|���|��j�|�|�|���S(���s����Returns a list of shell commands that contain the shell commands
    to run as postbuilds for this target, before the actual postbuilds.(���R��R��(���R���R
���R��R���R��(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_GetTargetPostbuilds��s����c���������C���s����|��j��o�|��j�d�d�k�s �g��S|��j�|�}�|��j�|���}�|�sF�g��Sd�g�}�t�|���t�|��j�|�j������@}�|�r��d�d�j�t�|�����GHn��d�t�j	�j�d�d���|�|�j
�d	�d
���|�j
�d�d
���|�j
�d�d
���f�g�S(
���s����Return a shell command to codesign the iOS output binary so it can
    be deployed to a device.  This should be run as the very last step of the
    build.R3���R;���t���OTHER_CODE_SIGN_FLAGSs9���Warning: Some codesign keys not implemented, ignoring: %ss���, s'���%s code-sign-bundle "%s" "%s" "%s" "%s"s���${TARGET_BUILD_DIR}s���gyp-mac-toolt���CODE_SIGN_RESOURCE_RULES_PATHRP���t���CODE_SIGN_ENTITLEMENTSt���PROVISIONING_PROFILE(���R���R���R���t���_GetIOSCodeSignIdentityKeyt���setR����R���R����RH���RI���R	���(���R���R
���R���R���R���t���unimpl(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_GetIOSPostbuilds��s ����
	#c���������C���s����|�j��d���}�|�s�d��S|�t�j�k�r��t�j�d�d�d�d�d�g���}�xx�|�j����D]g�}�|�|�k�rS�|�j����d�}�t�j�}�|�|�k�s��|�|�|�k�s��t�d�|�����|�t�j�|�<qS�qS�Wn��t�j�j��|�d	���S(
���Nt���CODE_SIGN_IDENTITYt���securitys
���find-identitys���-pt���codesignings���-vi���s2���Multiple codesigning fingerprints for identity: %sRP���(	���R	���R���R���t���_codesigning_key_cachet
���subprocesst���check_outputt
���splitlinesR���R ���(���R���R���t���identityR��t���linet���fingerprintt���cache(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyR��5��s����	
c���������C���sH���|�d�k	�s�t���|��j�|�|�|�|���}�|��j�|�|���}�|�|�|�S(���sS���Returns a list of shell commands that should run before and after
    |postbuilds|.N(���R���R ���R	��R��(���R���R
���R��R���t
���postbuildsR��t���pret���post(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���AddImplicitPostbuildsE��s����c���������C���s����|�j��d���r8�d�t�j�j�t�j�j�|�����d�}�n4�|��j�j�|���}�|�rf�d�|�j�d���}�n�|�}�|��j�|���}�|�s��d�}�n��|�j	�d�|���S(���Ns
���.frameworks���-framework i����s���-li���RP���s
���$(SDKROOT)(
���R���RH���RI���t���splitextRw���R���R����R����Rp���R����(���R���t���libraryt���config_namet���lR����Ro���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_AdjustLibraryN��s����)	c���������C���s)���g��|�D]�}�|��j��|�|���^�q�}�|�S(���s����Transforms entries like 'Cocoa.framework' in libraries into entries like
    '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc.
    (���R%��(���R���t	���librariesR#��R"��(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���AdjustLibraries]��s����"c���������C���s���t��d�d�g���S(���Nt���sw_verss
���-buildVersion(���Re���(���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_BuildMachineOSBuilde��s����c���������C���s?���|��j��|�j�d�d���}�g��|�j�d���D]�}�t�|���^�q)�S(���Nt���TARGETED_DEVICE_FAMILYt���1t���,(���R���R	���R���R-���(���R���R
���t���familyt���x(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_XcodeIOSDeviceFamilyh��s����c���������C���sK��|�t��j�k�ri��}�|��j����|�d�<t����\�}�}�|�|�d�<|�|�d�<|��j�|���}�|�sl�|��j����}�n��|�|�d�<|�d�k�r��|��j�|�d���|�d�<n�|�d�|�d�<|��j�r|�d�|�d�<|�j�d	���r��|��j�|�d
���|�d�<d�g�|�d
�<qd�g�|�d
�<n��|�t��j�|�<n��t	�t��j�|���}�|��j�rG|��j
�|���|�d�<n��|�S(���s@���Returns a dictionary with extra items to insert into Info.plist.t���BuildMachineOSBuildt���DTXcodet���DTXcodeBuildt	���DTSDKNamet���0430t���ProductBuildVersiont
���DTSDKBuildt���DTPlatformNameR���t���ProductVersiont���DTPlatformVersiont���iPhoneOSt���CFBundleSupportedPlatformst���iPhoneSimulatort���UIDeviceFamily(���R���t���_plist_cacheR)��t���XcodeVersionRk���t���_DefaultSdkRootRh���R���R���R����R/��(���R���R
���R��t���xcodet���xcode_buildRo���t���items(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetExtraPlistItemsl��s4����


		c���
������C���s����t�����\�}�}�|�d�k��r�d�S|��j�d���}�t�j�j�|���}�|�rJ�|�Sy�t�d�d�g���}�Wn�d�SXxn�|�j����D]`�}�|�j����}�t�|���d�k�rx�|�d�d�k�rx�|�d�}�|��j�|���}	�|	�|�k�r��|�Sqx�qx�Wd�S(	���s����Returns the default SDKROOT to use.

    Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode
    project, then the environment variable was empty. Starting with this
    version, Xcode uses the name of the newest SDK installed.
    t���0500RP���Rd���s	���-showsdksi���i����s���-sdki����(	���R?��Rn���R���Rs���R	���Re���R��R���R����(
���R���t
���xcode_versionRB��t���default_sdk_patht���default_sdk_roott���all_sdksR��RC��Ro���Rt���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyR@�����s&����"
c���������C���s0���|��j��r
�d�St����\�}�}�|�d�k�r,�d�Sd�S(���NR����RE��R����(���R���R?��(���R���t���versiont���build(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyRb������s����	N(D���t���__name__t
���__module__t���__doc__Rr���Rs���R>��R��R���R
���R!���R%���R���R*���R+���R.���R2���R@���RB���RE���RC���RJ���RL���RM���RO���RU���RX���RY���R\���RD���RW���R`���Rc���Rh���Rk���Rp���Rn���Rz���R����R����R����R����R����R����R����R����R����R����R����R����R����R����R����Rj���R1���R��R��R���R	��R��R��R ��R%��R'��R)��R/��RD��R@��Rb���(����(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyR������s����												
		
			
	
	
					
			l		)				
				&	I			"					%	t���MacPrefixHeaderc�����������B���sM���e��Z�d��Z�d����Z�d����Z�d�d���Z�d����Z�d�d���Z�d�d���Z	�RS(���s���A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature.

  This feature consists of several pieces:
  * If GCC_PREFIX_HEADER is present, all compilations in that project get an
    additional |-include path_to_prefix_header| cflag.
  * If GCC_PRECOMPILE_PREFIX_HEADER is present too, then the prefix header is
    instead compiled, and all other compilations in the project get an
    additional |-include path_to_compiled_header| instead.
    + Compiled prefix headers have the extension gch. There is one gch file for
      every language used in the project (c, cc, m, mm), since gch files for
      different languages aren't compatible.
    + gch files themselves are built with the target's normal cflags, but they
      obviously don't get the |-include| flag. Instead, they need a -x flag that
      describes their language.
    + All o files in the target need to depend on the gch file, to make sure
      it's built before any o file is built.

  This class helps with some of these tasks, but it needs help from the build
  system for writing dependencies to the gch files, for writing build commands
  for the gch files, and for figuring out the location of the gch files.
  c���������C���s����d	�|��_�t�|��_�|�rK�|�j�d���|��_�|�j�d�d�d��d�k�|��_�n��i��|��_�|��j�r��|��j�r��x6�d�d�d�d�g�D]�}�|�|��j�|���|��j�|�<qy�Wn��|�|��j���|��_�n��d	�S(
���s��If xcode_settings is None, all methods on this class are no-ops.

    Args:
        gyp_path_to_build_path: A function that takes a gyp-relative path,
            and returns a path relative to the build directory.
        gyp_path_to_build_output: A function that takes a gyp-relative path and
            a language code ('c', 'cc', 'm', or 'mm'), and that returns a path
            to where the output of precompiling that path for that language
            should be placed (without the trailing '.gch').
    t���GCC_PREFIX_HEADERt���GCC_PRECOMPILE_PREFIX_HEADERR$���R}���t���ct���ccR����t���mmN(���R���t���headerR���t���compile_headersR1���t���compiled_headers(���R���R���t���gyp_path_to_build_patht���gyp_path_to_build_outputt���lang(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyR������s����					c���������C���s7���|��j��s�t���|��j�|�}�|�r3�|�d�|�7}�n��|�S(���NR9���(���RV��R ���RW��(���R���RZ��R����t���h(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_CompiledHeader���s
����
c���������C���sH���|��j��r,�|�|��j�k�r,�d�|��j�|�|���S|��j�r@�d�|��j�Sd�Sd�S(���sA���Gets the cflags to include the prefix header for language |lang|.s���-include %sRP���N(���RV��RW��R\��RU��(���R���RZ��R����(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt
���GetInclude���s
����	c���������C���s#���|��j��s�t���|��j�|�|���d�S(���sF���Returns the actual file name of the prefix header for language |lang|.s���.gch(���RV��R ���R\��(���R���RZ��R����(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_Gch��s����c���	������C���s����|��j��s�|��j�r�g��Sg��}�x��t�|�|���D]��\�}�}�t�j�j�|���d�}�i�d�d�6d�d�6d�d�6d�d�6d�d	�6d
�d�6j�|�d���}�|�r.�|�j�|�|�|��j	�|�|���f���q.�q.�W|�S(
���s��Given a list of source files and the corresponding object files, returns
    a list of (source, object, gch) tuples, where |gch| is the build-directory
    relative path to the gch file each object file depends on.  |compilable[i]|
    has to be the source file belonging to |objs[i]|.i���RR��s���.cRS��s���.cpps���.ccs���.cxxR����s���.mRT��s���.mmN(
���RU��RV��t���zipRH���RI���R!��R	���R���R&���R^��(	���R���t���sourcest���objsR����R����t���sourcet���objt���extRZ��(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetObjDependencies��s����
)c���������C���s����|��j��s�|��j�r�g��S|��j�d�|���d�d�|��j��f�|��j�d�|���d�d�|��j��f�|��j�d�|���d�d�|��j��f�|��j�d�|���d�d�|��j��f�g�S(	���s����Returns [(path_to_gch, language_flag, language, header)].
    |path_to_gch| and |header| are relative to the build directory.
    RR��s���-x c-headerRS��s
���-x c++-headerR����s���-x objective-c-headerRT��s���-x objective-c++-header(���RU��RV��R^��(���R���R����(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetPchBuildCommands ��s����N(
���RL��RM��RN��R���R\��R���R]��R^��Re��Rf��(����(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyRO�����s���				c����������C���s:��t��r,�t�t����d�k�s�t���t�t��d� ��Sy:�t�d�d�g���j����}��t�|����d�k��re�t�d���n��WnJ�t����}�|�r��t�j	�d�|���j
����d�}�n	�t�d���|�d�g�}��n�X|��d�}�|��d	�}�|�j����d	�j�d
�d���}�|�d�d�t�|���j
�d
���}�|�r|�j����d	�}�n��t��j�|�|�f���|�|�f�S(���s@���Returns a tuple of version and build version of installed Xcode.i���Rd���s���-versions&���xcodebuild returned unexpected resultss���(\d\.\d\.?\d*)i����s!���No Xcode or CLT version detected!RP���i����R9���t���0i���i���(���t���XCODE_VERSION_CACHER����R ���t���tupleRe���R��R����t
���CLTVersionR���R����t���groupsR���R����t���zfillt���extend(���t���version_listRJ��RK��(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyR?��.��s*����
		

!c����������C���s���d�}��d�}�d�}�t��j�d���}�xW�|�|��|�g�D]F�}�y3�t�d�d�|�g���}�t��j�|�|���j����d�SWq1�q1�q1�Xq1�Wd�S(	���s7���Returns the version of command-line tools from pkgutil.s"���com.apple.pkg.DeveloperToolsCLILeos���com.apple.pkg.DeveloperToolsCLIs!���com.apple.pkg.CLTools_Executabless���version: (?P<version>.+)s���/usr/sbin/pkgutils
���--pkg-infoRJ��N(���R���R���Re���t���searcht	���groupdict(���t���STANDALONE_PKG_IDt���FROM_XCODE_PKG_IDt���MAVERICKS_PKG_IDR����R���R��(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyRj��X��s����	c���������C���sx���t��j�|��d�t��j��}�|�j����d�}�|�j�d�k�rk�t�j�j�|�d���t�d�|�j�|��d�f�����n��|�j	�d���S(���s����Returns the content of standard output returned by invoking |cmdlist|.
  Raises |GypError| if the command return with a non-zero return code.t���stdouti����s���
s���Error %d running %s(
���R��t���Popent���PIPEt���communicatet
���returncodet���syst���stderrt���writeR����t���rstrip(���t���cmdlistt���jobt���out(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyRe���n��s���� c���������C���sg���|��j��d�i����}�xN�|�d�j����D]<�}�d�|�k�r#�|�j����}�|�j�|�d���|�|�d�<q#�q#�Wd�S(���s����Merges the global xcode_settings dictionary into each configuration of the
  target represented by spec. For keys that are both in the global and the local
  xcode_settings dict, the local key gets precendence.
  R���R���N(���R	���t���valuest���copyt���update(���t���global_dictR���t���global_xcode_settingsR���t���new_settings(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���MergeGlobalXcodeSettingsToSpecy��s����c���������C���s[���t��|�j�d�d�����d�k�o'�|��d�k�}�|�rW�|�d�d�k�sW�t�d�|�d�����n��|�S(���s����Returns if |spec| should be treated as a bundle.

  Bundles are directories with a certain subdirectory structure, instead of
  just a single file. Bundle rules do not produce a binary but also package
  resources into that directory.R,���i����t���macR3���t���nones6���mac_bundle targets cannot have type none (target "%s")R=���(���R-���R	���R ���(���t���flavorR���t
���is_mac_bundle(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���IsMacBundle���s����*c���������c���s%��t��j�j�|��|�j������}�x|�D]��}�|�}�d�|�k�sJ�t�d�|�����t��j�j�|���}�t��j�j�|�d���}�|�d�j�d���r��t��j�j�|�|�d���}�n��t��j�j�|�|�d���}�|�j�d���r��t��j�j�|���d�d�}�n��|�j�d���rt��j�j�|���d�d	�}�n��|�|�f�Vq"�Wd
�S(���sv��Yields (output, resource) pairs for every resource in |resources|.
  Only call this for mac bundle targets.

  Args:
      product_dir: Path to the directory containing the output bundle,
          relative to the build directory.
      xcode_settings: The XcodeSettings of the current target.
      resources: A list of bundle resources, relative to the build directory.
  R���s/���Spaces in resource filenames not supported (%s)i����i���s���.lprojs���.xibs���.nibs���.storyboards���.storyboardcN(���RH���RI���R���RL���R ���R���R���R!��(���R����R���t	���resourcest���destt���resR��t	���res_partst���lproj_parts(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetMacBundleResources���s ����


c���������C���s����|�j��d���}�|�s%�d
�d
�g��i��f�Sd�|�k�sA�t�d�|�����|�|���}�|�j��d�d�d��d�k�r��t�j�|�j��d�d�d	����}�n�g��}�t�j�j�|��|�j������}�|�j	����}�|�|�|�|�f�S(���s)��Returns (info_plist, dest_plist, defines, extra_env), where:
  * |info_plist| is the source plist path, relative to the
    build directory,
  * |dest_plist| is the destination plist path, relative to the
    build directory,
  * |defines| is a list of preprocessor defines (empty if the plist
    shouldn't be preprocessed,
  * |extra_env| is a dict of env variables that should be exported when
    invoking |mac_tool copy-info-plist|.

  Only call this for mac bundle targets.

  Args:
      product_dir: Path to the directory containing the output bundle,
          relative to the build directory.
      xcode_settings: The XcodeSettings of the current target.
      gyp_to_build_path: A function that converts paths relative to the
          current gyp file to paths relative to the build direcotry.
  t���INFOPLIST_FILER���s1���Spaces in Info.plist filenames not supported (%s)t���INFOPLIST_PREPROCESSR$���R}���R|���t"���INFOPLIST_PREPROCESSOR_DEFINITIONSRP���N(
���R1���R���R ���t���shlexR���RH���RI���R���RM���R����(���R����R���RX��t
���info_plistt���definest
���dest_plistt	���extra_env(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetMacInfoPlist���s����
c���������C���s��|��s
�i��S|��j��}�i�|�d�6|�d�6|��j����d�6|�d�6d�d�6|�d�6d�d	�6}�|��j�d
�|���rx�|��j�|���|�d
�<n
�d�|�d
�<|�d�d�k�r��|��j����|�d�<|��j����|�d�<|��j����|�d�<|��j����}�|�r��|�|�d�<n��|��j����|�d�<n��|��j	����rC|��j
����|�d�<|��j����|�d�<|��j����|�d�<|��j
����|�d�<n��|��j����}�|�rb|�|�d�<n��|��j����}	�|	�r�|	�|�d�<n��|�s�i��}�n>�x;�|�D]3�}
�t�|�|
�t���s�d�j�|�|
���|�|
�<q�q�W|�j�|���x"�|�D]�}
�t�|�|
���|�|
�<q�W|�S(���s���Return the environment variables that Xcode would set. See
  http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153
  for a full list.

  Args:
      xcode_settings: An XcodeSettings object. If this is None, this function
          returns an empty dict.
      built_products_dir: Absolute path to the built products dir.
      srcroot: Absolute path to the source root.
      configuration: The build configuration name.
      additional_settings: An optional dict with more values to add to the
          result.
  t���BUILT_PRODUCTS_DIRt
���CONFIGURATIONt���PRODUCT_NAMEt���SRCROOTs
���${SRCROOT}t���SOURCE_ROOTt���TARGET_BUILD_DIRs	���${TMPDIR}t���TEMP_DIRRi���RP���R3���R;���RN���R5���R4���t���EXECUTABLE_NAMEt���EXECUTABLE_PATHt���FULL_PRODUCT_NAMER����R����t���CONTENTS_FOLDER_PATHt!���UNLOCALIZED_RESOURCES_FOLDER_PATHt���INFOPLIST_PATHt���WRAPPER_NAMER����R����R���(���s
���executables���static_librarys���shared_librarys���loadable_module(���R���RB���Rj���Rp���RW���R`���RE���RU���RO���R.���RJ���RL���RM���RC���R����R����t
���isinstanceR'���R���R���R����(���R���t���built_products_dirt���srcroott
���configurationt���additional_settingsR���t���envt���mach_o_typeR����t���install_name_baset���k(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_GetXcodeEnv���sV�����	


	


	


c���������C���s~���t��j�d�d�|����}��t��j�d�|����}�xP�|�D]H�}�|�\�}�}�d�|�k�s\�t�d�|�����|��j�|�d�|�d���}��q.�W|��S(���s����Takes a string containing variable references in the form ${FOO}, $(FOO),
  or $FOO, and returns a string with all variable references in the form ${FOO}.
  s���\$([a-zA-Z_][a-zA-Z0-9_]*)s���${\1}s���(\$\(([a-zA-Z0-9\-_]+)\))s���$(s#���$($(FOO)) variables not supported: s���${t���}(���R���t���subt���findallR ���R����(���R'���t���matchesR����t
���to_replacet���variable(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyR����<��s����
c���������C���sk���xd�t��|���D]V�\�}�}�|��j�d�|�d�|���}��|��j�d�|�d�|���}��|��j�d�|�|���}��q
�W|��S(���s��Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the
  expansions list. If the variable expands to something that references
  another variable, this variable is expanded as well if it's in env --
  until no variables present in env are left.s���${R���s���$(t���)R����(���t���reversedR����(���t���stringt
���expansionsR���t���v(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt
���ExpandEnvVarsM��s
����c������������s����t��j�d����������f�d����}�y-�t�j�j����j����|���}�|�j����|�SWn2�t�j�j�k
�r��}�t�d�t	�|�j
�������n�Xd�S(���s��Takes a dict |env| whose values are strings that can refer to other keys,
  for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of
  env such that key2 is after key1 in L if env[key2] refers to env[key1].

  Throws an Exception in case of dependency cycles.
  s���\$\{([a-zA-Z0-9\-_]+)\}c������������si���t��g����j����|����D]�}�|����k�r�|�^�q���}�x*�|�D]"�}�d�|�k�s?�t�d�|�����q?�W|�S(���Ns���${s ���Nested variables not supported: (���R��R���R ���(���t���nodeR���R���t���dependee(���R���R����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetEdgesd��s����8
 s6���Xcode environment variables are cyclically dependent: N(���R���R���t���gypt���commont���TopologicallySortedR����t���reverset
���CycleErrorR����R'���t���nodes(���R���R���t���ordert���e(����(���R���R����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_TopologicallySortedEnvVarKeysY��s����

c���������C���s?���t��|��|�|�|�|���}�g��t�|���D]�}�|�|�|�f�^�q%�S(���N(���R���R���(���R���R���R���R���R���R���R���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetSortedXcodeEnv{��s����	c���������C���sl���g��}�x_�|��j��d�g����D]K�}�|�sG�|�j�d�|��d�|�d�f���n��|�j�t�j�j�|�d�����q�W|�S(���s_���Returns the list of postbuilds explicitly defined on |spec|, in a form
  executable by a shell.R��s���echo POSTBUILD\(%s\) %sR=���t���postbuild_namet���action(���R	���R&���R���R���t���EncodePOSIXShellList(���R���R��R��t	���postbuild(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���GetSpecPostbuildCommands���s����	!c���������C���sU���xN�|��j�����D]@�}�x7�|�d�j�����D]%�}�|�j�d�i����j�d���r$�t�Sq$�Wq
�Wt�S(���sV���Returns true if any target contains the iOS specific key
  IPHONEOS_DEPLOYMENT_TARGET.R���R���R���(���R���R	���R���R���(���t���targetst���target_dictR���(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt
���_HasIOSTarget���s
����c���������C���s���d�|��j�����k�S(���s4���Tests if |sdkroot| is a SDK for building for device.R���(���Rx���(���t���sdkroot(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_IOSIsDeviceSDKROOT���s����c���������C���s����t�����\�}�}�|�d�k��rF�t�|����r5�i�d�g�d�6Si�d�g�d�6SnH�t�|����rs�i�d�d�g�d�6d�d�d�g�d�6Si�d�g�d�6d�d�g�d�6Sd	�S(
���s����Returns the expansion of standard ARCHS macro depending on the version
  of Xcode installed and configured, and which |sdkroot| to use (iphoneos or
  simulator).RE��t���armv7s���$(ARCHS_STANDARD)R����t���armv7st���arm64s"���$(ARCHS_STANDARD_INCLUDING_64_BIT)R����N(���R?��R���(���R���RF��RB��(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_IOSDefaultArchForSDKRoot���s����

c���������C���s����t��|��j�d�d�����}�t����}�x!�|�j����D]�}�|�j�|���q.�Wt����}�x_�|��j�d�g����pi�d�g�D]B�}�|�|�k�r��|�j�|�|���qj�|�|�k�rj�|�j�|���qj�qj�Wt�|��j�d�g������}�|�r��|�|�@}�n��t�|���|��d�<d�S(���s����Filter the ARCHS value from the |xcode_settings| dictionary to only
  contains architectures valid for the sdk configured in SDKROOT value.Ri���RP���Ra���s���$(ARCHS_STANDARD)t���VALID_ARCHSN(���R���R	���R��t
���itervaluesR���t���addt���list(���R���t���defaults_archst
���allowed_archsR����t���selected_archsR����t���valid_archs(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt ���_FilterIOSArchitectureForSDKROOT���s����		"
c���������C���s����x��|��j�����D]��}�|�d�}�|�d�}�xv�t�|���j����D]b�\�}�}�t�j�|���}�|�|�|�d�<|�d�k�r��d�|�d�d�<n��t�|�d���t�|�d���q:�Wq
�W|��S(���s����Clone all targets and append -iphoneos to the name. Configure these targets
  to build for iOS devices and use correct architectures for those builds.t���toolsetR���s	���-iphoneosR]���R���R���Ri���(���R���R����R���R���t���deepcopyR���(���R���R���R���R���R#��t���config_dictt���iphoneos_config_dict(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���_AddIOSDeviceConfigurations���s����

c���������C���s���t��|����r�t�|����S|��S(���sk���If |target_dicts| contains any iOS targets, automatically create -iphoneos
  targets for iOS device builds.(���R���R���(���t���target_dicts(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt&���CloneConfigurationForDeviceAndEmulator���s����
(%���RN��R���t
���gyp.commonR���RH���t���os.pathR���R���R��Ry��t���tempfileR����Rh��t���objectR���RO��R?��Rj��Re���R���R���R���R���R���R���R����R���R���R���R���R���R���R���R���R���R���R���(����(����(����s*���externals/gyp/pylib/gyp/xcode_emulation.pyt���<module>���sF����������j	*					(	0M			#