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

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

Issue 543743003: Changes the ninja generator to output phony targets for uninteresting targets (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 3 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/empty-target/empty-target.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 1972)
+++ pylib/gyp/generator/ninja.py (working copy)
@@ -2150,6 +2150,10 @@
# objects.
target_short_names = {}
+ # short name of targets that were skipped because they didn't contain anything
+ # interesting.
+ empty_target_names = []
+
for qualified_target in target_list:
# qualified_target is like: third_party/icu/icu.gyp:icui18n#target
build_file, name, toolset = \
@@ -2193,6 +2197,8 @@
target_outputs[qualified_target] = target
if qualified_target in all_targets:
all_outputs.add(target.FinalOutput())
+ else:
+ empty_target_names.append(name)
if target_short_names:
# Write a short name to build this target. This benefits both the
@@ -2204,6 +2210,15 @@
master_ninja.build(short_name, 'phony', [x.FinalOutput() for x in
target_short_names[short_name]])
+ if empty_target_names:
+ # Write out any targets that were skipped because they didn't contain
+ # anything interesting. This way the targets can still be built without
+ # causing build errors.
+ master_ninja.newline()
+ master_ninja.comment('Empty targets (output for completeness).')
+ for name in sorted(empty_target_names):
+ master_ninja.build(name, 'phony')
+
if all_outputs:
master_ninja.newline()
master_ninja.build('all', 'phony', list(all_outputs))
« no previous file with comments | « no previous file | test/empty-target/empty-target.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698