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:
Unlike in VisualMagick, magick-baseconfig.h generated on MSYS2 doesn't have MAGICKCORE_HDRI_ENABLE and MAGICKCORE_QUANTUM_DEPTH defined. So we should make sure MagickCore-config can be called using MSYS2's shell during compilation. One easy way is launch cmd /C bash MagickCore-config --cppflags to work around Rust's default behavior.
ssize_t is not defined in Visual C++.
MSYS2 uses unconventional extension .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.
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.