Skip to content

Commit

Permalink
[mod] throwing in some virgins
Browse files Browse the repository at this point in the history
  • Loading branch information
stef committed Mar 26, 2024
1 parent 4918a36 commit e09cf7d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
CIBW_SKIP: cp36-* *_i686
CIBW_BEFORE_ALL_LINUX: yum install -y libsodium-devel || apk add --upgrade libsodium-dev || apt-get install -U libsodium-dev
CIBW_BEFORE_ALL_MACOS: brew install libsodium
CIBW_BEFORE_ALL_WINDOWS: choco install pandoc
# - uses: actions/upload-artifact@v4
# with:
# name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
Expand Down
22 changes: 22 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,28 @@ def spawn(self, cmd, **kwargs):
else:
cmd += ("-std=c11",
"-Werror=implicit-function-declaration",)
if self.compiler_type == "windows":
for argument in reversed(cmd):
# Check if argument contains a filename. We must check for all
# possible extensions; checking for target extension is faster.
if not argument.endswith(self.obj_extension):
continue

# check for a filename only to avoid building a new string
# with variable extension
off_end = -len(self.obj_extension)
off_start = -len(filename) + off_end
if argument.endswith(filename, off_start, off_end):
if self.compiler_type == 'bcpp':
# Borland accepts a source file name at the end,
# insert the options before it
cmd[-1:-1] = ("/EHsc",)
else:
cmd += ("/EHsc",)
# we're done, restore the original method
#self.spawn = self.__spawn
# filename is found, no need to search any further
break

distutils.ccompiler.spawn(cmd, dry_run=self.dry_run, **kwargs)

Expand Down

0 comments on commit e09cf7d

Please sign in to comment.