Windows arm64 dependency cross-compilation fixes#7559
Windows arm64 dependency cross-compilation fixes#7559radarhere merged 2 commits intopython-pillow:mainfrom
Conversation
winbuild/build_prepare.py
Outdated
| elif args.architecture == "ARM64" and platform.machine() != "ARM64": | ||
| print( | ||
| "\nWarning: Cross-compiling FriBiDi is currently not supported, disabling" | ||
| ) |
There was a problem hiding this comment.
You didn't want to use warnings.warn()?
There was a problem hiding this comment.
I don't like that it can sometimes appear at a random point in the output due to using stderr instead of stdout so I hadn't even tested it. I've just tried it and found that:
- in Terminal, it seems to always print in the intended order;
- in PyCharm, it can print out of order, but uses a red highlight.
I've therefore changed the code to use warnings.warn.
| # libjpeg-turbo does not detect MSVC x86_arm64 cross-compiler correctly | ||
| 'if(MSVC_IDE AND CMAKE_GENERATOR_PLATFORM MATCHES "arm64")': "if({architecture} STREQUAL ARM64)", # noqa: E501 | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Is this change something that could be suggested to https://github.com/libjpeg-turbo/libjpeg-turbo, so that it could one day no longer require patching?
There was a problem hiding this comment.
No, not easily.
CMake does not provide a value for the target CPU architecture, only the host CPU architecture: https://stackoverflow.com/a/12024211/1648883
The {architecture} string here is referring to the Python value from
Pillow/winbuild/build_prepare.py
Line 712 in af83f67
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
For #6679 and #7390 (comment)
When compiling Pillow directly on an ARM64 system, I found it worked after installing the correct Visual Studio components.
Cross-compiling required a few patches to the dependencies.
Changes proposed in this pull request: