Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 02755b3

Browse files
committed
Disable FH4 so that we don't require VCRUNTIME140_1.dll.
For more details, see: https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/ pypa/cibuildwheel#423 (comment)
1 parent 8511771 commit 02755b3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/cibuildwheel.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
4040
CIBW_MANYLINUX_I686_IMAGE: manylinux1
4141
CIBW_BEFORE_BUILD: pip install numpy==1.15
42+
MPL_DISABLE_FH4: "yes"
4243

4344
- name: Build wheels for CPython 3.6
4445
run: |
@@ -48,6 +49,7 @@ jobs:
4849
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
4950
CIBW_MANYLINUX_I686_IMAGE: manylinux1
5051
CIBW_BEFORE_BUILD: pip install numpy==1.15
52+
MPL_DISABLE_FH4: "yes"
5153
if: >
5254
startsWith(github.ref, 'refs/heads/v3.3') ||
5355
startsWith(github.ref, 'refs/tags/v3.3')

setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ def build_extensions(self):
169169
self.compiler.compiler_so.remove('-Wstrict-prototypes')
170170
except (ValueError, AttributeError):
171171
pass
172+
if (self.compiler.compiler_type == 'msvc' and
173+
os.environ.get('MPL_DISABLE_FH4')):
174+
# Disable FH4 Exception Handling implementation so that we don't
175+
# require VCRUNTIME140_1.dll. For more details, see:
176+
# https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/
177+
# https://github.com/joerick/cibuildwheel/issues/423#issuecomment-677763904
178+
for ext in self.extensions:
179+
ext.extra_compile_args.append('/d2FH4-')
172180

173181
env = self.add_optimization_flags()
174182
for package in good_packages:

0 commit comments

Comments
 (0)