Skip to content

Set FFI_STATIC_BUILDING in declare_dependency if making a static library

When doing static builds of glib on Windows, libffi is typically built from source using a Meson subproject.

The FFI_STATIC_BUILD define needs to be set when linking statically against libffi. It can either be set in glib's own meson.build, or directly in libffi's meson.build, if my understanding is correct.

This is useful for PRs/MRs like https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1655/ which try to get static msvc glib builds on Windows to work out of the box.

Merge request reports