[gtk/wip/fanc999/meson.msvc: 166/168] modules/media/meson.build: Export needed symbols on MSVC



commit 27211076c7aefd874d868ffe8f5206b6e4f0641e
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Sat Jun 23 01:53:32 2018 +0800

    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.

 modules/media/meson.build | 15 +++++++++------
 1 file 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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]