Skip to content

Commit

Permalink
Disable FH4 so that we don't require VCRUNTIME140_1.dll.
Browse files Browse the repository at this point in the history
  • Loading branch information
QuLogic committed Aug 22, 2020
1 parent 8511771 commit 02755b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
CIBW_BEFORE_BUILD: pip install numpy==1.15
MPL_DISABLE_FH4: "yes"

- name: Build wheels for CPython 3.6
run: |
Expand All @@ -48,6 +49,7 @@ jobs:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
CIBW_BEFORE_BUILD: pip install numpy==1.15
MPL_DISABLE_FH4: "yes"
if: >
startsWith(github.ref, 'refs/heads/v3.3') ||
startsWith(github.ref, 'refs/tags/v3.3')
Expand Down
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ def build_extensions(self):
self.compiler.compiler_so.remove('-Wstrict-prototypes')
except (ValueError, AttributeError):
pass
if (self.compiler.compiler_type == 'msvc' and
os.environ.get('MPL_DISABLE_FH4')):
# Disable FH4 Exception Handling implementation so that we don't
# require VCRUNTIME140_1.dll. For more details, see:
# https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/
# https://github.com/joerick/cibuildwheel/issues/423#issuecomment-677763904
for ext in self.extensions:
ext.extra_compile_args.append('/d2FH4-')

env = self.add_optimization_flags()
for package in good_packages:
Expand Down

0 comments on commit 02755b3

Please sign in to comment.