Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: pylib/gyp/generator/ninja.py

Issue 9121011: ninja/mac: Don't choke on bundles that have no 'sources'. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: actual test Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mac/gyptest-sourceless-module.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | test/mac/gyptest-sourceless-module.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698