| Index: pylib/gyp/generator/ninja.py
|
| diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
|
| index 0e8ae9790853ea7051dd0ace99c363c63e7cc361..58be3bf1d328691b9497f10cfe8cfdfa4f6d2406 100644
|
| --- a/pylib/gyp/generator/ninja.py
|
| +++ b/pylib/gyp/generator/ninja.py
|
| @@ -139,8 +139,11 @@ class Target(object):
|
| self.bundle = None
|
| # On Windows, incremental linking requires linking against all the .objs
|
| # that compose a .lib (rather than the .lib itself). That list is stored
|
| - # here.
|
| + # 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_objs = None
|
| + 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
|
| # dll) we keep track of the import library here.
|
| @@ -474,16 +477,17 @@ class NinjaWriter(object):
|
| 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 and not mac_bundle_depends
|
| if link_deps or self.target.actions_stamp or actions_depends:
|
| output = self.WriteTarget(spec, config_name, config, link_deps,
|
| - self.target.actions_stamp or actions_depends)
|
| + compile_deps)
|
| if self.is_mac_bundle:
|
| mac_bundle_depends.append(output)
|
|
|
| @@ -1093,6 +1097,7 @@ class NinjaWriter(object):
|
|
|
| implicit_deps = set()
|
| solibs = set()
|
| + order_deps = set()
|
|
|
| if 'dependencies' in spec:
|
| # Two kinds of dependencies:
|
| @@ -1111,6 +1116,8 @@ class NinjaWriter(object):
|
| 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):
|
| @@ -1249,6 +1256,7 @@ class NinjaWriter(object):
|
|
|
| ninja_file.build(output, command + command_suffix, link_deps,
|
| implicit=list(implicit_deps),
|
| + order_only=list(order_deps),
|
| variables=extra_bindings)
|
| return linked_binary
|
|
|
|
|