static-php-cli icon indicating copy to clipboard operation
static-php-cli copied to clipboard

`imagick` on Windows?

Open simonhamp opened this issue 1 year ago • 7 comments

Is it possible?

simonhamp avatar Sep 09 '24 18:09 simonhamp

It's possible to support, but imagemagick for windows has different build script, need take some time.

crazywhalecc avatar Sep 10 '24 12:09 crazywhalecc

Let me know if there's anything I can help with!

simonhamp avatar Sep 10 '24 13:09 simonhamp

Progress updated.

Related issue: https://github.com/ImageMagick/ImageMagick/issues/7634

crazywhalecc avatar Sep 20 '24 08:09 crazywhalecc

Currently ImageMagick-windows repository is for windows build, but it cannot be used for php-src static build. The good news is the error looks fixable, but need some time to do it. This issue should be given a lower priority because it is more complicated than expected.

crazywhalecc avatar Oct 05 '24 03:10 crazywhalecc

You need to use the 64 bit msvc c++ compiler to compile the imagemagick lib. The linker doesn't care how the static lib was built, when the imagick extension later uses it.

henderkes avatar Oct 29 '24 08:10 henderkes

@crazywhalecc

# Add PHP_IMAGICK_SHARED, /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1

EXTENSION('imagick', 'imagick_class.c imagickdraw_class.c imagickpixel_class.c imagickpixeliterator_class.c imagick_helpers.c imagick_file.c imagick.c imagickkernel_class.c shim_im6_to_im7.c', PHP_IMAGICK_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");

You need to specify /Tp imagick_class.c /Tp imagickdraw_class.c and so on to compile them with C++. Or /TP, but that will compile all files as C++.

henderkes avatar May 29 '25 04:05 henderkes

https://learn.microsoft.com/en-us/cpp/build/reference/tc-tp-tc-tp-specify-source-file-type?view=msvc-170

henderkes avatar May 29 '25 04:05 henderkes