Skip to content

Commit 123789f

Browse files
authored
Add explicit setting for No GIL extra_compile_args
1 parent 094e7af commit 123789f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ def get_macros_and_flags():
136136
if sys.platform == "win32":
137137
define_macros += [("torchvision_EXPORTS", None)]
138138
extra_compile_args["cxx"].append("/MP")
139+
if sysconfig.get_config_var("Py_GIL_DISABLED"):
140+
extra_compile_args["cxx"].append("-DPy_GIL_DISABLED")
139141

140142
if DEBUG:
141143
extra_compile_args["cxx"].append("-g")

0 commit comments

Comments
 (0)