summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-03-01 21:46:16 +0100
committerBenjamin Otte <otte@redhat.com>2018-03-18 21:01:23 +0100
commite4338c4d422501a459c714a82da76e2ec29b7727 (patch)
treeb7d75adc874c51ce0ba77c1ac0b47d9289d6981d /modules
parent29cccf5e84d61f438298e6f857939a1bcdb3d33a (diff)
downloadgtk+-e4338c4d422501a459c714a82da76e2ec29b7727.tar.gz
mediafile: Turn into an extension point
This way, we can support external libraries providing implementations of GtkMediaFile. We also add a media backend called 'nomedia' that can be enabled to not compile any support for GtkMediaFile. This is useful when people want to statically compile GTK into an application that does not use media. For now, this option is the default. We also support a new environment variable GTK_MEDIA that allows selecting the implementation to use. GTK_MEDIA=help can be used to get info about the available implementations.
Diffstat (limited to 'modules')
-rw-r--r--modules/media/meson.build23
-rw-r--r--modules/meson.build2
2 files changed, 25 insertions, 0 deletions
diff --git a/modules/media/meson.build b/modules/media/meson.build
new file mode 100644
index 0000000000..efab5a3b3e
--- /dev/null
+++ b/modules/media/meson.build
@@ -0,0 +1,23 @@
+all_media_backends = [
+]
+
+enabled_media_backends = get_option('media').split(',')
+
+if enabled_media_backends.contains('none')
+ media_backends = []
+elif enabled_media_backends.contains('all')
+ media_backends = all_media_backends
+else
+ media_backends = []
+ foreach b: enabled_media_backends
+ if all_media_backends.contains(b)
+ media_backends += b
+ else
+ error('No media backend named "@0@" exists.'.format (b))
+ endif
+ endforeach
+endif
+
+media_subdir = 'gtk-4.0/@0@/media'.format(gtk_binary_version)
+media_install_dir = join_paths(get_option('libdir'), media_subdir)
+
diff --git a/modules/meson.build b/modules/meson.build
index cde966a094..670f9fd96c 100644
--- a/modules/meson.build
+++ b/modules/meson.build
@@ -1,3 +1,5 @@
if os_unix
subdir('printbackends')
endif
+
+subdir('media')