meson: Always set G_MODULE_SUFFIX to so on macOS

This is what Autotools does, and it's what all consumers of the
GModule API expect. Without this change, people on macOS upgrading to
a GLib built with Meson will find that their plugins no longer load.

Projects that use Meson and the `g_module_build_path()` API such as
glib-networking should pass `name_suffix:` to `shared_module()` to
ensure that plugins continue to be called libfoo.so on macOS.

New GModule API will eventually be added to address this.

See also:
https://gitlab.gnome.org/GNOME/glib/issues/1413
a3d81719fe/meson.build (L108)
This commit is contained in:
Nirbheek Chauhan 2018-06-11 07:02:08 +05:30
parent 042b2af544
commit 64f789c6e2

View File

@ -1296,11 +1296,9 @@ glibconfig_conf.set('glongbits', long_size * 8)
glibconfig_conf.set('gsizebits', sizet_size * 8)
glibconfig_conf.set('gssizebits', ssizet_size * 8)
# FIXME: maybe meson should tell us the libsuffix?
# XXX: https://gitlab.gnome.org/GNOME/glib/issues/1413
if host_system == 'windows'
g_module_suffix = 'dll'
elif host_system == 'darwin'
g_module_suffix = 'dylib'
else
g_module_suffix = 'so'
endif