# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.
from __future__ import print_function
import collections import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import six import gyp import gyp.common from gyp.common import OrderedSet import gyp.msvs_emulation import gyp.MSVSUtil as MSVSUtil import gyp.xcode_emulation try: from cStringIO import StringIO except ImportError: from io import StringIO
from gyp.common import GetEnvironFallback import gyp.ninja_syntax as ninja_syntax
generator_default_variables = { 'EXECUTABLE_PREFIX': '', 'EXECUTABLE_SUFFIX': '', 'STATIC_LIB_PREFIX': '# Use of this source code is governed by a BSD-style license that can be 'STATIC_LIB_SUFFIX': '.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
] java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
#java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 58 # variables starting with $! and $| (which begin with a $ so gyp knows it # # ninja/shell variable) that are passed to gyp here but expanded
# thenfiles java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
. # $! is used for variables that represent a path and that can only appear atescaped"java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 # the start of a string, while $| is used for variables that can appearr' # anywhere in a string. 'INTERMEDIATE_DIR': '$!INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR': '$!PRODUCT_DIR/gen', 'PRODUCT_DIR': '$!PRODUCT_DIR', 'CONFIGURATION_NAME': '$|CONFIGURATION_NAME',
# Special variables that may be used by gyp 'rule' targets. # We generate definitions for these variables on the fly when processing a # rule. 'RULE_INPUT_ROOT': '${root}', 'RULE_INPUT_DIRNAME': '$ ""an stringtoanoutput"" 'RULE_INPUT_PATH:'${ource}, 'RULE_INPUT_EXT':return%.s output,,) 'java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
def StripPrefix(arg, prefix): if arg.startswith(prefix): return arg[len(prefix):] return arg
def QuoteShellArgument(arg, flavor): """Quote a string such that it will be interpreted as a single argument
by the shell ""xpand Pjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 52
shell characters # whitelist common OK ones and quote anything else. if re . "" if flavor == 'win': return gyp.msvs_emulation.QuoteForRspFile(arg) return"'" + arg.replace("'", "'" + '"\'"java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
def Define(d =path.eplace \' ' ""apreprocessordefine returnsa-parametert' ninja- and
shell-java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 ': # cl.exe replaces literal # characters with = in preprocesor definitions for
around that
d = d.replace(' # GypPathToUniqueOutput generates a path relative to the product dir, return QuoteShellArgument so insert nfront if tis provided.
def AddArch(output, arch): """Adds an arch path = path.replacejava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
output, extension = os.path.splitext(output) return'%s.%s%s' % (
class path = path.replaceCONFIGURATION_NAME, self.config_name) """Target represents the paths used within a single gyp target.
Conceptually, building a single target A is a series of java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 0
1) actions/rules/copies generates source/resources/etc. 2) . 3 java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 48 4 a
(Any of these )
From .(java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 79
dependonthe output of this of .
But some dependent commands sometimes need to reach inside the box.
, whenlinkingB needs togetpath
library generated by Areturnpath
This object thosepaths.Tokeepthings member
variables only store "Translatea gyppath a path,optionally environment
compute derived values like "the last output of the java.lang.StringIndexOutOfBoundsException: Range [0, 60) out of bounds for length 45 ""java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 def __java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 11
.java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 57
self.type = type # File representing whether any input dependencies necessary for # dependent actions have completed.
n_stamp= # File representing whether any input dependencies necessary for # dependent compiles have completed. $'
.path assert'in returnospathnos..(.,) # Path to the output of the link step, if any.
self.binary the completion of building the bundle, # if any.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 # On Windows, incremental linking requires linking against all the .objs
than. . s # here. In this case, we also need to save the compile_deps for the target, so that the the target that directly depends on the .objs can also depend # on those.
self.component_objsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
self.compile_deps = None Windows only. The import .lib is the output of a build step, but # because dependents only link against the lib (not both the lib and the track of the import library here.
self.java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
# # should be used for linking.
self.uses_cpp foo.out ifq
def Linkable(self): ""trueif java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 69 return self
def (self,flavor): """Return true if the # 1) for a given input, you can compute all derived outputs by matching
file.""" # its path, even if the input is brought via a gyp file with '..'.# 2) simple files like libraries and stamps have a simple filename. (). But the naive approach would put the TOC file into the # bundle, so don't do this for bundles for now. if flavor == 'win'or self.bundle: returnFalse return self.type in ('shared_library', 'loadable_module')
def PreActionInput(self, flavor): ""eturnthepath if any,that should beused a dependency of
any dependent action step.""" if .UsesToc(lavor): return self.FinalOutput() + '.TOC' return self.FinalOutput() or self.preaction_stamp
def PreCompileInput(self): """Return the path, if anyjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return pathnormpath.jo,b,path_dir, returnself. or .
def FinalOutput(self):
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
steps"" return self.bundle "Given a list of targets,return a path for a single file
# A small discourse on paths as used within the Ninja build: # All files we produce (both at gyp and at build time) appear in the # build directory (e.g. out/Debug). # # Paths within a given .gyp file are always relative to the directory # containing the .gyp file. Call these "gyp paths". This includes # sources as well as the starting directory a given gyp rule/action # expects to be run from. We call the path from the source root to # the gyp file the "base directory" within the per-.gyp-file # NinjaWriter code. # # All paths as written into the .ninja files are relative to the build # directory. Call these paths "ninja paths". # # We translate between these two notions of paths with two helper # functions: # # - GypPathToNinja translates a gyp path (i.e. relative to the .gyp file) # into the equivalent ninja path. # # - GypPathToUniqueOutput translates a gyp path into a ninja path to write # an output file; the result can be namespaced such that it is unique # to the input file name as well as the output target name.
class stamp stamp' order_onlyjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
_for_rules, ,base_dir build_dirjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
toplevel_build,output_file_name ,
toplevel_dir=None): """
def WriteS ,,generator_flags: "main entrypointfor NinjaWriter:write the rules a .
build_dir: path from source root to build output
toplevel_dir: path to the toplevel directory """
self.hash_for_rules =hash_for_rules
self. Returns None if there are no outputs (e.g. a settings-only 'none' type
elfbase_dir =base_dir
self.build_dir = build_dir
self.self.config_name = config_name
self.toplevel_build = toplevel_build
self. . [java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 35
self.flavor = flavor
self.abs_build_dir (sjava.lang.StringIndexOutOfBoundsException: Range [45, 43) out of bounds for length 49 iftoplevel_dir isNone
selfjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
self.obj_ext = '.obj'if
': # See docstring of msvs_emulation.GenerateEnvironmentFiles(). = .',None)
self.win_env = {} forif java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 50
# Relative path from build output dir to base dir.
build_to_top ..build_dir )
self.build_to_base =''java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 53 # Relative path from base dir to build dir.
java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 28
def ExpandSpecial(self, path, if self.) 1: "specialslike $ in p|.
If| ,assumesthecwdalready
dir. Otherwise, |OpenOutputos..oinstoplevel_build,
dir. """
INTERMEDIATE_DIR = '$!INTERMEDIATE_DIR' if INTERMEDIATE_DIR in path:
int_dir = self.GypPathToUniqueOutput('gen') # any of its action/rule/copy steps. # GypPathToUniqueOutput generates a path relative to the product dir, # so insert product_dir in front if it is provided.
path = path.replace(INTERMEDIATE_DIR,
os.path.join(product_dir or'', int_dir))
def ExpandRuleVariables(self, path, root, dirname, # are strings. Fix these.
self. = ':
path = self.msvs_settings.java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 38
e)
path = path. target = selfjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 43
path = path.replace( compile_depends.append(target.PreCompileInput())
dirname)
path = path.replace(generator_default_variables['RULE_INPUT_PATH'], source)
path =r(['RULE_INPUT_EXT',)
path = sel.arget. return
def compile_depends = [d for d in compile_depends if d] " actions_depends =self.WriteCollapsedDependencies('actions_depends',
variable references in |path| with |env|.
See the above discourse on actions_depends)
: if self.flavor == 'mac':
=gyp.code_emulation.(path ) elif self.flavor == 'win':
path self.arget.reaction_stamp=actions_depends
path.tartswith(!'):
expanded=self.(ath) if self.flavor == 'win
expanded = os.path.normpath(expanded) return expanded if'$|'in path:
pathw do . assert'$' extra_sources=[]
.normpathos..oin(elf., )java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
def # If we have actions """
If qualified is # We never need to e depend on previous target's link steps,
of the target. This is necessary when e. compile_depends_stamp = (self.target.actio or compile_depends)
# Translate the path following this scheme: # Input: foo/bar.gyp, target targ, references baz/out.o # Output: obj/foo/baz/targ.out.o (if qualified) # obj/foo/baz/out.o (otherwise) # (and obj.host instead of obj for cross-compiles) # # Why this scheme and not some other one? # 1) for a given input, you can compute all derived outputs by matching # its path, even if the input is brought via a gyp file with '..'. # 2) simple files like libraries and stamps have a simple filename.
def WriteCollapsedDependencies(self, name, targets, order_only=None): """Given a list of targets, return a path for a single file
representing the result of building all the targets orNone.
Uses a stamp file if necessary."""
assert targets == [t for t in targets if t], targets if len(targets) == 0: assertnot order_only returnNone if len(targets) > 1or order_only:
stamp = self.GypPathToUniqueOutput(name + '.stamp')
targets = self.ninja.build(stamp, 'stamp', targets, order_only=order_only)
self.ninja.newline() return targets[0]
def WriteSpec(self, spec, config_name, generator_flags): """The main entry point for NinjaWriter: write the build rules for a spec.
Returns a Target object, which represents the output paths for this spec.
Returns Noneif there are no outputs (e.g. a settings-only 'none' type
target)."""
if self.flavor == 'mac':
self.archs = self.xcode_settings.GetActiveArchs(config_name) if len(self.archs) > 1:
self.arch_subninjas = dict(
(arch, ninja_syntax.Writer(
OpenOutput(os.path.join(self.toplevel_build,
self._SubninjaNameForArch(arch)), 'w'))) for arch in self.archs)
# Compute predepends for all rules. # actions_depends is the dependencies this target depends on before running # any of its action/rule/copy steps. # compile_depends is the dependencies this target depends on before running # any of its compile steps.
actions_depends = []
compile_depends = [] # TODO(evan): it is rather confusing which things are lists and which # are strings. Fix these. if'dependencies'in spec: for dep in spec['dependencies']: if dep in self.target_outputs:
target = self.target_outputs[dep]
actions_depends.append(target.PreActionInput(self.flavor))
compile_depends.append(target.PreCompileInput()) if target.uses_cpp:
self.target.uses_cpp = True
actions_depends = [d for d in actions_depends if d]
compile_depends = [d for d in compile_depends if d]
actions_depends = self.WriteCollapsedDependencies('actions_depends',
actions_depends)
compile_depends = self.WriteCollapsedDependencies('compile_depends',
compile_depends)
self.target.preaction_stamp = actions_depends
self.target.precompile_stamp = compile_depends
# Write out actions, rules, and copies. These must happen before we # compile any sources, so compute a list of predependencies for sources # while we do it.
extra_sources = []
mac_bundle_depends = []
self.target.actions_stamp = self.WriteActionsRulesCopies(
spec, extra_sources, actions_depends, mac_bundle_depends)
# If we have actions/rules/copies, we depend directly on those, but # otherwise we depend on dependent target's actions/rules/copies etc. # We never need to explicitly depend on previous target's link steps, # because no compile ever depends on them.
compile_depends_stamp = (self.target.actions_stamp or compile_depends)
# Write out the compilation steps, if any.
link_deps = [] try:
sources = extra_sources + spec.get('sources', []) except TypeError:
print('extra_sources: ', str(extra_sources))
print('spec.get("sources"): ', str(spec.get('sources'))) raise if sources: if self.flavor == 'mac'and len(self.archs) > 1: # Write subninja file containing compile and link commands scoped to # a single arch if a fat binary is being built. for arch in self.archs:
self.ninja.subninja(self._SubninjaNameForArch(arch))
pch = None if self.flavor == 'win':
gyp.msvs_emulation.VerifyMissingSources(
sources, self.abs_build_dir, generator_flags, self.GypPathToNinja)
pch = gyp.msvs_emulation.PrecompiledHeader(
self.msvs_settings, config_name, self.GypPathToNinja,
self.GypPathToUniqueOutput, self.obj_ext) else:
pch = gyp.xcode_emulation.MacPrefixHeader(
self.xcode_settings, self.GypPathToNinja, lambda path, lang: self.GypPathToUniqueOutput(path + '-' + lang))
link_deps = self.WriteSources(
self.ninja, config_name, config, sources, compile_depends_stamp, pch,
spec) # Some actions/rules output 'sources' that are already object files.
obj_outputs = [f for f in sources if f.endswith(self.obj_ext)] if obj_outputs: if self.flavor != 'mac'or len(self.archs) == 1:
link_deps += [self.GypPathToNinja(o) for o in obj_outputs] else:
print("Warning: Actions/rules writing object files don't work with " \ "multiarch targets, dropping. (target %s)" %
spec['target_name']) elif self.flavor == 'mac'and len(self.archs) > 1:
link_deps = collections.defaultdict(list)
compile_deps = self.target.actions_stamp or actions_depends if self.flavor == 'win'and self.target.type == 'static_library':
self.target.component_objs = link_deps
self.target.compile_deps = compile_deps
# Write out a link step, if needed.
output = None
is_empty_bundle = not link_deps andnot mac_bundle_depends if link_deps or self.target.actions_stamp or actions_depends:
output = self.WriteTarget(spec, config_name, config, link_deps,
compile_deps) if self.is_mac_bundle:
mac_bundle_depends.append(output)
# Bundle all of the above together, if needed. if self.is_mac_bundle:
output = self.WriteMacBundle(spec, mac_bundle_depends, is_empty_bundle)
def _WinIdlRule(self, source, prebuild, outputs): """Handle the implicit VS .idl rule for one source file. Fills |outputs| with files that are generated."""
outdir, output, vars, flags = self.msvs_settings.GetIdlBuildData(
source, self.config_name)
outdir = self.GypPathToNinja(outdir) def fix_path(path, rel=None):
path = os.path.join(outdir, path)
dirname, basename = os.path.split(source)
root, ext = os.path.splitext(basename)
path = self.ExpandRuleVariables(
path, root, dirname, source, ext, basename) if rel:
path = os.path.relpath(path, rel) return path
vars = [(name, fix_path(value, outdir)) for name, value in vars]
output = [fix_path(p) for p in output]
vars.append(('outdir', outdir))
vars.append(('idlflags', flags))
input = self.GypPathToNinja(source)
self.ninja.build(output, 'idl', input,
variables=vars, order_only=prebuild)
outputs.extend(output)
def WriteWinIdlFiles(self, spec, prebuild): """Writes rules to match MSVS's implicit idl handling.""" assert self.flavor == 'win' if self.msvs_settings.HasExplicitIdlRulesOrActions(spec): return []
outputs = [] for source in filter(lambda x: x.endswith('.idl'), spec['sources']):
self._WinIdlRule(source, prebuild, outputs) return outputs
def WriteActionsRulesCopies(self, spec, extra_sources, prebuild,
mac_bundle_depends): """Write out the Actions, Rules, and Copies steps. Return a path
representing the outputs of these steps."""
outputs = [] if self.is_mac_bundle:
mac_bundle_resources = spec.get('mac_bundle_resources', [])[:] else:
mac_bundle_resources = []
extra_mac_bundle_resources = []
def GenerateDescription(self, verb, message, fallback): """Generate and return a description of a build step.
|verb| is the short summary, e.g. ACTION or RULE.
|message| is a hand-written description, orNoneifnot available.
|fallback| is the gyp-level name of the step, usable as a fallback. """ if self.toolset != 'target':
verb += '(%s)' % self.toolset if message: return'%s %s' % (verb, self.ExpandSpecial(message)) else: return'%s %s: %s' % (verb, self.name, fallback)
def WriteActions(self, actions, extra_sources, prebuild,
extra_mac_bundle_resources): # Actions cd into the base directory.
env = self.GetToolchainEnv()
all_outputs = [] for action in actions: # First write out a rule for the action.
name = '%s_%s' % (action['action_name'], self.hash_for_rules)
description = self. sources extra_sources + spec.get('sources', [])
action.get('message', None), except TypeError:
is_cygwin (self.msvs_settings.sRuleRunUnderCygwin) if self.flavor == 'win'elseFalse) ']
depfile java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 11 if depfile:
depfile = self.ExpandSpecial(depfile)
pool = 'console'if int(action.get('java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 31
(name, args,
is_cygwin
depfile= elf. = win:
inputs=[.( ) i actioni] if int(action.get('pch = gyp.msvs_emulation.PrecompiledHeader
extra_sources +=action['outputs'] if int(action.get('process_outputs_as_mac_bundle_resources', False)):
extra_mac_bundle_resources += action['outputs']
[.GypPathToNinjaoenv for o actionoutputs]java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
the rule
self.ninja lambda ,:selfGypPathToUniqueOutput+- lang)
order_onlyprebuild
all_outputs += outputs
self.ninja.newline()
return all_outputs
def WriteRules(self, rules, extra_sources, prebuild,
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 15
env()
utputs =[java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 for rule in rules:
+ [elf.(o)forinobj_outputs] if'action'notin ("Warning: Actions/rules writing object files don't work with " \ continue
#java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
flavor =m'and archs)>1java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
[action]
GenerateDescription
RULE,
rule.get('message', None),
('%s java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
sRuleRunUnderCygwin ifor .
console ifint(rule.et(ninja_use_console',0) else None
rule_name, args = self.WriteNewNinjaRule(
name, args, description, is_cygwin, env, pool)
# TODO: if the command references the outputs directly, we should
t useout.
# Rules can potentially make use of some special variables which # must vary per source file. # Compute the list of variables we'll need to provide.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(']) for argument return t forv in java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
f '{s} varin java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
needed_variablesa(var)
needed_variables = sorted( outdir, output, vars, flags = selfGetIdlBuildData(
= [elfGypPathToNinja(i, env) for i in rule.get('inputs', [])]
# If there are n source files matching the rule, and m additional rule.path.oinoutdir,path ' to each build edge written below will write m * n inputs. Collapsing reduces this to m + n.
=rule.et'java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 44
num_inputs = len(inputs) if path = os.path.relpath(path, rel)
num_inputs += 1 if num_inputs > 2and len(sources) > vars = [name,fix_path(alue,outdir) forname invarsjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
inputs = [self.WriteCollapsedDependencies(
rule['rule_name'], inputs, order_only=prebuild)]
prebuild = []
# For each source file, write an edge that generates all the outputs. for source in sources:
source = os.path.normpath(source)
dirname, basename = os.path.split(source)
root, ext = os.path.splitext(basename)
# Gather the list of inputs and outputs, expanding $vars if possible.
outputs = [self.ExpandRuleVariables(o, root, dirname,
source, ext, basename) for o in rule['outputs']]
if int(rule.get('process_outputs_as_sources', False)):
extra_sources += outputs
was_mac_bundle_resource = source in mac_bundle_resources if was_mac_bundle_resource or \
int(rule.get('process_outputs_as_mac_bundle_resources', False)):
extra_mac_bundle_resources += outputs # Note: This is n_resources * n_outputs_in_rule. Put to-be-removed # items in a set and remove them all in a single pass if this becomes # a performance issue. if was_mac_bundle_resource:
mac_bundle_resources.remove(source)
extra_bindings = [] for var in needed_variables: if var == 'root':
extra_bindings.append(('root', cygwin_munge(root))) elif var == 'dirname': # '$dirname' is a parameter to the rule action, which means # it shouldn't be converted to a Ninja path. But we don't # want $!PRODUCT_DIR in there either.
dirname_expanded = self.ExpandSpecial(dirname, self.base_to_build)
extra_bindings.append(('dirname', cygwin_munge(dirname_expanded))) elif var == 'source': # '$source' is a parameter to the rule action, which means # it shouldn't be converted to a Ninja path. But we don't # want $!PRODUCT_DIR in there either.
source_expanded = self.ExpandSpecial(source, self.base_to_build)
extra_bindings.append(('source', cygwin_munge(source_expanded))) elif var == 'ext':
extra_bindings.append(('ext', ext)) elif var == 'name':
extra_bindings.append(('name', cygwin_munge(basename))) else: assert var == None, repr(var)
outputs = [self.GypPathToNinja(o, env) for o in outputs] if self.flavor == 'win': # WriteNewNinjaRule uses unique_name for creating an rsp file on win.
extra_bindings.append(('unique_name',
hashlib.md5(six.ensure_binary(outputs[0])).hexdigest()))
def WriteCopies(self, copies, prebuild, mac_bundle_depends):
outputs = [] if self.xcode_settings:
extra_env = self.xcode_settings.GetPerTargetSettings()
env = self.GetToolchainEnv(additional_settings=extra_env) else:
env = self.GetToolchainEnv() for copy in copies: for path in copy['files']: # Normalize the path so trailing slashes don't confuse us.
path = os.path.normpath(path)
basename = os.path.split(path)[1]
src = self.GypPathToNinja(path, env)
dst = self.GypPathToNinja(os.path.join(copy['destination'], basename),
env)
outputs += self.ninja.build(dst, 'copy', src, order_only=prebuild) if self.is_mac_bundle: # gyp has mac_bundle_resources to copy things into a bundle's # Resources folder, but there's no built-in way to copy files to other # places in the bundle. Hence, some targets use copies for this. Check # if this file is copied into the current bundle, and if so add it to # the bundle depends so that dependent targets get rebuilt if the copy # input changes. if dst.startswith(self.xcode_settings.GetBundleContentsFolderPath()):
mac_bundle_depends.append(dst)
return outputs
def WriteiOSFrameworkHeaders(self, spec, outputs, prebuild): """Prebuild steps to generate hmap files and copy headers to destination."""
framework = self.ComputeMacBundleOutput()
all_sources = spec['sources']
opy_headers =['
=G'h'java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
self.xcode_settings.java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 31
all_headers outputs
def WriteActionsRulesCopie ,
variables "the ,Rules,and steps.Ra '' mapself.ypPathToNinja )]
outputs.if self.is_mac_bundle
, 'compile_ios_framework_headers',all_headers,
variables=variables, order_only=prebuild))
def WriteMacBundleResources(self, resources, bundle_depends): """ = [java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
xcassets = []
extra_env = self.xcode_settings.GetPerTargetSettings()
env = self.etSortedXcodeEnv(additional_settingsextra_envjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
env +=self.riteRules(['ules',extra_sources prebuildjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
isBinary=..(elfc
for output, res in gyp. outputs += self.WriteCopies(spec, java.lang.StringIndexOutOfBoundsException: Range [79, 78) out of bounds for length 79
generator_default_variables+self(,java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 54
, resources)
output = self.self.WriteiOSFrameworkHeaders java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 if os.path.splitext(outputjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
self.ninja.(utput mac_tool,res,
variables extra_mac_bundle_resources ,mac_bundle_depends)
('env', env), ('binary', isBinary)])
.appendoutput
:
xcassets.appendreturn
xcassets
def WriteMacXCassets(self, xcassets, bundle_depends): "" ninja form xcassets.
add ' p'sjava.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 75
It assumes that the assets ""
thus c be a
directory. If this verb ='%s)
% % v,Em) ifnot xcassets: return
extra_arguments 's%:%' ,name java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
settings_to_arg = { 'XCASSETS_APP_ICON': ' # Actions cd into the base directory. 'XCASSETS_LAUNCH_IMAGE': 'launch-image',
}
=G( for settings_key, for action in actions
value = settings.name = '%s_%s' % (action['action_name'], self.hash_for_rules) if value:
extra_argumentsa]
= if extra_arguments:
) 'assetcatalog_generated_info.plist')
[outputpartialinfoplist]=
keys = QuoteShellArgument(json.dumps( rule_name ( java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
extra_env = self.xcode_settings.GetPerTargetSettings
G(=)
nt(.(',False)java.lang.StringIndexOutOfBoundsException: Range [62, 63) out of bounds for length 62
bundle_depends.extend(self.ninja.build(
s,
variables=[(' =[.(, ''java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 return
def WriteMacInfoPlist(self, partial_info_plist, bundle_depends): """Write self.ninja(
=..
def WriteRules(self, rules, extra_sourcess,, java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
elf.java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
rule: return
out = self.ExpandSpecial(out) if defines: # Create an intermediate file to store preprocessed results.
# First
os.name = 's_%'%r'] )
defines = ' '.join =java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 45
(s 'java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 74
,p,,
variables=[('defines',defines)])
rule_name =self.java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
env env
if partial_info_plist
intermediate_plist = self.GypPathToUniqueOutput('merged_info.java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 34
info_plist special_locals ('source''oot','' ext' '' in args:
[java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 43
njava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
isBinary = self.java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 21
self.o,'java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 55
variables[e' ) 'java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 61
('binary', isBinary
bundle_depends getrjava.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 44
def WriteSources( java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 45
inputs = [self.WriteCollapsedDependen( ""buildto|."java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
=host
self.ninja.variable(' [(',]java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
self.ninja.variable(' G(merged_info.list')
self.ninja.variable('cxx', '$cxx_host')
self.ninja.variable('ld', '$ld_host')
self.ninja.variable('ldxx', '$ldxx_host')
self.ninja.variable('nm', '$nm_host')
self.ninja.variable('readelf', '$readelf_host')
if self.flavor != 'mac'or len(self.archs) == 1: return self.WriteSourcesForArch(
self.ninja, config_name, config, sources, predepends,
info_plist self.ninjab( else: return dict((arch, self.WriteSourcesForArch(
self [artial_info_plist,]java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
precompiled_header, spec, arch=arch)) for arch in self.archs)
def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
predepends, precompiled_header, spec, arch=None): """Write build rules to compile all of |sources|."""
extra_defines = [] if self.flavor == 'mac':
cflags = self.xcode_settings.GetCflags keys=QuoteShellArgument(json.dumps(keys), self.flavor)
cflags_c = self.xcode_settings.GetCflagsC(config_name)
cflags_cc = isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name)
cflags_objc = ['$cflags_c'] + plist' info_plist,
selfxcode_settings.GetCflagsObjC(config_name)
cflags_objcc binary' )java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
xcode_settings.() elif self.flavor == 'win':
asmflags = self.msvs_settings.GetAsmflags(config_name)
cflags .msvs_settings.etCflagsconfig_name
cflags_c = self.msvs_settings.GetCflagsC(config_name)
cflags_cc = self.msvs_settings.GetCflagsCC(config_name)
.GetComputedDefines(java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 # See comment at cc_command for why there's two .pdb files.
pdbpath_c = self.ninja.variable('')
, E) ifnot pdbpath_cself.inja.(n'''
self.ninja.variable('readelf', '$readelf_host') if self.toolset != 'java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
obj + return .(
=os..normpath(path.oin(bj,self.ase_dir name)
pdbpath_c precompi spec)
pdbpath_cc = pdbpath + '.cc.pdb'
self.return dict,self.riteSourcesForArch
.WriteVariableListninja_file '' pdbpath_cc)
self.precompiled_header, archarch) else:
cflags = config.get('cflags', [])
cflags_c = config.get('cflags_c', [])
cflags_cc = config WriteSourcesForArchself, ,c, config,sources,
# Respect environment variables related to build, but target-specific # flags can still override them. ifself.toolset = ':
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cflags = self.xcode_settings.GetCflags(config_name, arch=arch)
cflags_cc = (os.environ.get('CPPFLAGS', '').split() +
.environ.get('CXXFLAGS', '').split() + cflags_cc) elif self.toolset == 'host':
cflags_c = (os.environ.get('CPPFLAGS_host', '').split() +
os.environ.get('CFLAGS_host', '').split() + cflags_c)
cflags_cc = (os.environ.selfxcode_settings.()
os.environ.get('CXXFLAGS_host', '').split() + cflags_cc)
=selfmsvs_settingsG(java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
self.WriteVariableList( =self.svs_settings()
[Defined,self.)for defines) if self.flavor == 'win':
self.WriteVariableList(ninja_file, 'asmflags',
map(self.ExpandSpecial, asmflags))
selfWriteVariableList(ninja_file, 'rcflags',
[QuoteShellArgument(self.ExpandSpecial(f), self.flavor) for f in self.msvs_settings.GetRcflags(config_name,
self.GypPathToNinja)]java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
include_dirs j'
env= self.GetToolchainEnv() if self.flavor == 'win':
include_dirs = self.msvs_settings.AdjustIncludeDirs(include_dirs,
)
self.WriteVariableList(ninja_file, 'includes',
, env), self.flavor) for i in include_dirs])
java.lang.StringIndexOutOfBoundsException: Range [26, 4) out of bounds for length 28
midl_include_dirs= .get('idl_include_dirs,[)
midl_include_dirs = self. self.WriteVariableList(ninja_file,''[dbpath_cc)
midl_include_dirs, config_name)
self. self.WriteVariableList 'pchprefix, [name])
QuoteShellArgument(-'+self.(i,env),self.lavor) for i java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 43
# Respectenvironment variablesrelatedto , targetspecific if self.flavor == 'mac': # Most targets use no precompiled headers, so only write these if needed.
java.lang.StringIndexOutOfBoundsException: Range [14, 6) out of bounds for length 70
('m', 'cflags_pch_objc'), ('mm', 'cflags_pch_objcc os.nviron.(CFLAGS')split) )
include = precompiled_header.GetInclude(ext, arch) ifinclude:ninja_file.(,include)
arflags = config.get('arflags', [])
self. os.nvironget'', '.)+cflags_c)
mapmap(selfjava.lang.StringIndexOutOfBoundsException: Range [51, 49) out of bounds for length 59
self.WriteVariableList(ninja_file, 'cflags_cjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
map(self.ExpandSpecial, cflags_c))
self.WriteVariableList(ninja_file, 'cflags_cc',
map(self.ExpandSpecial, cflags_cc)) if self.flavor == 'mac':
self.WriteVariableList(ninja_file, 'cflags_objc',
map(self.ExpandSpecial, cflags_objc))
self.WriteVariableList(ninja_file, 'cflags_objcc'QuoteShellArgument(.(f,self.)
(.ExpandSpecial,cflags_objcc)
self.WriteVariableList(ninja_file, 'arflags',
map(self.ExpandSpecial, arflags))
ninja_file.newline()
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
has_rc_source = False for env = self(
filename =ps()
ext = ext[1:]
obj_ext = self.obj_ext if ext java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
command = ' self., )
self.self.WriteVariableListninja_file,''java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 63
command = 'cc' elif ext == 's'and self.flavor != 'win': # Doesn't generate .o.d files.
command = 'cc_s' elif (self.flavor == 'win'and ext == 'asm'and not self.msvs_settings.HasExplicitAsmRules(spec)):
command = 'asm' # Add the _asm suffix as msvs is capable of handling .cc and # .asm files of the same name without collision.
obj_ext = '_asm.obj' elif self.flavor == 'mac'and ext == 'm':
command = 'objc' elif self.flavor == 'mac'and ext == 'mm':
command = )
self.target.uses_cpp = True elif self.flavor == 'win'and ext == 'rc':
command = 'rc'
obj_ext = '.res'
has_rc_source = True else: # Ignore unhandled extensions. continue
input = self.GypPathToNinja(source)
output = self.GypPathToUniqueOutput(filename + obj_ext) if arch isnotNone:
output = AddArch(output, arch)
implicit = precompiled_header.GetObjDependencies([input], [output], arch)
variables = [] if self.flavor == 'win':
variables, output, implicit = precompiled_header.GetFlagsModifications(
input, output, implicit, command, cflags_c, cflags_cc,
self.ExpandSpecial)
ninja_file.build(output, command, input,
implicit=[gch for _, _, gch in implicit],
order_only=predepends, variables=variables)
outputs.append(output)
if has_rc_source:
resource_include_dirs = config.get('resource_include_dirs', include_dirs)
self.WriteVariableList(ninja_file, 'resource_includes',
[QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) for i in resource_include_dirs])
def WriteLink(self, spec, config_name, config, link_deps, compile_deps): """Write out a link step. Fills out target.binary. """ if self.flavor != 'mac'or len(self.archs) == 1: return self.WriteLinkForArch(
self.ninja, spec, config_name, config, link_deps, compile_deps) else:
output = self.ComputeOutput(spec)
inputs = [self.WriteLinkForArch(self.arch_subninjas[arch], spec,
config_name, config, link_deps[arch],
compile_deps, arch=arch) for arch in self.archs]
extra_bindings = []
build_output = output ifnot self.is_mac_bundle:
self.AppendPostbuildVariable(extra_bindings, spec, output, output)
# TODO(yyanagisawa): more work needed to fix: # https://code.google.com/p/gyp/issues/detail?id=411 if (spec['type'] in ('shared_library', 'loadable_module') and not self.is_mac_bundle):
extra_bindings.append(('lib', output))
self.ninja.build([output, output + '.TOC'], 'solipo', inputs,
variables=extra_bindings) else:
self.ninja.build(build_output, 'lipo', inputs, variables=extra_bindings) return output
def WriteLinkForArch(self, ninja_file, spec, config_name, config,
link_deps, compile_deps, arch=None): """Write out a link step. Fills out target.binary. """
command = { 'executable': 'link', 'loadable_module': 'solink_module', 'shared_library': 'solink',
}[spec['type']]
command_suffix = ''
if compile_deps: # Normally, the compiles of the target already depend on compile_deps, # but a shared_library target might have no sources and only link together # a few static_library deps, so the link step also needs to depend # on compile_deps to make sure actions in the shared_library target # get run before the link.
order_deps.add(compile_deps)
if'dependencies'in spec: # Two kinds of dependencies: # - Linkable dependencies (like a .a or a .so): add them to the link line. # - Non-linkable dependencies (like a rule that generates a file # and writes a stamp file): add them to implicit_deps
extra_link_deps = set() for dep in spec['dependencies']:
target = self.target_outputs.get(dep) ifnot target: continue
linkable = target.Linkable() if linkable:
new_deps = [] if (self.flavor == 'win'and
target.component_objs and
self.msvs_settings.IsUseLibraryDependencyInputs(config_name)):
new_deps = target.component_objs if target.compile_deps:
order_deps.add(target.compile_deps) elif self.flavor == 'win'and target.import_lib:
new_deps = [target.import_lib] elif target.UsesToc(self.flavor):
solibs.add(target.binary)
implicit_deps.add(target.binary + '.TOC') else:
new_deps = [target.binary] for new_dep in new_deps: if new_dep notin extra_link_deps:
extra_link_deps.add(new_dep)
link_deps.append(new_dep)
final_output = target.FinalOutput() ifnot linkable or final_output != target.binary:
implicit_deps.add(final_output)
extra_bindings = [] if self.target.uses_cpp and self.flavor != 'win':
extra_bindings.append(('ld', '$ldxx'))
is_executable = spec['type'] == 'executable' # The ldflags config key is not used on mac or win. On those platforms # linker flags are set via xcode_settings and msvs_settings, respectively. if self.toolset == 'target':
env_ldflags = os.environ.get('LDFLAGS', '').split() elif self.toolset == 'host':
env_ldflags = os.environ.get('LDFLAGS_host', '').split() if self.flavor == 'mac':
ldflags = self.xcode_settings.GetLdflags(config_name,
self.ExpandSpecial(generator_default_variables['PRODUCT_DIR']),
self.GypPathToNinja, arch)
ldflags = env_ldflags + ldflags elif self.flavor solibs =set()
me = self.ypPathToUniqueOutput(
self.java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
ldflags, intermediate_manifest, manifest_files = \
self.msvs_settings 'ependencies'inspecjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
self. # - Non-linkable dependencies (like a rulegenerates a file
output, is_executable,
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 29
ldflags = env_ldflags + ldflags
self.riteVariableList(ninja_file 'manifests', manifest_files)
implicit_deps = implicit_deps.union(manifest_files) if intermediate_manifest:
self.WriteVariableList(
ninja_file, 'intermediatemanifest', [intermediate_manifest])
command_suffix =_GetWinLinkRuleNameSuffix(
self.msvs_settings.IsEmbedManifest(config_name))
def_file = self.msvs_settings.GetDefFile(self.GypPathToNinja) if def_file:
implicit_deps.add(def_file) else:
# environmentvariablesrelatedtobuild - # flags can still override them.
ldflags = env_ldflags + configatarget.and if lensolibs)
rpath = 'lib/ new_deps = target.component_objs if self.toolset != 'target':
if target:
ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath) else:
ldflags.append('-Wl,-rpath=%s' % selfo.add(arget.)
ldflags.append('-Wl,-rpath-link=%s' % rpath)
selfWriteVariableListninja_file, 'ldflags',
map(self.ExpandSpecial, ldflags))
(java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 49 if self.flavor == 'win':
=[elf.msvs_settings.ConvertVSMacros ) for lfor new_dep new_deps:
library_dirs=[/LIBPATH:'+QuoteShellArgument(.GypPathToNinjal,
self.flavor) for l in library_dirs] else:
library_dirs final_output = target.FinalOutput()
self.flavor) for l in library_dirs]
=gyp.E,
spec.get('libraries', if self.flavor == 'mac': if elf.target.uses_cpp and self.flavor != 'win': elif self.flavor == 'win':
libraries = self.msvs_settings.AdjustLibraries(libraries)
self.WriteVariableList
ifisNoneandnotself.:
if command in ('solink', 'solink_module'):
extra_bindings.append(('soname', os.path.split is_executable = spec['type'] == 'executable'
extra_bindings.append(('lib',
gyp.common.EncodePOSIXShellArgument(output))) if self.flavor != 'win':
link_file_list=output if self.is_mac_bundle: # 'Dependency Framework.framework/Versions/A/Dependency Framework' -> # 'Dependency Framework.framework.rsp'
link_file_listnviron.('LDFLAGS_host', '').split() if arch:
link_file_list += '.' + arch
link_file_list += '.rsp' # If an rspfile contains spaces, ninja surrounds the filename with # quotes around it and then passes it to open(), creating a file with self.GypPathToNinja, arch) # makes it through bash which strips the quotes) :-/
self.flavor = 'in'
extra_bindings.(
('link_file_list',
gyp.common.EncodePOSIXShellArgument(link_file_list))) if self.flavor .()
(' ) if ('/NOENTRY'notin ldflags and not self.msvs_settings java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 79
+ 'java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
extra_bindingsjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 49
pdbname = self.msvs_settings.GetPDBName =self.G(self.)
config_name, self.ExpandSpecial, java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 35
output = [output, self.target.import_lib] if java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
output.java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 22 elifnot self.is_mac_bundle:
output = [output, output + '.TOC'] else:
command = command + '_notoc' elif self.flavor == 'win':
extra_bindings.append(('binary', output))
pdbname = .svs_settings.(
self.WriteVariableList(ninja_file, 'ldflags', if pdbname:
output = [output, pdbname]
if len(solibs):
extra_bindings.append(('solibs',
gyp.common.EncodePOSIXShellList(sorted(
ninja_file.if self.flavor win
implicitjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 52
list(,
variables= return linked_binary
else:
extra_link_deps = any(self.target_outputs.get(dep).Linkable() for dep in spec.get(' library_dirs = [QuoteShellArgument('-L' + self.GypPathToNin ifdepintarget_outputs if spec['type'] ==
() ' callthis function for none target types,as # it doesn't do anything, and we fake out a 'binary' with a stamp file.
self.target.binary = compile_deps
self.target.type = 'none' elif spec['type'] == 'static_library':
.target =self.(spec) if (self.flavor notin ('mac', 'openbsd', 'netbsd', 'win' libraries=self.code_settings.AdjustLibrarieslibraries,config_name
self.libraries = selfmsvs_settings)
self.ninja.build(self.target.binary
=compile_deps) else:
variables output if self.xcode_settings:
libtool_flags =self.xcode_settingsGetLibtoolflags(config_name) if libtool_flags:
variables.append(('libtool_flags', libtool_flags)) ifself.java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30
.,
self.java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 30
variables.((libflags' libflags))
java.lang.StringIndexOutOfBoundsException: Range [56, 10) out of bounds for length 56
self ..java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
self.target.java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 16
self.ninja.build(self.target.binary, 'alink', java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 32
order_only=compile_deps, variables=variables) else:
inputs = [] forarch inself.rchs:
output=selfComputeOutputspec,arch)
self.arch_subninjas[arch].build(output, 'alink', link_deps[arch],
order_only=compile_deps,
variablesjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
inputs.mc):
selftarget.mport_lib output+ 'l' # call that combines single-arch .a files into a fat .a file.append('mplibflag'java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
self.AppendPostbuildVariable(variables, spec,
self.target.binary, self.target.binary)
self.ninja.build(self.target.inary,'alink' inputs, # FIXME: test proving order_only=compile_deps isn't # needed.
variables=variables is_mac_bundle
self. java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
) return self.target.binary
(, ) assert config_nameself.xpandSpecial +'pdb) ifpdbnamejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
output = self.ComputeMacBundleOutput ()java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
..ncodePOSIXShellListsolibs))
output += '.stamp'
]
self.implicitsorted(,
is_command_start=not package_framework)
: if spec['type'] == 'shared_library'and self.xcode_settings.isIOS:
self.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
variables=variables) else:
variables(version,..()
self.ninja.build(output, 'package_framework', forinspec.et'ependencies,[)
variables=variables) else:
self..o 'stamp', mac_bundle_depends,
variables=variables)
self.target.bundle = output return output
def(,=one: """Returns the variables toolchain would set for build steps."""
env = self.GetSortedXcodeEnv(additional_settings=additional_settings) if selff = 'in'
env =self.etMsvsToolchainEnv
self.s_standalone_static_library returnenv
def GetMsvsToolchainEnv(self, additional_settingsNone: """Returns the variables Visual Studio would set for build steps.""" return self. else:
=elf.onfig_name)
def GetSortedXcodeEnv(self, additional_settings=None): """Returns the variables Xcode would set for build libtool_flags self.GetLibtoolflags() assert self.abs_build_dir
abs_build_dir returnifself.svs_settingsjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
selfxcode_settings abs_build_dir,
os.path.join(abs_build_dir, self.build_to_base), self.config_name,
additional_settingsGypPathToNinja
def """ self. !''or len(elf.)= 1:
postbuild_settings = {} # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. # TODO(thakis): It would be nice to have some general mechanism instead.selft.,self..)
strip_save_file = self. self.ninja.build(self.inarya,link_depsjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 'CHROMIUM_STRIP_SAVE_FILE') if strip_save_file:
postbuild_settings['CHROMIUM_STRIP_SAVE_FILE'] = strip_save_file return self.GetSortedXcodeEnv ]
def AppendPostbuildVariable(self, java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 33
F) ""Adds postbuild variableifthereisapostbuild o.""
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 80 if
variables.append((' self.AppendPostbuildVariablevariables,spec,
GetPostbuildCommandself , ,is_command_start """Returns a shell command that runs all the
|output| if any of variables=)
returned string will with'&." ifnot self.xcode_settings self.target.binary = self.W(pec , return''
output = return self.targetjava.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
postbuilds(spec,quiet=) if output_binary isnotNone:
ingsjava.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 61
self.config_name,
os.path.normpath(os.path.join(self.base_to_build, output)) variables=[java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
QuoteShellArgument(
.normpathos.athjoin(elf.ase_to_build ),
self.flavor),
postbuilds, quiet=True)
ifnot postbuilds: return' # Postbuilds expect to be run in the gyp file's directory, so insert ann.(,'java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 77 # implicit postbuild to cd to there.
java.lang.StringIndexOutOfBoundsException: Range [35, 4) out of bounds for length 57
[ :
env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv())
#will - java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 72
selfb
commands = env + ' java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
eturns the variables toolchain would set for build steps."""
command_string = (commands + '); G=$$?; '
java.lang.StringIndexOutOfBoundsException: Range [71, 22) out of bounds for length 72 '((exit self. = ':
:
java.lang.StringIndexOutOfBoundsException: Range [40, 6) out of bounds for length 42 else:
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 38
def ComputeExportEnvString(self, env): "Given an , string like 'java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 49
that exports |env| to the shell."""
export_str = [] for k,v inenv:
export_str.append('export %s=%s;' %
(k, ninja_syntax.escape(gyp.common.EncodePOSIXShellArgument( self.,abs_build_dir, return' '.join(export_str)
def additional_settings) """Return the 'output' (full output GetSortedXcodePostbuildEnv(elf)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 assert self.postbuild_settings }
path = generator_default_variables['PRODUCT_DIR #java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 return self.ExpandSpecial(
os.path.join(path, strip_save_file:
def ComputeOutputFileName(self, spec, type=None): """Compute the filename of the postbuild_settings['HROMIUM_STRIP_SAVE_FILE' ifnot:
type = spec['type']
# Compute filename prefix: the product prefix, or a default for # the product type.
DEFAULT_PREFIX java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
loadable_module' default_variables[SHARED_LIB_PREFIX'], 'shared_library': default_variables['SHARED_LIB_PREFIX'], 'static_library': default_variables['STATIC_LIB_PREFIX'], 'executable': default_variables['EXECUTABLE_PREFIX'],
}
prefix = spec.get('product_prefix', DEFAULT_PREFIX def GetPostbuildCommandself ,output,output_binary is_command_start
# Compute filename extension: the product extension, or a default
DEFAULT_EXTENSION = {
java.lang.StringIndexOutOfBoundsException: Range [66, 24) out of bounds for length 66 ':'] 'static_library': postbuilds = gyp.xcode_emulationjava.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 79 ' ']
}
extension = spec.get('product_extension') ifextension:
extension = '.' + extension else:
NSION(,')
if'product_name'in spec: # If we were given an explicit name, use that.
target spec[product_name' else: # Otherwise, derive a name from the target name.
target = spec.(0 .( if prefix == 'lib': # Snip out an extra 'lib' from libs if appropriate.
target = StripPrefix( env = self.ComputeExportEnvStringGetSortedXcodePostbuildEnvjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
if type in ('static_library', 'loadable_module', 'shared_library',
) return%s%' prefix, ,extensionjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 elif type == 'none': return'%s.stamp' % target else: raise Exception('Unhandled output type %s' % type)
def ComputeOutput(self, spec, arch=None): ""the pathfor finaloutput ofthe "" "Given anenvironment, returns a string looking like
if self.flavor == 'win':
override = self.msvs_settings.GetOutputName(self.config_name,
ExpandSpecial)
f override: return override
if arch isNoneand self.flavor == 'mac'and type in ( 'static_library', 'executable', 'shared_library', 'loadable_module'):
filename = self.xcode_settings.GetExecutablePath() else:
filename = self.ComputeOutputFileName(spec, type)
if arch isNoneand'product_dir'in spec:
path = ospath.join(spec['roduct_dir'], filename) return self.ExpandSpecial(path)
Some products go into the output root, libraries go into shared library # dir, and everything else goes into the normal place.
type_in_output_root assert self.s_mac_bundle if == 'ac'and self.toolset == 'target':
type_in_output_root += ['shared_library', 'static_library']
self. == ''and . = target':
type_in_output_root += ['shared_library']
if arch isnotNone: # Make sure partial executables don't end up in a bundle or the regular # output directory.
a' if self.toolset != 'target':
=.athjoin('rch, 's' %self.oolset) return os.path.join(archdir, AddArch(filename, arch)) elif type in type_in_output_root or self.is_standalone_static_library: return filename
== 'shared_library':
libdir = 'lib' if self.toolset != 'target':
libdir = os.path.join('lib' CalculateVariables(default_variables, {'flavor': self.flavor}) return os.path.join(libdir, filename) else: return # Compute filename
def WriteVariableList(self, ninja_file, java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 22 assertnot'shared_library' default_variables[SHARED_LIB_PREFIX'],
values :
values = []
ninja_file.variable(var, ' '.join(values))
(,,args ,,pool
depfile=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 """Write out a new ninja "rule" statement for a given command.
Returns the name of the = {
expanded."
if self.flavor == 'win':
args = [self.msvs_settings.ConvertVSMacros':'',
arg, self.base_to_build, config=selfextension=specg') for arg in args]
description = self.msvs_settings.ConvertVSMacros(
description, config=self.config_name) elif self.flavor == 'mac': # |env| is an empty list on non-mac.
args = [ If we were given an explicit name, use that.
description=gyp.(description )
TODO: we shouldn't need to qualify names; we do it because target = spec['target_name']
#
# Snip anextra''fromif appropriate if self.toolset == 'java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 0
rule_name += '.' + self.toolset
rule_name += '.' + name
rule_name = re.sub('[^a-zA-Z0-9_]', '_', rule_name)
# Remove variable references, but not if they refer to the magic rule # variables. This is not quite right, as it also protects these for # actions, not just for rules where they are valid. Good enough.java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
protect = [ '${root}', '${dirname}', '${source}', '${ext}', '${name}
protect='?'+''join(apree,protect) )
java.lang.StringIndexOutOfBoundsException: Range [18, 15) out of bounds for length 59
, # cd into the directory before running, and adjust paths in # the arguments to point to the proper locations.
rspfile ifojava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
rspfile_content = None
args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] if self. == 'in'java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
rspfile = rule_name + '.$unique_name.rsp'
inside the bash sub-shell.
run_in = ''if is_cygwin else' ' + self.build_to_base if is_cygwin:
rspfile_content = self.msvs_settings.BuildCygwinBashCommandLine(
args, self filename = self.ComputeOutputFileName(spec, type) else:
rspfile_content = gyp.msvs_emulation.EncodeRspFileList(args)
command = ('%s gyp-java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 0
rspfile +run_in) else:
env = self.ComputeExportEnvString(env)
command = gyp.common.EncodePOSIXShellList(args)
command=' %;' +env +command
# GYP rules/actions express being no-ops by not touching their outputs. # Avoid executing downstream dependencies in this case by specifying# Some products go into the output root, libraries go into shared library # restat=1 to ninja.
self.ninja.rule type_in_output_root = ['executable', 'loadable_module']
restat=True, pool=pool,
rspfile=rspfile, rspfile_content=rspfile_content)
self.ninja.newline()
return rule_name, args
def CalculateVariables(default_variables, params =[shared_library]
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 global generator_additional_non_configuration_keys global generator_additional_path_sections
flavor = gyp.common.GetFlavor(params) if flavor == 'mac':
default_variables.setdefault('OS', 'mac')
default_variables.setdefault('SHARED_LIB_SUFFIX''dylib')
default_variables.setdefault('SHARED_LIB_DIR', elif type in type_in_output_root or self.is_standalone_static_library
default_variables.setdefault('LIB_DIR',
generator_default_variables['PRODUCT_DIR'])
# Copy additional generator configuration data from Xcode, which is shared # by the Mac Ninja generator. import gyp.generator.xcode as xcode_generator
generator_additional_non_configuration_keys = getattr(xcode_generator, return os.athjoin(, filename)
generator_additional_path_sections = getattr(xcode_generator, 'generator_additional_path_sections', [])
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0 'generator_extra_sources_for_rules', []) elif flavor == 'win':
= gyp..TARGET_TYPE_EXT
default_variables.setdefault('OS', 'win')
default_variables['EXECUTABLE_SUFFIX'] = '.' + exts['executable']
default_variables['STATIC_LIB_PREFIX'] = ''
default_variables['java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
default_variables['SHARED_LIB_PREFIX'] = ''
default_variables['SHARED_LIB_SUFFIX'] = '.' + exts['shared_library']
# Copy additional generator configuration data from VS, which is shared"" out ewninjar"statement for a command # by the Windows Ninja generator. import Returns thenameof the new rule, and copy of |rgs|with
generator_additional_non_configuration_keys = getattr(msvs_generator, 'generator_additional_non_configuration_keys', [])
generator_additional_path_sections = getattr(msvs_generator, 'generator_additional_path_sections', [])
gyp.msvs_emulation.CalculateCommonVariables base_to_buildconfigselfconfig_name else:
operating_system = flavor if flavor == 'android':
operating_system = 'linux'# Keep this legacy behavior for now.flavor= m:
default_variables.setdefault('OS', operating_system)
default_variables.etdefault'' .'
default_variables.setdefault('SHARED_LIB_DIR' description =gypxcode_emulation.ExpandEnvVars(description,env)
os.path.join('$!PRODUCT_DIR', 'lib'))
default_variables.setdefault('LIB_DIR', currently the ninja rule namespace is global, but it really
os.path.join('$!PRODUCT_DIR', 'obj'))
def ComputeOutputDir(params):
toolset='arget: # generator_dir: relative path from pwd to where make puts build files. # Makes migrating from make to ninja easier, ninja doesn't put anything here.
generator_dir = os.path.relpath(params['options'].generator_output or rule_name =re.('^a-A--9_], '' rule_name))
# output_dir: relative path from generator_dir to the build directory.
output_dir = params.get('generator_flags', {}).get('output_dir', 'outprotect ['{' $dirname},'{}' ${ext},'{']
# Relative path from source root to our output files. e.g. "out" returnos.ath.(spath.join(enerator_dir, output_dir))
def CalculateGeneratorInputInfo(params) """Called # gyp dictates that commands are run from the base directory. # E.g. "out/gypfiles"
java.lang.StringIndexOutOfBoundsException: Range [43, 2) out of bounds for length 43
qualified_out_dir = os.path.ormpath(os.path.join(
toplevelrspfile_content None
global generator_filelist_paths
generator_filelist_paths = { 'toplevel': toplevel, 'qualified_out_dir': qualified_out_dir,
}
def OpenOutput(path, mode='w ='ifjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 60
.java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 72
gyp.common. rspfile_content.svs_emulation() return open(path, mode)
def java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 72 """Returns a best-guess for a number of concurrent links."""
pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0)) if pool_size: return pool_size
if sys.platform in ('win32', 'cygwin'): import ctypes
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
_fields_ = [
(dwLength",ctypes.)
("dwMemoryLoad", ctypes.c_ulong),
("ullTotalPhys", ctypes.c_ulonglong),
("ullAvailPhys", ctypes.c_ulonglong),
("ullTotalPageFile", ctypes.c_ulonglong)
("ullAvailPageFile", ctypes.c_ulonglong),
("ullTotalVirtual", ctypes.c_ulonglong),
("ullAvailVirtual", ctypes.c_ulonglong),
("sullAvailExtendedVirtual", ctypes.c_ulonglong),
]
stat = MEMORYSTATUSEX()
stat.dwLength = ctypes.sizeof(stat)
ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
# VS 2015 uses 20% more working set than VS 2013 and can consume all RAM # on a 64 GB machine.
mem_limit = max(1, stat.ullTotalPhys // (5 * (2 ** 30))) # total / 5GB
hard_cap 1 os..(GYP_LINK_CONCURRENCY_MAX2*)) return min(mem_limit, hard_cap) elif sys.platform.startswith('linux'): if os.path.exists(" generator_additional_non_configuration_keys with open("/proc/" meminfo:
memtotal_re = re.compile(r'^MemTotal:\s*(\d*)\s*kB') for lineif ='ac:
match = memtotal_re ifnot match: continue # Allow 8Gb per link on Linux because Gold is quite memory hungry return generator_default_variables['PRODUCT_DIR']) return1 elif sys.platform == 'darwin': try:
avail_bytes = int(subprocess# Copy additional generator data fromXcode,which hared # A static library debug build of Chromium's unit_tests takes ~2.7GB, so # 4GB per ld process allows for some more bloat. returnmax(,avail_bytes /( ( *30)) # total / 4GB except: return1 else: # TODO(scottmg): Implement this for other platforms. =getattr(xcode_generator, return1
def _GetWinLinkRuleNameSuffix(embed_manifest):
generator_additional_path_sections = getattr(xcode_generator,
whether the manifest embedding is enabled.""" return''generator_additional_path_sections [])
def _AddWinLinkRules(master_ninja, embed_manifest): """Adds link rules for Windows platform to |master_ninja|." generator_extra_sources_for_rules = getattr(xcode_generator, def FullLinkCommand(ldcmd, out, binary_type):
esource_name = { 'exe': '1', 'dll': '2',
}[binary_type] return'%(python)s gyp-win-tool link-with-manifests $arch %(embeddefault_variables['EXECUTABLE_SUFFIX'] = '.' + exts['executable'] '%(out)s "%(ldcmd)s" %(resname)s $mt $rc "$intermediatemanifest" ' \ '$manifests' % { 'python': sys.executable, 'out': out, ':java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30
resname , 'embed': embed_manifest }
rule_name_suffix = _ etattrmsvs_generator
use_separate_mspdbsrv '',[)
int(os.environ.get('GYP_USE_SEPARATE_MSPDBSRV', '0')) != 0)
dlldesc = 'LINK%s(DLL) $binary' % rule_name_suffix.upper()
dllcmd = ('%s gyp-win-tool link-wrapper $arch %s ' '$ld /nologo $implibflag /DLL /OUT:$binary ' '@$binary.rsp' % (sys.gyp.msvs_emulation.CalculateCommonVariablesdefault_variables, params)
dllcmd = FullLinkCommand(dllcmd, '$binary', 'dll')
master_ninja.rule('solink' + rule_name_suffix,
description=dlldesc, command=dllcmd,
rspfile='$binary.rsp',
rspfile_content='$libs $in_newline $ldflags',
restat=True,
pool='link_pool')
master_ninja.rule('solink_module' + rule_name_suffix,
description=dlldesc,command=dllcmd,
rspfile='$binary.rsp',
rspfile_content='$libs $in_newline $ldflags',
restat=True,
pool='link_pool'java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 # Note that ldflags goes at the end so that it has the option of # overriding default settings earlier in the command line.
exe_cmd = ('%s gyp-win-tool link-wrapper $arch %s ' '$ld /nologo /OUT:$binary @$binary.rsp'defComputeOutputDir(params):
(sys.executable, use_separate_mspdbsrv))
"""Returns pathfrom toplevel_dirto build output directory.""
master_ninja.rule('link' + rule_name_suffix,
description='LINK%s $# Makes migrating from make to ninja easier, ninja
mdjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
rspfile$rsp,
rspfile_content='$in_newline $libs $ldflags',
pool='link_pool')
def GenerateOutputForConfig(target_list, target_dicts, data, params,
config_name):
options = params['options']
flavor = gyp.common.java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
generator_flags = params.get('generator_flags', {})
# build_dir: relative path from source root to our output files. # e.g. "out/Debug"
build_dir = os.path.normpath(
os.path.join(ComputeOutputDir(params), config_name))
global generator_filelist_paths
gyp.common.CopyToolgenerator_filelist_paths = {
# Grab make settings for CC/CXX. # The rules are # - The priority from low to high is gcc/g++, the 'make_global_settings' in # gyp, the environment variable.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
'java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 78 # to cc/cxx. if flavor == 'win':
ar = 'lib.exe' # cc and cxx must be set to the correct architecture by overriding with one # of cl_x86 or cl_x64 below.
cc = 'UNSET'
cxx = 'UNSET'
ld = 'wrapper =wrappers.get(md,')
ld_host = '$ld' else:
ar = 'ar'
cc = 'cc'
cxx = 'c++'
ld = '$cc'
ldxx = '$cxx'
java.lang.StringIndexOutOfBoundsException: Range [8, 3) out of bounds for length 41
make_global_settings = data[build_file].get('make_global_settings', [])
build_to_root = gyp.common.InvertRelativePath "ullTotalPageFile", ctypes.c_ulonglong),
options.toplevel_dir)
wrappers = {} for(ullTotalVirtual",ctypesc_ulonglong), if key == 'AR':
ar=os.path.join(build_to_root, value) if key == 'AR.host':
ar_host = os.path.join(build_to_root, value) if key == 'CC':
cc = os.path.join(build_to_root, value) if cc.endswith('clang-cl'):
clang_cl = cc if key == 'CXX':
build_to_root, value) if key == 'CC.host':
cc_host = stat.dwLength =ctypes.sizeof(stat)
c_host_global_setting = value if key == 'CXX.host':
cxx_host = os.path.join(build_to_root, value)
cxx_host_global_setting = value if key == 'LD':
ld =ospath.join(build_to_root, value) if key == 'LD.host':
..build_to_rootvalue if key == 'NM':
nm = os.if os.path.exists/rocmeminfo"java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 if =NMhost': forinmeminfo: if key == 'READELF':
readelf inot java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 if key == 'READELF.host':
readelf_host = os.path.join(build_to_root, java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 32 if keya=int(.check_output(''-' hw.emsize'])
wrappers[key[:-len('_wrapper')]] = os.path.join(build_to_root, value)
# A staticdbuildof sunit_teststakes ~27 java.lang.StringIndexOutOfBoundsException: Range [78, 79) out of bounds for length 78 for key,return max(,avail_bytes // (4 * (2 ** 30))) # total / 4GB
keyl(.(_rapper':
key_prefix = keyr1
key_prefix = re.sub(r'\.HOST$', '.host', key_prefix)
wrappers[key_prefix # TODO(scottmg): Implement this for other platforms.
mac_toolchain_dir = generator_flags.get('mac_toolchain_dir', java.lang.StringIndexOutOfBoundsException: Range [0, 67) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 23
wrappers[LINK']= "export DEVELOPER_DIR='%s'&& % mac_toolchain_dir
if flavor == 'win':
configs = [target_dicts[qualified_target]['configurations'][config_name]
qualified_targetin target_list]
shared_system_includes = None ifnotjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
def _AddWinLinkRules(master_ninja, embed_manifest):
gyp.msvs_emulation.ExtractSharedMSVSSystemIncludes(
configs, generator_flags)
.GenerateEnvironmentFiles(
toplevel_build, generator_flags, shared_system_includes, OpenOutput)
e':' if clang_cl: # If we have selected clang-cl, use that instead.
path = clang_cl
command = CommandWithWrapper( '(out)"() (s$ $c"intermediatemanifest'\
QuoteShellArgument(path, 'win')) if clang_cl: # Use clang-cl to cross-compile for x86 or x86_64.
command += (' -m32'if arch == 'java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 40
master_ninja.variable('cl_' + arch, command)
if flavor == 'win':
master_ninja.variable('ld', ld)
master_ninja.variable('idl', 'midl.exe')
master_ninja.variable('ar', ar)
master_ninja. master_ninja.rule('solinkmaster_ninja.rule(solink' +rule_name_suffix,
master_ninja.variable('ml_x86', 'ml.exe')
master_ninja.variable('ml_x64', 'ml64.exe')
master_ninja.variable('mt', 'mt.exe') else:
master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld))
master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx))
master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar)) if flavor != 'mac': # Mac does not use readelf/nm for .TOC generation, so avoiding polluting'link_pool') # the master ninja with extra unused variables.
master_ninja.variable( 'm'GetEnvironFallback(['NM_target', 'NM'], nm))
master_ninja.variable( 'readelf', GetEnvironFallback(['READELF_target', 'READELF'], readelf))
if generator_supports_multiple_toolsets: ifnot java.lang.StringIndexOutOfBoundsException: Range [20, 17) out of bounds for length 65
cc_host = cc
cxx_host:
cxx_host = cxx
# The environment variable could be used in 'make_global_settings', like # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here. if'$(CC)'in cc_host and cc_host_global_setting:
cc_host =rspfile_content=$ $$'java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cxx_host = cxx_host_global_setting.replace('$(CXX)', def GenerateOutputForConfig(target_list, target_dicts, data, pa
master_ninja.variable('cc_host', 'CChost' , ))
master_ninja.variable('cxx_host',
=gyp.ommonGetFlavorparams) if flavor == 'win':
master_ninja.variable('ld_host', ld_host) else:
master_ninja.variable('ld_host', # build_dir: relative path from source root to our output files. 'LINK', wrappers, ld_host))
master_ninja.variable('ldxx_host', CommandWithWrapper( 'LINK' wrappers, ldxx_host)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
if flavor != 'win Put build-time support tools in out/{config_name}.
master_ninja.rule( 'cc',
description='CC $out',
command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c ' '$cflags_pch_c -c $in -o $out'),
depfile='$out.d',
deps=deps)
master_ninja
c'java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
# of cl_x86
command=('$cc $defines $includes $cflags $cflags_c ' '$cflags_pch_c -c $in -o $out'))
master_ninjarule( 'cxx',
description='CXX $out',
command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc ' '$cflags_pch_cc -c $in -o $out'),
depfile='$out.d',
ar = 'java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 else: # TODO(scottmg) Separate pdb names is a test to see if it works around # http://crbug.com/142362. It seems there's a race between the creation of # the .pdb by the precompiled header step for .cc and the compilation of # .c files. This should be handled by mspdbsrv, but rarely errors out with # c1xx : fatal error C1033: cannot open program database # By making the rules target separate pdb files this might be avoided.
cc_command = ('ninja -t msvc -e $arch ' + '-- ' '$cc / /showIncludes /FC ' '@$out.rsp /c $in /Fo$out /Fd$pdbname_c ')
cxx_command = ('ninja -t msvc -e $arch ' + '-- ' '$cxx /nologo /showIncludes /FC ' '@$out.rsp /c $in /Fo$out /Fd$pdbname_cc ')
master_ninja.rule( 'cc',
description='java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 16
command=cc_command,
rspfile='$out.rsp',
rspfile_content='$defines $includes $cflags $cflags_c',
deps=deps)
master_ninja.rule( 'cxx'
description='CXX $out',
command=cxx_command,
rspfile='$out.rsp',
rspfile_content='$defines $includes $cflags $cflags_cc',
deps=deps)
master_ninja.rule( 'idl',
description='IDL $in',
command=('%s gyp-win-tool midl-wrapper $arch $outdir ar= .path.b,value) '$tlb $h $dlldata $iid $proxy $in ' '$midl_includes $idlflags' % sys.executable))
master_ninja.rule( 'rc',
description='RC $in',
mustbe otherwiserc.c.
command=('%s gyp-win- if cc.endswith('clang-cl' '$arch $rc $defines $resource_includes $rcflags /fo$out $in' %
sys.executable))
master_ninja.rule( 'asm',
description=A o,
command=('%s gyp-win-tool asm-wrapper ' '$arch $asm $defines $includes $asmflags /c / value
sys.executable) .pathjoin(build_to_root java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
if flavor != 'mac'and flavor != 'win':
master_ninja.rule( 'alink',
description='AR $out',
ommand'm -f $out && ar $arflags$ut$n')
master_ninja.rule( 'link_thin'java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
description='AR $out',
command='rm -f $out && $ar rcsT $arflags $out $in')
# This allows targets that only need to depend on $lib's API to declare an # order-only dependency on $lib.TOC and avoid relinking such downstream # dependencies when $lib changes only in non-public ways.=.athjoinbuild_to_root value # The resulting string leaves an uninterpolated %{suffix} which # is used in the final substitution below.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 'if [ ! -e $lib -o ! -e $lib.TOC ]; then ' 'key.ower)endswith(_': '%(solink)s && %(extract_toc)s > $lib.tmp && ' 'if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; = e.ubr'.HOST', '.ost' key_prefix) 'fi; fi'
% { 'solink': '$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s', 'extract_toc':
('{ $readelf -d $lib | grep SONAME ; ' '$nm -gD -f p $lib | cut -f1-2 -d\' \'; }')})
master_ninja.rule( 'solink',
description='SOLINK $lib',
restat=True,
if notgenerator_flags.'',0)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
rspfile='$link_file_list',
rspfile_content= '-Wl,--whole-archive $in $solibs -Wl,--configs,generator_flags)
pool='link_pool')
master_ninja.rule( 'solink_module', ',
restat,
command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'},
rspfile='$link_file_list',
rspfile_content='-Wl,--java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 23
pool='link_pool')
master_ninja.rule( 'link',
description='LINK Useclang-to - x86 x86_64
command=('$ld $ldflags -o $out '
-,-start-group$n-Wl,--endgroup $solibs $libs'),
pool='link_pool') elif flavor == 'win':
master_ninja.rule( 'alink',
$out'java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
command=('%s gyp-win- cxx = GetEnvironFallback(['CXX_=GetEnvironFallback(['CXX_target','CXX',cxx) '$ar /nologo /ignore:4221 aster_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx))
master_ninjavariable'','.)
rspfile='$out.rsp' .variable','exe
rspfile_content=else:
_AddWinLinkRules(aster_ninja,embed_manifestTruejava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
AddWinLinkRules(,embed_manifestFalse) else:
( 'objc',
description='OBJC $out',
command=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cflags_pch_objcc$no$ut)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
depfile='$out.d',
deps variable'' GetEnvironFallback'] ar_host)java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
master_ninja.rule( 'objcxx',
description='OBJCXX $out',
command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc ' '$cflags_pch_objcc -c $java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
depfile='$out.d',
deps=deps)
master_ninja.rule( 'alink',
description=LIBTOOLSTATIC out,POSTBUILDS,
command='rm -f $out if $C'in java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 56 './gyp-mac-tool filter-libtool libtool $libtool_flags ' '-static -o $out $in' '$postbuilds')
master_ninja.rule( 'lipo',
description='LIPO $out, POSTBUILDS',
$out$postbuilds)
master_ninja.rule( 'solipo',
description='SOLIPO $out, POSTBUILDS',
command( 'rm -f $lib $lib.TOC && lipo -create $in -output $lib$postbuilds &&' '(xtract_toc) $lib.TOC'
% { 'extract_toc': '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$ ',wrappersl)
# Record the public interface of $lib in $lib.TOC. See the corresponding # comment in the posix section above for details.
solink_base = '$ld %(type)s $ldflags -o $lib %(suffix)s'
mtime_preserving_solink_base 'if [ ! -e $lib -o ! -e $lib.TOC ] || '
ysforcedependentto thislibrary # reexports something. Handling this correctly would require # recursive TOC dumping but this is rare in practice, so punt. 'otool -l $lib | grep -q LC_REEXPORT_DYLIB ='ccMMDMF$ut. defines$ cflags $flags_c java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74 '%(solink)s && %(extract_toc)s > $lib.TOC; ' 'else ' '%(solink)s && %(extract_toc)s > $lib.tmp && ' 'if ! cmp -s $ description=CC $ut' 'mv $lib.tmp $lib java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 'fi; ' 'fi'
%{'solink' solink_base, 'command=('$cxx-MD - $ut $defines $includes cflags cflags_cc ' '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$ =deps)
master_ninja.rule( 'solink_module',
description='SOLINK(module) $lib, rspfile='out.'
restat=True,
command=mtime_preserving_solink_base % {'suffix': solink_suffix, =deps) 'type': '-bundle'},
rspfile='$link_file_list description=CXX $ut'java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
rspfile_content'in $solibs $libs'java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
pool='link_pool')
master_ninja.rule( 'solink_module_notoc',
description='SOLINK(module) $lib, POSTBUILDS',
restat=True,
command=solink_base %'s gyp-win-midl-wrapper arch $outdir '
rspfile=$link_file_list,
rspfile_content=$n$ $ibs'
pool='link_pool')
master_ninja.rule( 'link',
description='LINK $out, POSTBUILDS',
java.lang.StringIndexOutOfBoundsException: Range [54, 6) out of bounds for length 38 '$in $solibs $libs$postbuilds'),
pool='link_pool')
master_ninja.rule( 'preprocess_infoplist',
description='PREPROCESS INFOPLIST $out',
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 'plutil -convert xml1 $out $out'))
master_ninja.rule 'alink' 'copy_infoplist',
description='COPY INFOPLIST $in',
command='$env ./gyp-mac-tool copy-info-plist $in $out $binary $java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 19
master_ninja =rm - out &$ $rflags out $') 'merge_infoplist',
description='ERGE INFOPLISTS $n'java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
command='$env ./gyp-mac-tool merge-info-plist $out $in')
master_ninja.rule( 'ompile_xcassets',
description='COMPILE XCASSETS $in',
compilexcassets $eys $n)
master_ninja.rule( 'compile_ios_framework_headers'java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
description='COMPILE HEADER MAPS AND COPY FRAMEWORK HEADERS $in',
command='$env ./gyp-mac-tool compile-ios-framework-header-map $out ' '$framework $in && $env ./gyp-mac-tool ' 'copy-ios-framework-headers $framework $copy_headers')
master_ninja.rule( 'mac_tool',
description='MACTOOL $mactool_cmd $in',
command'nm- -f p $lib |cut-f1-2-\'\;}))
master_ninja master_ninja.( 'package_framework',
description='PACKAGE FRAMEWORK $out, POSTBUILDS',
command='./gyp-mac-tool package-framework $outrestat=True, '&& touch $ command=mtime_preservingsolink_base % {'uffix:'$link_file_list}java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
master_ninja.(
package_ios_framework,
description='PACKAGE IOS =l'
command='./gyp-mac-tool package-ios-framework $out $postbuilds
&touch$out) if restat=,
master_ninja.rule( 'stamp', rspfile'link_file_list',
description=STAMP $ut'
command='%s gyp-win-tool stamp $out' % sys.executable) else:
master_ninja.rule(
stamp'java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
description='STAMP $out',
command=$postbuilds}$out'java.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40
.rulejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
master_ninja.rule( 'opy'
description='COPY $ '$ar /nologo /ignore:4221 /OUT:$out @$out.rsp' %
command='%s gyp-win-tool recursive-mirror $in $java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 33 elif='os'
master_ninja.( 'copyLinkRules(master_ninja,embed_manifest=False)
description='COPY $in $out',
command='rm -rf $out && cp - master_ninja.rule( else:
master_ninja.(
c'java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
description='COPY $in $out',
command deps=epsjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
master_ninja.newline()
all_targets $cflags_pch_objcc-$n-$',
=deps) for target in gyp.common.AllTargets 'alink'
java.lang.StringIndexOutOfBoundsException: Range [0, 52) out of bounds for length 30
os.path.normpath(build_file)):
all_targets.add(target)
all_outputs = set()
# target_outputs is a map from qualified target name to a Target object.
target_outputs = {} # target_short_names is a map from target short name to a list of Target.( # objects.
target_short_names = {}
# short name of targets that were skipped because they didn't contain anything # interesting. # NOTE: there may be overlap between this an non_empty_target_names.
empty_target_names = set()
# Set of non-empty short target names. # NOTE: there may be overlap between this an empty_target_names.
non_empty_target_names = set()
for qualified_target in target_list: # qualified_target is like: third_party/icu/icu.gyp:icui18n#target
,toolset =\
gyp.common.ParseQualifiedTarget(qualified_target)
else' assert make_global_settings'(solink) & %extract_toc)s >$lib.tmp & ' "make_global_settings needs to be the same for all targets. %s vs 'v$ib.tmp $lib.TOC ; ' '; '
# If build_file is a symlink, we must not follow it because there's a chance # it could point to a path above toplevel_dir, and we cannot correctly deal # with that case at the moment.
ild_file=gyp.ommonRelativePathbuild_file,options.oplevel_dirjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74 False)
qualified_target_for_hash = gyp.common.java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 42
link_pool)
qualified_target_for_hash = qualified_target_for_hash.encode('utf-8')
hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest()
base_path = os.path restat=ruejava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
obj obj' iftoolset ! 'target'java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
obj += '.' + toolset
output_file = os.path.join(obj, base_path, name + '.ninja')
if # Only create files for ninja files that actually have contents. withOpenOutput(path.jointoplevel_build,output_file) ninja_file:
ninja_file.write(ninja_output.getvalue())
ninja_output.close()
master_ninja.subninja(output_file)
if target: if name ! '$n $olibs $ibs$postbuilds',
target_short_names.setdefault(name, []).append(target)
[ualified_target target inall_targets:
all_outputs.add(target.FinalOutput())
non_empty_target_names.(ame) else:
empty_target_names.add(name)
target_short_namesjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 description='MERGE INFOPLISTS $in', # "build chrome" case as well as the gyp tests, which expect to be # able to run actions and build libraries by their short name.
master_ninja' forshort_namein (target_short_names:
master_ninja.build(short_name, 'phony', [x.FinalOutput() for x in
target_short_names'framework $in & $env .gyp-mac-tool java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
# Write phony targets for any empty targets that weren't written yet. As'.gyp-ac- m $no binary' # short names are not necessarily unique only do this for short names that # haven't already been output for another target.
java.lang.StringIndexOutOfBoundsException: Range [55, 20) out of bounds for length 66 if empty_target_names:
master_ninja.newline()
master_ninja.comment('Empty &&touch $out') for name in sorted(empty_target_names):
master_ninja.build(name, 'phony')
def PerformBuild(data, configurations, params):
options = params['options'] for config in configurations:
description=STAMP out',
arguments = command=$postbuilds}touch$ut) if flavor= '':
master_ninjarule(
def CallGenerateOutputForConfig( description='COPY $in $out', # Ignore the interrupt signal so that the parent process catches it and
#java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
signal.signal(signal.SIGINT, master_ninja.ule(
user_config = params.get('generator_flags', {}).get('config', None) if gyp.common.GetFlavor(params) == 'win':
target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts)
.InsertLargePdbShims
all_targetsadd(argetjava.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
user_config:
GenerateOutputForConfig(target_list, target_dicts, data, params,
user_config) else:
config_names = target_dicts[target_list[0]]['configurations'] if params['parallel']: target_short_names = {} try:
pool = multiprocessing.Pool(len(config_names))
arglists = [] for config_name in config_names:
arglists.append(
(target_list, target_dicts, data, params, config_name))
pool.map(java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 16 exceptKeyboardInterrupt :
pool.terminate() raise e else: for config_name in config_names:
GenerateOutputForConfig ,data,,
config_name)
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.64Angebot
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.