Rac@sdZddlmZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddlm Z eekZeaeaedZdefdYZdZd efd YZd efd YZd ZdZdZdZdZdZdZ dZ!edZ"dZ#dZ$dZ%edZ&e'dZ(dZ)dZ*dZ+dS(s~ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. i(tprint_functionN(tGypErrorcCs$i|d6}|r ||dd7Z?d8Z@ge=d9ZAd@d:ZBd@d;ZCd<ZDd=ZEd@d>ZFd?ZGRS(As9A class that understands the gyp 'xcode_settings' object.cCs||_t|_i|_|d}xe|jD]W\}}|jdi|j|<|j||j|jddr2t|_q2q2Wd|_ t j d|_ dS(Ntconfigurationstxcode_settingstIPHONEOS_DEPLOYMENT_TARGETs^lib([^/]+)\.(a|dylib)$( tspectFalsetisIOSR7titemstgett_ConvertConditionalKeystNonetTruet confignameR'R(t library_re(R R9tconfigsRAtconfig((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRs       cCs|j|}g|D]}|jdr|^q}xp|D]h}|jdr|jdr|jdd}||||s ( cCs|j|jS(N(R7RA(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt _SettingsscCs|jj|||kS(N(ROR=(R ttest_keytcond_keyR ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_TestscCsZ||jkr6|j|t|j|n |rV|j|t|ndS(N(RORtstr(R tlstRPt format_strR ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_Appendfs$cCs'||jkr#td|ndS(Ns/Warning: Ignoring not yet implemented key "%s".(ROR(R RP((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_WarnUnimplementedscCs8|jrdnd}|j|jd|}|dkS(NtbinarytxmltINFOPLIST_OUTPUT_FORMAT(R;R7R=(R RAR tformat((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytIsBinaryOutputFormats cCst|jjdddkS(Nt mac_bundlei(tintR9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt _IsBundlescCst|jjdddkS(Ntios_app_extensioni(R^R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_IsIosAppExtensionscCst|jjdddkS(Ntios_watchkit_extensioni(R^R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_IsIosWatchKitExtensionscCst|jjdddkS(Nt ios_watch_appi(R^R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_IsIosWatchAppscCst|jjdddkS(Ntmac_xctest_bundlei(R^R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt _IsXCTestscCs|jdddS(sPReturns the framework version of the current target. Only valid for bundles.tFRAMEWORK_VERSIONR tA(tGetPerTargetSetting(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetFrameworkVersionscCs|jddkr^idd6dd6|jd}|jdd|}d|jjd |S|jdd kr|js|jrd|jjd d Sd|jjd d Snd S(s[Returns the bundle extension (.app, .framework, .plugin, etc). Only valid for bundles.ttypetloadable_moduletshared_librarytbundlet frameworktWRAPPER_EXTENSIONR t.tproduct_extensiont executabletappextappN(RmRn(R9RjR=RaRc(R tdefault_wrapper_extensiontwrapper_extension((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetWrapperExtensionscCs|jjd|jdS(sReturns PRODUCT_NAME.t product_namet target_name(R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetProductNamescCs$|jr|jS|jSdS(sReturns FULL_PRODUCT_NAME.N(R_tGetWrapperNamet_GetStandaloneBinaryPath(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetFullProductNames  cCs|j|jS(s`Returns the directory name of the bundle represented by this target. Only valid for bundles.(R|Ry(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyR}scCse|jr|jS|jddkrHtjj|jd|jStjj|jdSdS(sReturns the qualified path to the bundle's contents folder. E.g. Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.RlRntVersionstContentsN(R;R}R9tostpathRJRk(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetBundleContentsFolderPaths    cCs,|jr|jStjj|jdS(s}Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles.t Resources(R;RRRRJ(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetBundleResourceFolder,s  cCsL|jddkr,tjj|jdStjj|jddSdS(syReturns the qualified path to the bundle's plist file. E.g. Chromium.app/Contents/Info.plist. Only valid for bundles.RlRtRms Info.plistRN(RtRm(R9RRRJR(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetBundlePlistPath4scCs|jrdS|jr dS|jr0dS|jr`idd6dd6dd 6|jd Sid d6d d6d d 6d d6|jd SdS(s(Returns the PRODUCT_TYPE of this target.s$com.apple.product-type.app-extensions)com.apple.product-type.watchkit-extensions+com.apple.product-type.application.watchapps"com.apple.product-type.applicationRtscom.apple.product-type.bundleRms com.apple.product-type.frameworkRnRlscom.apple.product-type.tools&com.apple.product-type.library.dynamics%com.apple.product-type.library.statictstatic_libraryN(RaRcReR_R9(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetProductType>s$     cCsO|j r$|jddkr$dSidd6dd6dd6d d 6|jdS( s'Returns the MACH_O_TYPE of this target.RlRtR t mh_executet staticlibRtmh_dylibRnt mh_bundleRm(R_R9(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetMachOTypeZs cCsu|jddks|jr+|j}n1|jddkr\tjj|jd}ntjj||jS(sReturns the name of the bundle binary of by this target. E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.RlRnRtRmtMacOS(RtRm(R9R;RRRRJtGetExecutableName(R R((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetBundleBinaryPathfs cCsId|jkrd|jdSidd6dd6dd6d d 6|jd S( NRsRrR Rts.aRs.dylibRns.soRmRl(R9(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetStandaloneExecutableSuffixpscCs:|jjdidd6dd6dd6dd6|jdS( Ntproduct_prefixR RttlibRRnRmRl(R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetStandaloneExecutablePrefixzs cCs|jd}|jddkr@|d dkrs|d}qsn3|jdd krs|d dkrs|d}qsn|j}|jjd|}|j}|||S( swReturns the name of the non-bundle binary represented by this target. E.g. hello_world. Only valid for non-bundles.R{RlRiRRmRnRz(RmRn(R9RR=R(R ttargett target_prefixt target_ext((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyR~s   cCs4|jr&|jjd|jdS|jSdS(sXReturns the executable name of the bundle represented by this target. E.g. Chromium.RzR{N(R_R9R=R~(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRs cCs$|jr|jS|jSdS(ssReturns the directory name of the bundle represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.N(R_RR~(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetExecutablePaths  cCsD|j|}t}|j|jd|jd|jdS(s:Returns the architectures this target should be built for.tARCHSt VALID_ARCHStSDKROOT(R7R4R#R=(R RAtconfig_settingstxcode_archs_default((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetActiveArchss     cCs+ytddd||gSWnnXdS(Nt xcodebuilds-versions-sdk(tGetStdoutQuiet(R tsdktinfoitem((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetSdkVersionInfoItemscCs.|dkr|j}n|jd|ddS(NRR R (R?RAtGetPerConfigSetting(R RA((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_SdkRoots  cCs/|j|}|jdr"|S|j|S(Nt/(Rt startswitht _XcodeSdkPath(R RAtsdk_root((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_SdkPathscCsR|tjkrG|j|d}|tj|<|rG|tj|g} x+| D]#} |jd:| jd?|qWd@|_|S(BsMReturns flags that need to be added to .c, .cc, .m, and .mm compilations.Rs -isysroot %stCLANG_WARN_CONSTANT_CONVERSIONtYESR tNOs-Wconstant-conversiontGCC_CHAR_IS_UNSIGNED_CHARs-funsigned-chartGCC_CW_ASM_SYNTAXs -fasm-blockstGCC_DYNAMIC_NO_PICs-mdynamic-no-pictGCC_ENABLE_PASCAL_STRINGSs-mpascal-stringstGCC_OPTIMIZATION_LEVELs-O%ststGCC_GENERATE_DEBUGGING_SYMBOLStDEBUG_INFORMATION_FORMATtdwarfs -gdwarf-2tstabss(stabs debug format is not supported yet.sdwarf-with-dsymsUnknown debug format %stGCC_STRICT_ALIASINGs-fstrict-aliasings-fno-strict-aliasingtGCC_SYMBOLS_PRIVATE_EXTERNs-fvisibility=hiddentGCC_TREAT_WARNINGS_AS_ERRORSs-WerrortGCC_WARN_ABOUT_MISSING_NEWLINEs -Wnewline-eoftLLVM_LTOs-fltotCOPY_PHASE_STRIPtGCC_DEBUGGING_SYMBOLStGCC_ENABLE_OBJC_EXCEPTIONSt MACH_O_TYPEt PRODUCT_TYPEiRR*s-arch iR-tGCC_ENABLE_SSE3_EXTENSIONSs-msse3t)GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONSs-mssse3tGCC_ENABLE_SSE41_EXTENSIONSs-msse4.1tGCC_ENABLE_SSE42_EXTENSIONSs-msse4.2tWARNING_CFLAGSs-Fs/Developer/Library/Frameworks/R R6tmac_framework_dirss $(SDKROOT)N(R*R-(RARRORRRRVR=tNotImplementedErrorRRWR?RtlenRgt_XcodePlatformPathR9treplace( R RARtcflagsRt dbg_formatRt platform_roottframework_rootRDtframework_dirst directory((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetCflagss                  ! cCsy||_g}|jjdddkr=|jdn|j|dd||jjdg7}d|_|S(s?Returns flags that need to be added to .c, and .m compilations.tGCC_C_LANGUAGE_STANDARDR tansis-ansis-std=%st OTHER_CFLAGSN(RAROR=RRVR?(R RAtcflags_c((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetCflagsCSs  cCs||_g}|jjd}|r>|jd|n|j|dd|jddddry|jd n|jd dddr|jd n|jd dddr|jd n|jddddr|jdn|jddddr|jdng}xp|jjddgD]S}|dkrVd}n|dkr||jjdg7}q;|j|q;W||7}d|_|S(sAReturns flags that need to be added to .cc, and .mm compilations.tCLANG_CXX_LANGUAGE_STANDARDs-std=%stCLANG_CXX_LIBRARYs -stdlib=%stGCC_ENABLE_CPP_RTTIRR Rs -fno-rttitGCC_ENABLE_CPP_EXCEPTIONSs-fno-exceptionstGCC_INLINES_ARE_PRIVATE_EXTERNs-fvisibility-inlines-hiddentGCC_THREADSAFE_STATICSs-fno-threadsafe-staticst%GCC_WARN_ABOUT_INVALID_OFFSETOF_MACROs-Wno-invalid-offsetoftOTHER_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(RAROR=RRVRRR?(R RAt cflags_cctclang_cxx_language_standardt other_ccflagstflag((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetCflagsCC_s6   "     cCsT|jjdd}|dkr4|jdn|dkrP|jdndS(NtGCC_ENABLE_OBJC_GCt unsupportedt supporteds -fobjc-gctrequireds-fobjc-gc-only(ROR=R(R tflagst gc_policy((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt$_AddObjectiveCGarbageCollectionFlagss   cCs,|jddddr(|jdndS(NtCLANG_ENABLE_OBJC_ARCRR Rs -fobjc-arc(RRR(R R((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_AddObjectiveCARCFlagsscCs,|jddddr(|jdndS(Nt*CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESISRR Rs!-Wobjc-missing-property-synthesis(RRR(R R((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt+_AddObjectiveCMissingPropertySynthesisFlagss cCsC||_g}|j||j||j|d|_|S(s7Returns flags that need to be added to .m compilations.N(RARRRR?(R RAt cflags_objc((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetCflagsObjCs     cCsk||_g}|j||j||j||jddddr^|jdnd|_|S(s8Returns flags that need to be added to .mm compilations.tGCC_OBJC_CALL_CXX_CDTORSRR Rs-fobjc-call-cxx-cdtorsN(RARRRRRRR?(R RAt cflags_objcc((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetCflagsObjCCs     cCsa|jddkr6|jddks2|jr6dS|jdd|jrTdnd}|S( s/Return DYLIB_INSTALL_NAME_BASE for this target.RlRnRmtDYLIB_INSTALL_NAME_BASER s/Library/Frameworkss/usr/local/libN(R9R_R?Rj(R t install_base((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetInstallNameBasescCsqd|krmd|}}|jdrC|jdd\}}ntjj|}tjj||}n|S(s(Do :standardizepath processing for path.RR t@i(RRIRRtnormpathRJ(R Rtprefixtrest((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_StandardizePaths  cCs|jddkr6|jddks2|jr6d Sd}|jdd|}d|kr|jd|j|j}|jr|jd |j}|jd |j}n|jd |j }n|S( s-Return LD_DYLIB_INSTALL_NAME for this target.RlRnRms=$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)tLD_DYLIB_INSTALL_NAMER t$s*$(DYLIB_INSTALL_NAME_BASE:standardizepath)s$(WRAPPER_NAME)s$(PRODUCT_NAME)s$(EXECUTABLE_PATH)N( R9R_R?RjRRRR}R|R(R tdefault_install_namet install_name((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetInstallNames$  c Csd}d}d|gd|gd|gd|||gg}xy|D]q}tjddj|}|j|}|rC||jd  ||jd ||jd }qCqCW|jd rd ||td }n|S( suChecks 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[ ,]is-L( R'R(RJRtstarttgrouptendRR( R tldflagtgyp_to_build_patht LINKER_FILEtWORDt linker_flagst flag_patterntregextm((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_MapLinkerFlagFilenames    #cCs||_g}x9|jjdgD]}|j|j||q(W|jddddrs|jdn|jddddr|jdn|j|d d |j|d d |j|d |jkr|jr|jd|jnx7|jjdgD]}|jd||qWd|jkrv|jd-||jdn|d.k r|g}n|j |j}t |dkr|j ddg}n|jd|d|jd||j } | r6|jddkr6|jd| jddnx1|jjdgD]} |jd| qOW|j} | sd } n|jd!|j} | jd"g} x+| D]#}|jd#|jd$| qW|jr|j|}|r|jd#|d%qn|jp*|j}| r|r|jd&td'kri|j| d(n|jd)|jd*n|j|d+d,d.|_|S(/sReturns 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 directory. t OTHER_LDFLAGStDEAD_CODE_STRIPPINGRR Rs-Wl,-dead_stript PREBINDINGs -Wl,-prebindtDYLIB_COMPATIBILITY_VERSIONs-compatibility_version %stDYLIB_CURRENT_VERSIONs-current_version %sRs -isysroot tLIBRARY_SEARCH_PATHSs-Lt ORDER_FILEs-Wl,-order_file s-Wl,iRR*s-arch iRlRms-install_name RGs\ tLD_RUNPATH_SEARCH_PATHSs -Wl,-rpath,R R6Rs-Fs $(SDKROOT)s/Developer/Library/Frameworks/s -lpkstartt0900s?/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKits-fapplication-extensions:-Xlinker -rpath -Xlinker @executable_path/../../FrameworksRs -stdlib=%ss-Wl,-order_file -Wl,N(RAROR=RRRRRVRRR?RRRWR R9RRgRRaRcR1(R RAt product_dirRRtldflagsRt library_pathRR trpathRRDRRRt is_extension((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetLdflagssp             !       cCsL||_g}x-|jjdgD]}|j|q(Wd|_|S(sReturns flags that need to be passed to the static linker. Args: configname: The name of the configuration to get ld flags for. RN(RAROR=RR?(R RAt libtoolflagst libtoolflag((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetLibtoolflagsfs   cCst}i}xt|jjD]x}|rJt|j|}t}q"xM|j|jD]8\}}||kr|q^q^|||kr^||=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@tsortedR7tkeystdictR:R<(R t first_passtresultRARLtvalue((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetPerTargetSettingsvs   cCs:||jkr&|j|j||S|j||SdS(N(R7R=Rj(R tsettingRAR ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRscCsht}d}xEt|jjD].}|r"|j|j|d}t}q"q"W|dkrd|S|S(sTries to get xcode_settings.setting from spec. Assumes that the setting has the same value in all configurations and throws otherwise.N(R@R?R)R7R*R=R:(R R0R t is_first_passR-RA((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRjs  c Cs=||_g}|jddddr0|jddddr0d}|jddkrm|jrmd }n|jdd krd }n|jjd |}id d 6dd 6dd6|}|jjdd }|r|dt|7}n|s|jd|jdn|jd||fnd|_|S(sReturns a list of shell commands that contain the shell commands necessary to strip this target's binary. These should be run as postbuilds before the actual postbuilds run.tDEPLOYMENT_POSTPROCESSINGRR RtSTRIP_INSTALLED_PRODUCTt debuggingRlRms non-globalRttallt STRIP_STYLER s-xs-St STRIPFLAGSRGsecho STRIP\(%s\)R{s strip %s %sN( RARRR9R_ROR=t_NormalizeEnvVarReferencesRR?( R RAt output_binarytquietR-tdefault_strip_stylet strip_stylet strip_flagstexplicit_strip_flags((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetStripPostbuildss.    cCs||_g}|jddddr|jddddr|jddkr|ss|jd |jd n|jd ||d fnd |_|S(sReturns a list of shell commands that contain the shell commands necessary to massage this target's debug information. These should be run as postbuilds before the actual postbuilds run.RRR Rsdwarf-with-dsymRRlRsecho DSYMUTIL\(%s\)R{sdsymutil %s -o %ss.dSYMN(RARRR9RR?(R RAtoutputR9R:R-((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetDebugInfoPostbuildss  cCs)|j|||||j|||S(sReturns a list of shell commands that contain the shell commands to run as postbuilds for this target, before the actual postbuilds.(RAR?(R RAR@R9R:((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetTargetPostbuildsscCs|jo|jddks gS|j|}|j|}|sFgSdg}t|t|j|j@}|rtddjt|ndt j jdd||j d d |j d d |j d d fgS( sReturn 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.RlRttOTHER_CODE_SIGN_FLAGSs9Warning: Some codesign keys not implemented, ignoring: %ss, s'%s code-sign-bundle "%s" "%s" "%s" "%s"s${TARGET_BUILD_DIR}s gyp-mac-tooltCODE_SIGN_RESOURCE_RULES_PATHR tCODE_SIGN_ENTITLEMENTStPROVISIONING_PROFILE( R;R9R7t_GetIOSCodeSignIdentityKeytsetR*RRJR)RRR=(R RAR9RKRLtunimpl((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetIOSPostbuildss   #cCs|jd}|sdS|tjkrtjdddddg}xL|jD];}||krS|jd}tj}|tj|RORRR?RVRWR\R_RaRcReRgRkRyR|RR}RRRRRRRRR~RRRRRRRRRRRRRRRRRRR RR%R(R/RRjR?RAR:RBRJRGRYRaRcRfRlRR|(((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyR5s                          y )    &  _     "         %tMacPrefixHeadercBsMeZdZdZdZddZdZddZddZ RS(sA 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. cCsd |_t|_|rK|jd|_|jddddk|_ni|_|jr|jrx6ddddgD]}||j||j|04s( tXCODE_VERSION_CACHERRQRRt CLTVersionRJRIR[(t version_listtversiontbuild((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyR1s(     0  cCsd}d}d}tjd}xW|||gD]F}y3tdd|g}tj||jdSWq1q1q1Xq1WdS( s7Returns the version of command-line tools from pkgutil.s"com.apple.pkg.DeveloperToolsCLILeoscom.apple.pkg.DeveloperToolsCLIs!com.apple.pkg.CLTools_Executablessversion: (?P.+)s/usr/sbin/pkgutils --pkg-infoRN(R'R(Retsearcht groupdict(tSTANDALONE_PKG_IDtFROM_XCODE_PKG_IDtMAVERICKS_PKG_IDRRLR@((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRs cCstj|dtjdtj}|jd}trI|jd}n|jdkrxtd|j|dfn|jdS(sReturns the content of standard output returned by invoking |cmdlist|. Ignores the stderr. Raises |GypError| if the command return with a non-zero return code.tstdouttstderrisutf-8sError %d running %ss ( ROtPopentPIPEt communicatetPY3tdecodet returncodeRtrstrip(tcmdlisttjobtout((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyR)s! cCstj|dtj}|jd}tr@|jd}n|jdkrtjj |dt d|j|dfn|j dS(sReturns the content of standard output returned by invoking |cmdlist|. Raises |GypError| if the command return with a non-zero return code.Risutf-8s sError %d running %s( RORRRRRRtsysRtwriteRR(RRR((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRe6s cCsg|jdi}xN|djD]<}d|kr#|j}|j|d||dx;|D]3} t|| tsdj|| || sN           8 1j *    ( 0 U  #