Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,8 @@ def build_extensions(self) -> None:
defs.append(("HAVE_LIBZ", None))
if feature.get("imagequant"):
libs.append(feature.get("imagequant"))
if sys.platform == "win32":
libs.extend(["ws2_32", "userenv", "ntdll"])
defs.append(("HAVE_LIBIMAGEQUANT", None))
if feature.get("xcb"):
libs.append(feature.get("xcb"))
Expand Down
1 change: 1 addition & 0 deletions winbuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For more extensive info, see the [Windows build instructions](build.rst).
* Requires Microsoft Visual Studio 2017 or newer with C++ component.
* Requires NASM for libjpeg-turbo, a required dependency when using this script.
* Requires CMake 3.15 or newer (available as Visual Studio component).
* Requires Rust for libimagequant; skip it with `--no-imagequant`.
* Tested on Windows Server 2025 and 2022 with Visual Studio 2022 Enterprise (GitHub
Actions).

Expand Down
3 changes: 3 additions & 0 deletions winbuild/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Download and install:

* x86/AMD64: `Netwide Assembler (NASM) <https://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D>`_

* libimagequant: `Rust <https://rustup.rs>`_
(optional, use ``--no-imagequant`` if not available)

Any version of Visual Studio 2017 or newer should be supported,
including Visual Studio 2017 Community, or Build Tools for Visual Studio 2019.

Expand Down
8 changes: 6 additions & 2 deletions winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,15 +322,19 @@ def cmd_msbuild(
"libs": [r"bin\*.lib"],
},
"libimagequant": {
"url": "https://github.com/ImageOptim/libimagequant/archive/{V['libimagequant']}.tar.gz",
"url": f"https://github.com/ImageOptim/libimagequant/archive/{V['libimagequant']}.tar.gz",
"filename": f"libimagequant-{V['libimagequant']}.tar.gz",
"license": "COPYRIGHT",
"build": [
cmd_cd("imagequant-sys"),
"cargo build --release",
cmd_copy(
r"..\target\release\imagequant_sys.lib",
"imagequant.lib",
),
],
"headers": ["libimagequant.h"],
"libs": [r"..\target\release\imagequant_sys.lib"],
"libs": ["imagequant.lib"],
},
"harfbuzz": {
"url": f"https://github.com/harfbuzz/harfbuzz/releases/download/{V['harfbuzz']}/FILENAME",
Expand Down
Loading