Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building with ImageMagick from MSYS2 #114

Merged
merged 3 commits into from
Dec 1, 2023

Conversation

gyk
Copy link
Contributor

@gyk gyk commented Nov 29, 2023

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:

  1. 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.
  2. ssize_t is not defined in Visual C++.
  3. 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.

@nlfiedler nlfiedler merged commit bbe1aae into nlfiedler:master Dec 1, 2023
@nlfiedler
Copy link
Owner

Sorry for the delay, thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants