meson: use correct module file extension on macOS

GModule requires the .so file extension on macOS for historic reasons.
However Meson defaults to .dylib for modules, so we need to override
it to get the correct extension.

Fixes #3645.
This commit is contained in:
David Lechner 2021-02-05 15:56:14 -06:00
parent 60ff231fac
commit b509809f34
3 changed files with 13 additions and 0 deletions

View File

@ -85,6 +85,13 @@ gtk_library_version = '1.@0@.@1@'.format(gtk_binary_age - gtk_interface_age, gtk
gtk_api_version = '4.0'
module_suffix = []
# GModule requires file extension to be .so, not .dylib on Mac.
# https://gitlab.gnome.org/GNOME/glib/issues/520
if ['darwin', 'ios'].contains(host_machine.system())
module_suffix = 'so'
endif
x11_enabled = get_option('x11-backend')
wayland_enabled = get_option('wayland-backend')
broadway_enabled = get_option('broadway-backend')

View File

@ -35,6 +35,7 @@ if ffmpeg_found
sources: 'gtkffmediafile.c',
c_args: extra_c_args,
dependencies: [ libgtk_dep, ffmpeg_deps ],
name_suffix: module_suffix,
install_dir: media_install_dir,
install: true,
)
@ -56,6 +57,7 @@ if gstplayer_dep.found() and gstgl_dep.found()
],
c_args: extra_c_args,
dependencies: [ libm, libgtk_dep, gstplayer_dep, gstgl_dep ],
name_suffix: module_suffix,
install_dir: media_install_dir,
install: true,
)

View File

@ -22,6 +22,7 @@ if cups_dep.found()
],
c_args: printbackends_args,
dependencies: [libgtk_dep, cups_dep, colord_dep],
name_suffix: module_suffix,
install_dir: printbackends_install_dir,
install: true,
)
@ -32,6 +33,7 @@ else
sources: 'gtkprintbackendlpr.c',
c_args: printbackends_args,
dependencies: libgtk_dep,
name_suffix: module_suffix,
install_dir: printbackends_install_dir,
install: true,
)
@ -49,6 +51,7 @@ if rest_dep.found() and json_glib_dep.found()
],
c_args: printbackends_args,
dependencies: [ libgtk_dep, rest_dep, json_glib_dep ],
name_suffix: module_suffix,
install_dir: printbackends_install_dir,
install: true)
endif
@ -59,6 +62,7 @@ shared_module('printbackend-file',
sources: 'gtkprintbackendfile.c',
c_args: printbackends_args,
dependencies: libgtk_dep,
name_suffix: module_suffix,
install_dir: printbackends_install_dir,
install: true,
)