Index: pylib/gyp/msvs_emulation.py |
diff --git a/pylib/gyp/msvs_emulation.py b/pylib/gyp/msvs_emulation.py |
index eb9e0affeb035b66494c0f7bf6384092afa54d7f..12f9380593d5b84a93bdc9a513b2ee1a0a9cb8f2 100644 |
--- a/pylib/gyp/msvs_emulation.py |
+++ b/pylib/gyp/msvs_emulation.py |
@@ -53,7 +53,21 @@ def QuoteForRspFile(arg): |
def EncodeRspFileList(args): |
"""Process a list of arguments using QuoteCmdExeArgument.""" |
- return ' '.join(QuoteForRspFile(arg) for arg in args) |
+ # Note that the first argument is assumed to be the command. We take extra |
+ # steps to make sure that calls to .bat files are handled correctly, and |
+ # that paths are normalized and quoted as necessary. |
+ if not args: return '' |
+ program = args[0] |
+ if program.startswith('call '): |
+ call, batch = program.split(' ', 1) |
+ program = 'call ' + QuoteForRspFile(os.path.normpath(batch)) |
+ else: |
+ program = os.path.normpath(program) |
+ # Don't add quotes around things without spaces so that 'call', 'echo', |
+ # etc. will work if they're specified as individual arguments. |
+ if ' ' in program: |
+ program = QuoteForRspFile(program) |
+ return program + ' ' + ' '.join(QuoteForRspFile(arg) for arg in args[1:]) |
def _GenericRetrieve(root, default, path): |