mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Add quotes and fix ninja on Windows (#4416)
This commit is contained in:
committed by
Soumith Chintala
parent
2f25b9d052
commit
b7c64249cb
3
.gitignore
vendored
3
.gitignore
vendored
@ -53,3 +53,6 @@ test/data/linear.pt
|
||||
# macOS dir files
|
||||
.DS_Store
|
||||
|
||||
# Ninja files
|
||||
.ninja_deps
|
||||
.ninja_log
|
||||
|
@ -100,6 +100,9 @@ class ninja_build_ext(setuptools.command.build_ext.build_ext):
|
||||
# Cannot find src or obj, revert back to original style
|
||||
return orig_spawn(cmd)
|
||||
|
||||
from distutils.spawn import _nt_quote_args
|
||||
cmd = _nt_quote_args(cmd)
|
||||
|
||||
builder.writer.build(
|
||||
[obj], 'compile', [src],
|
||||
variables={
|
||||
@ -108,9 +111,9 @@ class ninja_build_ext(setuptools.command.build_ext.build_ext):
|
||||
})
|
||||
|
||||
with patch(self, 'spawn', spawn):
|
||||
orig_compile(self, sources,
|
||||
output_dir, macros, include_dirs, debug,
|
||||
extra_preargs, extra_postargs, depends)
|
||||
return orig_compile(self, sources,
|
||||
output_dir, macros, include_dirs, debug,
|
||||
extra_preargs, extra_postargs, depends)
|
||||
|
||||
def unix_compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
|
||||
depfile = os.path.splitext(obj)[0] + '.d'
|
||||
|
Reference in New Issue
Block a user