summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lechner <david@lechnology.com>2021-02-05 15:56:14 -0600
committerMatthias Clasen <mclasen@redhat.com>2021-02-07 11:45:50 -0500
commitcc55d662341eb4b9c32d1d28df5877db062bf677 (patch)
treeb356c463ce3f3d7496f509280681143888bee0f9
parentd1695ed9e2895e157323055d4b1df512cee9d23d (diff)
downloadgtk+-cc55d662341eb4b9c32d1d28df5877db062bf677.tar.gz
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.
-rw-r--r--meson.build7
-rw-r--r--modules/media/meson.build2
-rw-r--r--modules/printbackends/meson.build4
3 files changed, 13 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 90678f8d50..68fb8ec065 100644
--- a/meson.build
+++ b/meson.build
@@ -84,6 +84,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')
diff --git a/modules/media/meson.build b/modules/media/meson.build
index aa5c0280e6..154390e7fe 100644
--- a/modules/media/meson.build
+++ b/modules/media/meson.build
@@ -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,
)
diff --git a/modules/printbackends/meson.build b/modules/printbackends/meson.build
index 64d8a41974..fa55d60e3b 100644
--- a/modules/printbackends/meson.build
+++ b/modules/printbackends/meson.build
@@ -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,
)