Support building with ImageMagick from MSYS2 #114
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linking against libraries from MSYS2 is useful as it provides unified configuration on Windows as Unix-like systems. By defining proper
IMAGE_MAGICK_*
env vars it's almost possible with magick-rust, and we just need to address the following issues:magick-baseconfig.h
generated on MSYS2 doesn't haveMAGICKCORE_HDRI_ENABLE
andMAGICKCORE_QUANTUM_DEPTH
defined. So we should make sureMagickCore-config
can be called using MSYS2's shell during compilation. One easy way is launchcmd /C bash MagickCore-config --cppflags
to work around Rust's default behavior.ssize_t
is not defined in Visual C++..dll.a
for import libs. Without them it will produce errors like this.This PR also adds a workflow that runs successfully with the preinstalled MSYS2 from the Windows runner image.