diff options
author | David Lechner <david@lechnology.com> | 2021-02-05 15:56:14 -0600 |
---|---|---|
committer | David Lechner <david@lechnology.com> | 2021-02-05 16:54:28 -0600 |
commit | b509809f34dcd4ef61b8b62156be22f1bceda2ce (patch) | |
tree | 4c74077481d5d797aa4f7ac38a0a7bc082985966 | |
parent | 60ff231fac3da797372165ba27dbbfc8602cef7d (diff) | |
download | gtk+-b509809f34dcd4ef61b8b62156be22f1bceda2ce.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.build | 7 | ||||
-rw-r--r-- | modules/media/meson.build | 2 | ||||
-rw-r--r-- | modules/printbackends/meson.build | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/meson.build b/meson.build index d13408bf95..729aa3ea19 100644 --- a/meson.build +++ b/meson.build @@ -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') 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, ) |