From 9b277d68c5e7c1145aae39d612439bc4d4da9304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Thu, 23 Mar 2023 13:03:18 +0100 Subject: [PATCH] gstreamer-full: add GST_STATIC_COMPILATION for Windows In the case of a gstreamer-full target type to static, the GST_STATIC_COMPILATION is necessary on Windows to avoid a different mangling from the external project using the gstreamer-full libraries (ie dllimport). Part-of: --- meson.build | 8 +++++++- subprojects/gstreamer/gst/meson.build | 11 +++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 914582086c..32a31add67 100644 --- a/meson.build +++ b/meson.build @@ -87,7 +87,6 @@ endif building_full = get_option('default_library') == 'static' building_full_static = get_option('gst-full-target-type') == 'static_library' buildind_full_options = [] - if building_full buildind_full_options = ['gstreamer-full=enabled'] endif @@ -438,7 +437,13 @@ if building_full link_depends : link_deps, install : true, ) + gst_full_c_flags = [] + if building_full_static + gst_full_c_flags += ['-DGST_STATIC_COMPILATION'] + endif + gst_full_dep = declare_dependency(link_with: gstfull, + compile_args: gst_full_c_flags, dependencies : incdir_deps + glib_deps, include_directories: include_directories('.') ) @@ -473,6 +478,7 @@ if building_full pkgconfig.generate(gstfull, requires: glib_deps, libraries_private: gst_full_libs_private, + extra_cflags: gst_full_c_flags, subdirs : 'gstreamer-1.0') meson.override_dependency('gstreamer-full-1.0', gst_full_dep) diff --git a/subprojects/gstreamer/gst/meson.build b/subprojects/gstreamer/gst/meson.build index c88e494cc2..7476ef29b3 100644 --- a/subprojects/gstreamer/gst/meson.build +++ b/subprojects/gstreamer/gst/meson.build @@ -274,6 +274,11 @@ libgst = library('gstreamer-1.0', gst_sources, backtrace_deps, platform_deps, extra_deps], ) +gst_compile_args = [] +if static_build + gst_compile_args += ['-DGST_STATIC_COMPILATION'] +endif + pkg_name = 'gstreamer-1.0' library_def = {'lib': libgst} pkgconfig.generate(libgst, @@ -283,6 +288,7 @@ pkgconfig.generate(libgst, subdirs : pkgconfig_subdirs, name : pkg_name, description : 'Streaming media framework', + extra_cflags: gst_compile_args, ) if build_gir @@ -323,10 +329,7 @@ if build_gir endif gst_libraries += [[pkg_name, library_def]] -gst_compile_args = [] -if get_option('default_library') == 'static' - gst_compile_args += ['-DGST_STATIC_COMPILATION'] -endif + gst_dep = declare_dependency(link_with : libgst, compile_args : gst_compile_args,