Chromium Code Reviews| Index: pylib/gyp/generator/ninja.py |
| =================================================================== |
| --- pylib/gyp/generator/ninja.py (revision 1133) |
| +++ pylib/gyp/generator/ninja.py (working copy) |
| @@ -266,6 +266,7 @@ |
| # Write out the compilation steps, if any. |
| link_deps = [] |
| + has_binary = True |
| sources = spec.get('sources', []) + extra_sources |
| if sources: |
| link_deps = self.WriteSources( |
| @@ -275,6 +276,8 @@ |
| lambda path, lang: self.GypPathToUniqueOutput(path + '-' + lang))) |
| # Some actions/rules output 'sources' that are already object files. |
| link_deps += [self.GypPathToNinja(f) for f in sources if f.endswith('.o')] |
| + else: |
| + has_binary = False |
| # The final output of our target depends on the last output of the |
| # above steps. |
| @@ -283,12 +286,14 @@ |
| if final_deps: |
| output, output_binary = self.WriteTarget( |
| spec, config_name, config, final_deps, mac_bundle_depends, |
| - order_only=actions_depends) |
| + has_binary, order_only=actions_depends) |
| if self.name != output and self.toolset == 'target': |
| # Write a short name to build this target. This benefits both the |
| # "build chrome" case as well as the gyp tests, which expect to be |
| # able to run actions and build libraries by their short name. |
| self.ninja.build(self.name, 'phony', output) |
| + else: |
| + self.ninja.build(self.name, 'phony', output) |
|
Evan Martin
2012/01/07 21:10:12
Would reusing the above similar line for this case
|
| return output, output_binary, compile_depends |
| def WriteActionsRulesCopies(self, spec, extra_sources, prebuild, |
| @@ -573,7 +578,7 @@ |
| self.ninja.build(gch, cmd, input, variables=[(var_name, lang_flag)]) |
| def WriteTarget(self, spec, config_name, config, final_deps, |
| - mac_bundle_depends, order_only): |
| + mac_bundle_depends, has_binary, order_only): |
| if spec['type'] == 'none': |
| # This target doesn't have any explicit final output, but is instead |
| # used for its effects before the final output (e.g. copies steps). |
| @@ -585,7 +590,8 @@ |
| if self.is_mac_bundle: |
| output = self.ComputeMacBundleOutput(spec) |
| output_binary = self.ComputeMacBundleBinaryOutput(spec) |
| - mac_bundle_depends.append(output_binary) |
| + if has_binary: |
| + mac_bundle_depends.append(output_binary) |
| else: |
| output = output_binary = self.ComputeOutput(spec) |