mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
46ed0f0489
For each lib we build export its own API in headers when we're building it, otherwise import the API from the headers. This fixes linker warnings on Windows when building with MSVC. The problem was that we had defined all GST_*_API decorators unconditionally to GST_EXPORT. This was intentional and only supposed to be temporary, but caused linker warnings because we tell the linker that we want to export all symbols even those from externall DLLs, and when the linker notices that they were in external DLLS and not present locally it warns. What we need to do when building each library is: export the library's own symbols and import all other symbols. To this end we define e.g. BUILDING_GST_FOO and then we define the GST_FOO_API decorator either to export or to import symbols depending on whether BUILDING_GST_FOO is set or not. That way external users of each library API automatically get the import. https://bugzilla.gnome.org/show_bug.cgi?id=797185
95 lines
2.2 KiB
Meson
95 lines
2.2 KiB
Meson
gst_base_sources = [
|
|
'gstadapter.c',
|
|
'gstaggregator.c',
|
|
'gstbaseparse.c',
|
|
'gstbasesink.c',
|
|
'gstbasesrc.c',
|
|
'gstbasetransform.c',
|
|
'gstbitreader.c',
|
|
'gstbitwriter.c',
|
|
'gstbytereader.c',
|
|
'gstbytewriter.c',
|
|
'gstcollectpads.c',
|
|
'gstdataqueue.c',
|
|
'gstflowcombiner.c',
|
|
'gstpushsrc.c',
|
|
'gstqueuearray.c',
|
|
'gsttypefindhelper.c',
|
|
]
|
|
|
|
gst_base_headers = [
|
|
'base.h',
|
|
'base-prelude.h',
|
|
'gstadapter.h',
|
|
'gstaggregator.h',
|
|
'gstbaseparse.h',
|
|
'gstbasesink.h',
|
|
'gstbasesrc.h',
|
|
'gstbasetransform.h',
|
|
'gstbitreader.h',
|
|
'gstbitwriter.h',
|
|
'gstbytereader.h',
|
|
'gstbytewriter.h',
|
|
'gstcollectpads.h',
|
|
'gstdataqueue.h',
|
|
'gstflowcombiner.h',
|
|
'gstpushsrc.h',
|
|
'gstqueuearray.h',
|
|
'gsttypefindhelper.h',
|
|
]
|
|
|
|
gst_base_gen_sources = []
|
|
|
|
gst_base = library('gstbase-@0@'.format(apiversion),
|
|
gst_base_sources,
|
|
c_args : gst_c_args + ['-DBUILDING_GST_BASE'],
|
|
version : libversion,
|
|
soversion : soversion,
|
|
darwin_versions : osxversion,
|
|
install : true,
|
|
include_directories : [configinc, libsinc],
|
|
dependencies : [gobject_dep, glib_dep, gst_dep],
|
|
)
|
|
|
|
if build_gir
|
|
gst_gir_extra_args = gir_init_section + [ '--c-include=gst/base/base.h' ]
|
|
gst_base_gen_sources += [gnome.generate_gir(gst_base,
|
|
sources : gst_base_sources + gst_base_headers,
|
|
namespace : 'GstBase',
|
|
nsversion : apiversion,
|
|
identifier_prefix : 'Gst',
|
|
symbol_prefix : 'gst',
|
|
export_packages : 'gstreamer-base-1.0',
|
|
dependencies : [gst_dep],
|
|
include_directories : [configinc, libsinc, privinc],
|
|
includes : ['GLib-2.0', 'GObject-2.0', 'GModule-2.0', 'Gst-1.0'],
|
|
install : true,
|
|
extra_args : gst_gir_extra_args,
|
|
)]
|
|
endif
|
|
|
|
gst_base_dep = declare_dependency(link_with : gst_base,
|
|
include_directories : [libsinc],
|
|
dependencies : [gst_dep],
|
|
sources : gst_base_gen_sources)
|
|
|
|
install_headers('base.h',
|
|
'base-prelude.h',
|
|
'gstadapter.h',
|
|
'gstaggregator.h',
|
|
'gstbaseparse.h',
|
|
'gstbasesink.h',
|
|
'gstbasesrc.h',
|
|
'gstbasetransform.h',
|
|
'gstbitreader.h',
|
|
'gstbitwriter.h',
|
|
'gstbytereader.h',
|
|
'gstbytewriter.h',
|
|
'gstcollectpads.h',
|
|
'gstdataqueue.h',
|
|
'gstflowcombiner.h',
|
|
'gstpushsrc.h',
|
|
'gstqueuearray.h',
|
|
'gsttypefindhelper.h',
|
|
subdir : 'gstreamer-1.0/gst/base',
|
|
)
|