summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2018-06-23 01:53:32 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2018-12-06 17:07:33 +0800
commit5383d11bb40c333b3b3a7830ec21d5bbcb98be11 (patch)
tree45f91aa03033ccdba49c6ef32fb338fbcb2cf0cb
parented65ab1ba9d2911ae86f668c765c7adda8cd5167 (diff)
downloadgtk+-5383d11bb40c333b3b3a7830ec21d5bbcb98be11.tar.gz
modules/media/meson.build: Export needed symbols on MSVC
We need to override _GLIB_EXTERN to export the required symbols for the GIO module on Visual Studio, so that the media modules can be successfully loaded.
-rw-r--r--modules/media/meson.build15
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/media/meson.build b/modules/media/meson.build
index 860fe467e9..8a05ccb565 100644
--- a/modules/media/meson.build
+++ b/modules/media/meson.build
@@ -23,6 +23,13 @@ endif
media_subdir = 'gtk-4.0/@0@/media'.format(gtk_binary_version)
media_install_dir = join_paths(get_option('libdir'), media_subdir)
+extra_c_args = ['-DGTK_COMPILATION']
+
+# Detect and set symbol visibility
+if cc.get_id() == 'msvc'
+ extra_c_args += ['-D_GLIB_EXTERN=__declspec (dllexport) extern']
+endif
+
if media_backends.contains('ffmpeg')
libavfilter_dep = dependency('libavfilter', version: '>= 6.47.100', required: true)
libavformat_dep = dependency('libavformat', version: '>= 57.41.100', required: true)
@@ -34,9 +41,7 @@ if media_backends.contains('ffmpeg')
shared_module('media-ffmpeg',
'gtkffmediafile.c',
- c_args: [
- '-DGTK_COMPILATION'
- ],
+ c_args: extra_c_args,
dependencies: [ libgtk_dep, ffmpeg_deps ],
install_dir: media_install_dir,
install : true)
@@ -50,9 +55,7 @@ if media_backends.contains('gstreamer')
'gtkgstmediafile.c',
'gtkgstpaintable.c',
'gtkgstsink.c',
- c_args: [
- '-DGTK_COMPILATION'
- ],
+ c_args: extra_c_args,
dependencies: [ libgtk_dep, gstplayer_dep ],
install_dir: media_install_dir,
install : true)