mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
windows: use CMake instead of MSBuild to compile liblzma
This commit is contained in:
parent
083a7703be
commit
407489a0dc
|
@ -10,7 +10,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.12 or newer (available as Visual Studio component).
|
||||
* Requires CMake 3.13 or newer (available as Visual Studio component).
|
||||
* Tested on Windows Server 2016 with Visual Studio 2017 Community, and Windows Server 2019 with Visual Studio 2022 Community (AppVeyor).
|
||||
* Tested on Windows Server 2022 with Visual Studio 2022 Enterprise (GitHub Actions).
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ Download and install:
|
|||
<https://visualstudio.microsoft.com/downloads/>`_
|
||||
(MSVC C++ build tools, and any Windows SDK version required)
|
||||
|
||||
* `CMake 3.12 or newer <https://cmake.org/download/>`_
|
||||
* `CMake 3.13 or newer <https://cmake.org/download/>`_
|
||||
(also available as Visual Studio component C++ CMake tools for Windows)
|
||||
|
||||
* x86/x64: `NASM <https://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D>`_
|
||||
|
|
|
@ -156,25 +156,15 @@ deps = {
|
|||
"filename": "xz-5.4.1.tar.gz",
|
||||
"dir": "xz-5.4.1",
|
||||
"license": "COPYING",
|
||||
"patch": {
|
||||
r"src\liblzma\api\lzma.h": {
|
||||
"#ifndef LZMA_API_IMPORT": "#ifndef LZMA_API_IMPORT\n#define LZMA_API_STATIC", # noqa: E501
|
||||
},
|
||||
r"windows\vs2019\liblzma.vcxproj": {
|
||||
# retarget to default toolset (selected by vcvarsall.bat)
|
||||
"<PlatformToolset>v142</PlatformToolset>": "<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>", # noqa: E501
|
||||
# retarget to latest (selected by vcvarsall.bat)
|
||||
"<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>": "<WindowsTargetPlatformVersion>$(WindowsSDKVersion)</WindowsTargetPlatformVersion>", # noqa: E501
|
||||
},
|
||||
},
|
||||
"build": [
|
||||
cmd_msbuild(r"windows\vs2019\liblzma.vcxproj", "Release", "Clean"),
|
||||
cmd_msbuild(r"windows\vs2019\liblzma.vcxproj", "Release", "Build"),
|
||||
cmd_cmake("-DBUILD_SHARED_LIBS:BOOL=OFF"),
|
||||
cmd_nmake(target="clean"),
|
||||
cmd_nmake(target="liblzma"),
|
||||
cmd_mkdir(r"{inc_dir}\lzma"),
|
||||
cmd_copy(r"src\liblzma\api\lzma\*.h", r"{inc_dir}\lzma"),
|
||||
],
|
||||
"headers": [r"src\liblzma\api\lzma.h"],
|
||||
"libs": [r"windows\vs2019\Release\{msbuild_arch}\liblzma\liblzma.lib"],
|
||||
"libs": [r"liblzma.lib"],
|
||||
},
|
||||
"libwebp": {
|
||||
"url": "http://downloads.webmproject.org/releases/webp/libwebp-1.3.0.tar.gz",
|
||||
|
@ -215,7 +205,9 @@ deps = {
|
|||
},
|
||||
},
|
||||
"build": [
|
||||
cmd_cmake("-DBUILD_SHARED_LIBS:BOOL=OFF"),
|
||||
cmd_cmake(
|
||||
"-DBUILD_SHARED_LIBS:BOOL=OFF", "-DCMAKE_C_FLAGS=-DLZMA_API_STATIC"
|
||||
),
|
||||
cmd_nmake(target="clean"),
|
||||
cmd_nmake(target="tiff"),
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue
Block a user