Skip to content

Commit

Permalink
gyp: escape spaces in filenames in make generator
Browse files Browse the repository at this point in the history
PR-URL: #1436
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
Jeff Senn authored and bnoordhuis committed Jun 8, 2018
1 parent 88fc6fa commit 0540e4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gyp/pylib/gyp/generator/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,9 @@ def Sourceify(path):
def QuoteSpaces(s, quote=r'\ '):
return s.replace(' ', quote)

def SourceifyAndQuoteSpaces(path):
"""Convert a path to its source directory form and quote spaces."""
return QuoteSpaces(Sourceify(path))

# TODO: Avoid code duplication with _ValidateSourcesForMSVSProject in msvs.py.
def _ValidateSourcesForOSX(spec, all_sources):
Expand Down Expand Up @@ -1964,7 +1967,7 @@ def WriteAutoRegenerationRule(params, root_makefile, makefile_name,
"%(makefile_name)s: %(deps)s\n"
"\t$(call do_cmd,regen_makefile)\n\n" % {
'makefile_name': makefile_name,
'deps': ' '.join(map(Sourceify, build_files)),
'deps': ' '.join(map(SourceifyAndQuoteSpaces, build_files)),
'cmd': gyp.common.EncodePOSIXShellList(
[gyp_binary, '-fmake'] +
gyp.RegenerateFlags(options) +
Expand Down

0 comments on commit 0540e4e

Please sign in to comment.