Skip to content

Commit 7deed22

Browse files
authored
Merge pull request #62 from KoichiYasuoka/patch-1
Tentative Cygwin support for dll
2 parents f10f4d7 + 77c41b4 commit 7deed22

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

setuptools_rust/build.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def build_extension(self, ext):
216216
"rust build failed; unable to find executable in %s" % target_dir
217217
)
218218
else:
219-
if sys.platform == "win32":
219+
if sys.platform == "win32" or sys.platform == "cygwin":
220220
dylib_ext = "dll"
221221
elif sys.platform == "darwin":
222222
dylib_ext = "dylib"
@@ -282,7 +282,8 @@ def build_extension(self, ext):
282282
except subprocess.CalledProcessError as e:
283283
pass
284284

285-
if executable:
285+
# executables and win32(cygwin)-dll's need X bits
286+
if executable or sys.platform == "win32" or sys.platform == "cygwin":
286287
mode = os.stat(ext_path).st_mode
287288
mode |= (mode & 0o444) >> 2 # copy R bits to X
288289
os.chmod(ext_path, mode)

0 commit comments

Comments
 (0)