Skip to content

Commit 57d41fe

Browse files
committed
Stop disabling FH4 Exception Handling on MSVC
As of matplotlib#28687, our extensions depend on `VCRUNTIME140_1.dll`, and this was allowed because Python 3.8+ started shipping that file. The original report in matplotlib#18292 was for Python 3.7, which didn't ship the DLL, but we require Python 3.10 now, so it's safe again. Since we can use that dependency, there's no need to disable the option that started requiring it in the first place. As noted in the original blog post [1], this will make our extensions smaller, and slightly faster. [1] https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/
1 parent 6ff7f40 commit 57d41fe

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/meson.build

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,12 @@ extension_data = {
160160
},
161161
}
162162

163-
cpp_special_arguments = []
164-
if cpp.get_id() == 'msvc' and get_option('buildtype') != 'plain'
165-
# Disable FH4 Exception Handling implementation so that we don't require
166-
# VCRUNTIME140_1.dll. For more details, see:
167-
# https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/
168-
# https://github.com/joerick/cibuildwheel/issues/423#issuecomment-677763904
169-
cpp_special_arguments += ['/d2FH4-']
170-
endif
171-
172163
foreach ext, kwargs : extension_data
173164
# Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for each extension.
174165
unique_array_api = '-DPY_ARRAY_UNIQUE_SYMBOL=MPL_@0@_ARRAY_API'.format(ext.replace('.', '_'))
175166
additions = {
176167
'c_args': [unique_array_api] + kwargs.get('c_args', []),
177-
'cpp_args': cpp_special_arguments + [unique_array_api] + kwargs.get('cpp_args', []),
168+
'cpp_args': [unique_array_api] + kwargs.get('cpp_args', []),
178169
}
179170
py3.extension_module(
180171
ext,

0 commit comments

Comments
 (0)