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

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

Issue 10382161: Fix bug in ninja generator when there's no default action. (Closed) Base URL: http://git.chromium.org/external/gyp.git@master
Patch Set: fix other generators Created 8 years, 7 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 | « pylib/gyp/generator/ninja.py ('k') | test/rules/gyptest-all.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/scons.py
diff --git a/pylib/gyp/generator/scons.py b/pylib/gyp/generator/scons.py
index 7ac685f1bcfa134235439909a16d4de8517b8b61..9a4a8180e249961885b350835cc8c81106b86f81 100644
--- a/pylib/gyp/generator/scons.py
+++ b/pylib/gyp/generator/scons.py
@@ -464,7 +464,6 @@ def GenerateSConscript(output_filename, spec, build_file, build_file_data):
rules = spec.get('rules', [])
for rule in rules:
name = rule['rule_name'].translate(string.maketrans(' ()-', '____'))
- a = ['cd', src_subdir, '&&'] + rule['action']
message = rule.get('message')
if message:
message = repr(message)
@@ -474,6 +473,10 @@ def GenerateSConscript(output_filename, spec, build_file, build_file_data):
poas_line = '_processed_input_files.append(infile)'
inputs = [FixPath(f, src_subdir_) for f in rule.get('inputs', [])]
outputs = [FixPath(f, src_subdir_) for f in rule.get('outputs', [])]
+ # Skip a rule with no action and no inputs.
+ if 'action' not in rule and not rule.get('rule_sources', []):
+ continue
+ a = ['cd', src_subdir, '&&'] + rule['action']
fp.write(_rule_template % {
'inputs' : pprint.pformat(inputs),
'outputs' : pprint.pformat(outputs),
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | test/rules/gyptest-all.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698