Skip to content

Commit a8cc6ce

Browse files
committed
Install zlib before starting the windows build
1 parent 7d6bdce commit a8cc6ce

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,33 @@ build = "cp*-win_amd64 cp*-manylinux_x86_64 cp*-macosx_x86_64 cp*-macosx_arm64"
7272
skip = ["cp38-*", "cp3??t-*"]
7373

7474
[tool.cibuildwheel.windows]
75+
# 1. Install all architectures ONCE at the very beginning
76+
before-all = """
77+
vcpkg install zlib:x86-windows zlib:x64-windows zlib:arm64-windows
78+
echo "--- vcpkg zlib install complete ---"
79+
"""
80+
# 2. Before EACH build, map the arch and set env vars
81+
before-build = """
82+
echo "--- CIBW_BEFORE_BUILD for {arch} ---"
83+
84+
if "%{arch}" == "x86" (
85+
set VCPKG_ARCH_DIR=x86-windows
86+
) else if "%{arch}" == "AMD64" (
87+
set VCPKG_ARCH_DIR=x64-windows
88+
) else if "%{arch}" == "ARM64" (
89+
set VCPKG_ARCH_DIR=arm64-windows
90+
) else (
91+
echo "Unknown architecture: %{arch}"
92+
exit /b 1
93+
)
94+
95+
echo "Using vcpkg arch: %VCPKG_ARCH_DIR%"
96+
97+
set "INCLUDE=%VCPKG_ROOT%\\installed\\%VCPKG_ARCH_DIR%\\include;%INCLUDE%"
98+
set "LIB=%VCPKG_ROOT%\\installed\\%VCPKG_ARCH_DIR%\\lib;%LIB%"
99+
100+
echo "Updated INCLUDE: %INCLUDE%"
101+
"""
75102
test-command = "gambaterm --help"
76103

77104
[tool.cibuildwheel.macos]

0 commit comments

Comments
 (0)