Skip to content

Fix and Improve Visual Studio builds

Chun-wei Fan requested to merge meson.msvc into pygobject-3-30

Hi,

This MR is opened to improve the status of the Visual Studio builds done with Meson, as well as fixing and enhancing builds with distutils:

For both build systems:

-Force-include msvc_recommended_pragmas.h (which is part of GLib on Windows builds), which covers the compile-time flags that we want to look out for on Visual Studio builds

-Update pygi-closure.c to avoid compiler errors (which is raised with C4047, which we are wary about) by just casting arg->v_pointer to ffi_arg (which is more-or-less like a void pointer).

For Meson:

-Manully look for Cairo and Cairo-GObject on Visual Studio builds, if their pkg-config files could not be found, because the Makefiles shipped with Cairo do not generate pkg-config files for us.

For distutils:

-Fix the build on Visual Studio, since the distutils compiler instance is different on Visual Studio (no compiler sub-attribute).

-Enable tests to build and run on Visual Studio builds as well.

===

This is also likely needed for the Master branch.

With blessings, thank you!

Edited by Chun-wei Fan

Merge request reports