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.
This commit is contained in:
Chun-wei Fan 2018-06-23 01:53:32 +08:00
parent ed65ab1ba9
commit 5383d11bb4

View File

@ -23,6 +23,13 @@ endif
media_subdir = 'gtk-4.0/@0@/media'.format(gtk_binary_version) media_subdir = 'gtk-4.0/@0@/media'.format(gtk_binary_version)
media_install_dir = join_paths(get_option('libdir'), media_subdir) 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') if media_backends.contains('ffmpeg')
libavfilter_dep = dependency('libavfilter', version: '>= 6.47.100', required: true) libavfilter_dep = dependency('libavfilter', version: '>= 6.47.100', required: true)
libavformat_dep = dependency('libavformat', version: '>= 57.41.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', shared_module('media-ffmpeg',
'gtkffmediafile.c', 'gtkffmediafile.c',
c_args: [ c_args: extra_c_args,
'-DGTK_COMPILATION'
],
dependencies: [ libgtk_dep, ffmpeg_deps ], dependencies: [ libgtk_dep, ffmpeg_deps ],
install_dir: media_install_dir, install_dir: media_install_dir,
install : true) install : true)
@ -50,9 +55,7 @@ if media_backends.contains('gstreamer')
'gtkgstmediafile.c', 'gtkgstmediafile.c',
'gtkgstpaintable.c', 'gtkgstpaintable.c',
'gtkgstsink.c', 'gtkgstsink.c',
c_args: [ c_args: extra_c_args,
'-DGTK_COMPILATION'
],
dependencies: [ libgtk_dep, gstplayer_dep ], dependencies: [ libgtk_dep, gstplayer_dep ],
install_dir: media_install_dir, install_dir: media_install_dir,
install : true) install : true)