From 593846984eb1a574d8039e2c8b26a2fc125950ba Mon Sep 17 00:00:00 2001 From: Rudolf Kolbe Date: Sat, 5 Oct 2024 20:29:27 +0200 Subject: [PATCH] python - link statically against vc_redist --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 6cd325d..51add68 100644 --- a/setup.py +++ b/setup.py @@ -89,6 +89,12 @@ class BuildExt(build_ext): # This clashes with GCC's cmath, and causes compilation errors when # building under MinGW: http://bugs.python.org/issue11566 macros.append(('_hypot', 'hypot')) + elif self.compiler.compiler_type == 'msvc': + # msvc links dynamicall to vc_runtime140.dll, + # which isn't installed by default on Windows 10+ + # Therefore it should be statically linked + extra_args.append("/MT") + for undef in ext.undef_macros: macros.append((undef,))