mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +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,7 +111,7 @@ class ninja_build_ext(setuptools.command.build_ext.build_ext):
|
||||
})
|
||||
|
||||
with patch(self, 'spawn', spawn):
|
||||
orig_compile(self, sources,
|
||||
return orig_compile(self, sources,
|
||||
output_dir, macros, include_dirs, debug,
|
||||
extra_preargs, extra_postargs, depends)
|
||||
|
||||
|
Reference in New Issue
Block a user