From 0f4becea731185977f4724e1cd05bd4558daeb82 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 12 Jan 2026 19:01:09 +1100 Subject: [PATCH] Link to m from _imagingmath, except on Windows --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 35bea6fa44e..3d975950b6c 100644 --- a/setup.py +++ b/setup.py @@ -1089,7 +1089,11 @@ def debug_build() -> bool: Extension("PIL._webp", ["src/_webp.c"]), Extension("PIL._avif", ["src/_avif.c"]), Extension("PIL._imagingtk", ["src/_imagingtk.c", "src/Tk/tkImaging.c"]), - Extension("PIL._imagingmath", ["src/_imagingmath.c"]), + Extension( + "PIL._imagingmath", + ["src/_imagingmath.c"], + libraries=None if sys.platform == "win32" else ["m"], + ), Extension("PIL._imagingmorph", ["src/_imagingmorph.c"]), ]