From 5c5ed1de504b10e459e152a38744965ee330c603 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 30 Dec 2025 17:57:47 +1100 Subject: [PATCH] Build in Windows CPython wheels --- checks/check_wheel.py | 3 ++- winbuild/build_prepare.py | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/checks/check_wheel.py b/checks/check_wheel.py index ef3981149..7c025ccb6 100644 --- a/checks/check_wheel.py +++ b/checks/check_wheel.py @@ -27,7 +27,8 @@ def test_wheel_modules() -> None: except ImportError: expected_modules.remove("tkinter") - expected_modules.remove("jpegxl") + if hasattr(sys, "pypy_translation_info"): + expected_modules.remove("jpegxl") # libavif is not available on Windows for ARM64 architectures if platform.machine() == "ARM64": diff --git a/winbuild/build_prepare.py b/winbuild/build_prepare.py index e167934d0..058e652e9 100644 --- a/winbuild/build_prepare.py +++ b/winbuild/build_prepare.py @@ -341,7 +341,17 @@ DEPS: dict[str, dict[str, Any]] = { "url": f"https://github.com/google/highway/archive/{V['HIGHWAY']}.tar.gz", "filename": f"highway-{V['HIGHWAY']}.tar.gz", "license": "LICENSE", - "build": [*cmds_cmake("hwy")], + "patch": { + r"CMakeLists.txt": { + "cmake_minimum_required(VERSION 3.10)": "cmake_minimum_required(VERSION 3.15)", # noqa: E501 + } + }, + "build": [ + *cmds_cmake( + "hwy", + '-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$:Debug>"', + ) + ], "libs": ["hwy.lib"], }, "libjxl": { @@ -356,6 +366,7 @@ DEPS: dict[str, dict[str, Any]] = { r"-DLCMS2_INCLUDE_DIR=..\..\inc", "-DJPEGXL_ENABLE_SJPEG:BOOL=OFF", "-DJPEGXL_ENABLE_SKCMS:BOOL=OFF", + "-DJPEGXL_STATIC:BOOL=ON", "-DBUILD_TESTING:BOOL=OFF", "-DBUILD_SHARED_LIBS:BOOL=OFF", ), @@ -664,7 +675,7 @@ def build_dep_all(disabled: list[str], prefs: dict[str, str], verbose: bool) -> print(f"Skipping disabled dependency {dep_name}") continue script = build_dep(dep_name, prefs, verbose) - if dep_name in ("highway", "libjxl"): + if dep_name in ("highway", "libjxl") and hasattr(sys, "pypy_translation_info"): continue if gha_groups: lines.append(f"@echo ::group::Running {script}")