Skip to content

Commit f98fc9b

Browse files
authored
Merge pull request #7693 from nulano/winbuild-amd64
Rename x64 to AMD64 in winbuild
2 parents c46cf19 + 1f7171a commit f98fc9b

4 files changed

Lines changed: 27 additions & 30 deletions

File tree

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ environment:
1414
ARCHITECTURE: x86
1515
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
1616
- PYTHON: C:/Python38-x64
17-
ARCHITECTURE: x64
17+
ARCHITECTURE: AMD64
1818
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
1919

2020

.github/workflows/wheels.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,15 @@ jobs:
141141
path: ./wheelhouse/*.whl
142142

143143
windows:
144-
name: Windows ${{ matrix.arch }}
144+
name: Windows ${{ matrix.cibw_arch }}
145145
runs-on: windows-latest
146146
strategy:
147147
fail-fast: false
148148
matrix:
149149
include:
150-
- arch: x86
151-
cibw_arch: x86
152-
- arch: x64
153-
cibw_arch: AMD64
154-
- arch: ARM64
155-
cibw_arch: ARM64
150+
- cibw_arch: x86
151+
- cibw_arch: AMD64
152+
- cibw_arch: ARM64
156153
steps:
157154
- uses: actions/checkout@v4
158155

@@ -178,7 +175,7 @@ jobs:
178175
# Install extra test images
179176
xcopy /S /Y Tests\test-images\* Tests\images
180177
181-
& python.exe winbuild\build_prepare.py -v --no-imagequant --architecture=${{ matrix.arch }}
178+
& python.exe winbuild\build_prepare.py -v --no-imagequant --architecture=${{ matrix.cibw_arch }}
182179
shell: pwsh
183180

184181
- name: Build wheels
@@ -219,13 +216,13 @@ jobs:
219216
- name: Upload wheels
220217
uses: actions/upload-artifact@v4
221218
with:
222-
name: dist-windows-${{ matrix.arch }}
219+
name: dist-windows-${{ matrix.cibw_arch }}
223220
path: ./wheelhouse/*.whl
224221

225222
- name: Upload fribidi.dll
226223
uses: actions/upload-artifact@v4
227224
with:
228-
name: fribidi-windows-${{ matrix.arch }}
225+
name: fribidi-windows-${{ matrix.cibw_arch }}
229226
path: winbuild\build\bin\fribidi*
230227

231228
sdist:

winbuild/build.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Download and install:
2727
* `Ninja <https://ninja-build.org/>`_
2828
(optional, use ``--nmake`` if not available; bundled in Visual Studio CMake component)
2929

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

3232
Any version of Visual Studio 2017 or newer should be supported,
3333
including Visual Studio 2017 Community, or Build Tools for Visual Studio 2019.
@@ -42,7 +42,7 @@ Run ``build_prepare.py`` to configure the build::
4242

4343
usage: winbuild\build_prepare.py [-h] [-v] [-d PILLOW_BUILD]
4444
[--depends PILLOW_DEPS]
45-
[--architecture {x86,x64,ARM64}] [--nmake]
45+
[--architecture {x86,AMD64,ARM64}] [--nmake]
4646
[--no-imagequant] [--no-fribidi]
4747

4848
Download and generate build scripts for Pillow dependencies.
@@ -55,7 +55,7 @@ Run ``build_prepare.py`` to configure the build::
5555
--depends PILLOW_DEPS
5656
directory used to store cached dependencies (default:
5757
'winbuild\depends')
58-
--architecture {x86,x64,ARM64}
58+
--architecture {x86,AMD64,ARM64}
5959
build architecture (default: same as host Python)
6060
--nmake build dependencies using NMake instead of Ninja
6161
--no-imagequant skip GPL-licensed optional dependency libimagequant

winbuild/build_prepare.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def cmd_msbuild(
105105

106106
ARCHITECTURES = {
107107
"x86": {"vcvars_arch": "x86", "msbuild_arch": "Win32"},
108-
"x64": {"vcvars_arch": "x86_amd64", "msbuild_arch": "x64"},
108+
"AMD64": {"vcvars_arch": "x86_amd64", "msbuild_arch": "x64"},
109109
"ARM64": {"vcvars_arch": "x86_arm64", "msbuild_arch": "ARM64"},
110110
}
111111

@@ -174,23 +174,22 @@ def cmd_msbuild(
174174
"filename": "libwebp-1.3.2.tar.gz",
175175
"dir": "libwebp-1.3.2",
176176
"license": "COPYING",
177+
"patch": {
178+
r"src\enc\picture_csp_enc.c": {
179+
# link against libsharpyuv.lib
180+
'#include "sharpyuv/sharpyuv.h"': '#include "sharpyuv/sharpyuv.h"\n#pragma comment(lib, "libsharpyuv.lib")', # noqa: E501
181+
}
182+
},
177183
"build": [
178-
cmd_rmdir(r"output\release-static"), # clean
179-
cmd_nmake(
180-
"Makefile.vc",
181-
"all",
182-
[
183-
"CFG=release-static",
184-
"RTLIBCFG=dynamic",
185-
"OBJDIR=output",
186-
"ARCH={architecture}",
187-
"LIBWEBP_BASENAME=webp",
188-
],
184+
*cmds_cmake(
185+
"webp webpdemux webpmux",
186+
"-DBUILD_SHARED_LIBS:BOOL=OFF",
187+
"-DWEBP_LINK_STATIC:BOOL=OFF",
189188
),
190189
cmd_mkdir(r"{inc_dir}\webp"),
191190
cmd_copy(r"src\webp\*.h", r"{inc_dir}\webp"),
192191
],
193-
"libs": [r"output\release-static\{architecture}\lib\*.lib"],
192+
"libs": [r"libsharpyuv.lib", r"libwebp*.lib"],
194193
},
195194
"libtiff": {
196195
"url": "https://download.osgeo.org/libtiff/tiff-4.6.0.tar.gz",
@@ -203,8 +202,8 @@ def cmd_msbuild(
203202
"#ifdef LZMA_SUPPORT": '#ifdef LZMA_SUPPORT\n#pragma comment(lib, "liblzma.lib")', # noqa: E501
204203
},
205204
r"libtiff\tif_webp.c": {
206-
# link against webp.lib
207-
"#ifdef WEBP_SUPPORT": '#ifdef WEBP_SUPPORT\n#pragma comment(lib, "webp.lib")', # noqa: E501
205+
# link against libwebp.lib
206+
"#ifdef WEBP_SUPPORT": '#ifdef WEBP_SUPPORT\n#pragma comment(lib, "libwebp.lib")', # noqa: E501
208207
},
209208
r"test\CMakeLists.txt": {
210209
"add_executable(test_write_read_tags ../placeholder.h)": "",
@@ -217,6 +216,7 @@ def cmd_msbuild(
217216
*cmds_cmake(
218217
"tiff",
219218
"-DBUILD_SHARED_LIBS:BOOL=OFF",
219+
"-DWebP_LIBRARY=libwebp",
220220
'-DCMAKE_C_FLAGS="-nologo -DLZMA_API_STATIC"',
221221
)
222222
],
@@ -651,7 +651,7 @@ def build_dep_all() -> None:
651651
(
652652
"ARM64"
653653
if platform.machine() == "ARM64"
654-
else ("x86" if struct.calcsize("P") == 4 else "x64")
654+
else ("x86" if struct.calcsize("P") == 4 else "AMD64")
655655
),
656656
),
657657
help="build architecture (default: same as host Python)",

0 commit comments

Comments
 (0)