Skip to content

Commit 7e8f16e

Browse files
authored
fix(msvs): avoid fixing path for arguments with "=" (#143)
They are probably not paths, and V8 uses an argument like that, so the fix is needed in Node.js Refs: nodejs/node#42115
1 parent 063ba97 commit 7e8f16e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pylib/gyp/generator/msvs.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,15 @@ def _BuildCommandLineForRuleRaw(
423423
command.insert(0, "call")
424424
# Fix the paths
425425
# TODO(quote): This is a really ugly heuristic, and will miss path fixing
426-
# for arguments like "--arg=path" or "/opt:path".
427-
# If the argument starts with a slash or dash, it's probably a command line
428-
# switch
426+
# for arguments like "--arg=path", arg=path, or "/opt:path".
427+
# If the argument starts with a slash or dash, or contains an equal sign,
428+
# it's probably a command line switch.
429429
# Return the path with forward slashes because the command using it might
430430
# not support backslashes.
431-
arguments = [i if (i[:1] in "/-") else _FixPath(i, "/") for i in cmd[1:]]
431+
arguments = [
432+
i if (i[:1] in "/-" or "=" in i) else _FixPath(i, "/")
433+
for i in cmd[1:]
434+
]
432435
arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments]
433436
arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments]
434437
if quote_cmd:

0 commit comments

Comments
 (0)