From 793fc70fd03c49269893687112f29e21ffa45d72 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 16 Aug 2024 13:38:03 +0200 Subject: [PATCH] statically link msvcp on Windows avoids conflicts if the version is old --- .gitignore | 3 +++ pyproject.toml | 6 ++++++ tools/test_wheel.py | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 33da4cf2c..735266120 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,6 @@ _deps _src licenses .virtual_documents +/libsodium-* +/zeromq-* +*.tar.gz diff --git a/pyproject.toml b/pyproject.toml index 5838f6fe4..299b19cf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -178,6 +178,12 @@ repair-wheel-command = """\ {wheel} \ """ +[tool.cibuildwheel.windows.config-settings] +# statically link MSVCP +# see https://github.com/zeromq/pyzmq/issues/2012 +# and https://github.com/matplotlib/matplotlib/pull/28687 +"cmake.define.CMAKE_MSVC_RUNTIME_LIBRARY" = "MultiThreaded" + [tool.cibuildwheel.windows.environment] ZMQ_PREFIX = "bundled" diff --git a/tools/test_wheel.py b/tools/test_wheel.py index 435c43f2c..dca9ee389 100644 --- a/tools/test_wheel.py +++ b/tools/test_wheel.py @@ -50,8 +50,8 @@ def test_bundle_msvcp(): print(dlls) # Is concrt140 needed? delvewheel doesn't detect it anymore # check for vcruntime? - should_bundle = ["msvcp140*.dll"] - shouldnt_bundle = [] + should_bundle = [] + shouldnt_bundle = ["msvcp140*.dll"] for pattern in shouldnt_bundle: matched = [dll for dll in dlls if fnmatch(dll, pattern)]