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

Unified Diff: pylib/gyp/input.py

Issue 27418008: ninja: Write gypcmd files into the output directory instead of the tree. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 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/variables/filelist/gyptest-filelist.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/input.py
===================================================================
--- pylib/gyp/input.py (revision 1758)
+++ pylib/gyp/input.py (working copy)
@@ -781,7 +781,7 @@
# Find the build file's directory, so commands can be run or file lists
# generated relative to it.
build_file_dir = os.path.dirname(build_file)
- if build_file_dir == '':
+ if build_file_dir == '' and not file_list:
# If build_file is just a leaf filename indicating a file in the
# current directory, build_file_dir might be an empty string. Set
# it to None to signal to subprocess.Popen that it should run the
@@ -798,9 +798,11 @@
else:
contents_list = contents.split(' ')
replacement = contents_list[0]
- path = replacement
- if build_file_dir and not os.path.isabs(path):
- path = os.path.join(build_file_dir, path)
+ if os.path.isabs(replacement):
+ raise GypError('| cannot handle absolute paths, got "%s"' % path)
+
+ path = generator_filelist_path(build_file_dir, replacement)
+ replacement = gyp.common.RelativePath(path, build_file_dir)
f = gyp.common.WriteOnDiff(path)
for i in contents_list[1:]:
f.write('%s\n' % i)
@@ -2599,6 +2601,11 @@
multiple_toolsets = generator_input_info[
'generator_supports_multiple_toolsets']
+ global generator_filelist_path
+ generator_filelist_path = generator_input_info['generator_filelist_path']
+ if not generator_filelist_path:
+ generator_filelist_path = lambda a, b: os.path.join(a, b)
+
# A generator can have other lists (in addition to sources) be processed
# for rules.
extra_sources_for_rules = generator_input_info['extra_sources_for_rules']
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | test/variables/filelist/gyptest-filelist.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698