gstdevicemonitor: added cleanup of signal handlers and hidden providers list
[platform/upstream/gstreamer.git] / subprojects / gstreamer / gst / meson.build
1 gst_sources = files(
2   'gst.c',
3   'gstobject.c',
4   'gstallocator.c',
5   'gstbin.c',
6   'gstbuffer.c',
7   'gstbufferlist.c',
8   'gstbufferpool.c',
9   'gstbus.c',
10   'gstcaps.c',
11   'gstcapsfeatures.c',
12   'gstchildproxy.c',
13   'gstclock.c',
14   'gstcontext.c',
15   'gstcontrolbinding.c',
16   'gstcontrolsource.c',
17   'gstdatetime.c',
18   'gstdebugutils.c',
19   'gstdevice.c',
20   'gstdeviceprovider.c',
21   'gstdeviceproviderfactory.c',
22   'gstdynamictypefactory.c',
23   'gstelement.c',
24   'gstelementfactory.c',
25   'gsterror.c',
26   'gstevent.c',
27   'gstformat.c',
28   'gstghostpad.c',
29   'gstdevicemonitor.c',
30   'gstinfo.c',
31   'gstiterator.c',
32   'gstatomicqueue.c',
33   'gstmessage.c',
34   'gstmeta.c',
35   'gstmemory.c',
36   'gstminiobject.c',
37   'gstpad.c',
38   'gstpadtemplate.c',
39   'gstparamspecs.c',
40   'gstpipeline.c',
41   'gstplugin.c',
42   'gstpluginfeature.c',
43   'gstpluginloader.c',
44   'gstpoll.c',
45   'gstpreset.c',
46   'gstprotection.c',
47   'gstquark.c',
48   'gstquery.c',
49   'gstregistry.c',
50   'gstregistrychunks.c',
51   'gstpromise.c',
52   'gstsample.c',
53   'gstsegment.c',
54   'gststreamcollection.c',
55   'gststreams.c',
56   'gststructure.c',
57   'gstsystemclock.c',
58   'gsttaglist.c',
59   'gsttagsetter.c',
60   'gsttask.c',
61   'gsttaskpool.c',
62   'gsttoc.c',
63   'gsttocsetter.c',
64   'gsttracer.c',
65   'gsttracerfactory.c',
66   'gsttracerrecord.c',
67   'gsttracerutils.c',
68   'gsttypefind.c',
69   'gsttypefindfactory.c',
70   'gsturi.c',
71   'gstutils.c',
72   'gstvalue.c',
73   'gstparse.c',
74 )
75
76 gst_headers = files(
77   'gst.h',
78   'glib-compat.h',
79   'gstobject.h',
80   'gstallocator.h',
81   'gstbin.h',
82   'gstbuffer.h',
83   'gstbufferlist.h',
84   'gstbufferpool.h',
85   'gstbus.h',
86   'gstcaps.h',
87   'gstcapsfeatures.h',
88   'gstchildproxy.h',
89   'gstclock.h',
90   'gstcompat.h',
91   'gstcontext.h',
92   'gstcontrolbinding.h',
93   'gstcontrolsource.h',
94   'gstdatetime.h',
95   'gstdebugutils.h',
96   'gstelement.h',
97   'gstelementmetadata.h',
98   'gstdevice.h',
99   'gstdeviceprovider.h',
100   'gstdeviceproviderfactory.h',
101   'gstdynamictypefactory.h',
102   'gstelementfactory.h',
103   'gsterror.h',
104   'gstevent.h',
105   'gstformat.h',
106   'gstghostpad.h',
107   'gstdevicemonitor.h',
108   'gstinfo.h',
109   'gstiterator.h',
110   'gstatomicqueue.h',
111   'gstmacros.h',
112   'gstmessage.h',
113   'gstmeta.h',
114   'gstmemory.h',
115   'gstminiobject.h',
116   'gstpad.h',
117   'gstpadtemplate.h',
118   'gstparamspecs.h',
119   'gstpipeline.h',
120   'gstplugin.h',
121   'gstpluginfeature.h',
122   'gstpoll.h',
123   'gstpreset.h',
124   'gstprotection.h',
125   'gstquery.h',
126   'gstpromise.h',
127   'gstsample.h',
128   'gstsegment.h',
129   'gststreamcollection.h',
130   'gststreams.h',
131   'gststructure.h',
132   'gstsystemclock.h',
133   'gsttaglist.h',
134   'gsttagsetter.h',
135   'gsttask.h',
136   'gsttaskpool.h',
137   'gsttoc.h',
138   'gsttocsetter.h',
139   'gsttracer.h',
140   'gsttracerfactory.h',
141   'gsttracerrecord.h',
142   'gsttypefind.h',
143   'gsttypefindfactory.h',
144   'gsturi.h',
145   'gstutils.h',
146   'gstvalue.h',
147   'gstregistry.h',
148   'gstparse.h',
149   'math-compat.h',
150 )
151 install_headers(gst_headers, subdir : 'gstreamer-1.0/gst')
152
153 extra_deps = []
154 if host_system == 'android'
155   gst_sources += 'gstandroid.c'
156   extra_deps += cc.find_library('log')
157 endif
158
159 gst_registry = get_option('registry')
160 if gst_registry
161   gst_registry_sources = files('gstregistrybinary.c')
162 else
163   gst_registry_sources = []
164 endif
165
166 # Make copy so configure_file consumes the copy and we can
167 # still add to the original cdata later.
168 gst_cdata = cdata
169
170 if gst_debug
171   gst_cdata.set('GST_DISABLE_GST_DEBUG_DEFINE', '#undef GST_DISABLE_GST_DEBUG')
172 else
173   gst_cdata.set('GST_DISABLE_GST_DEBUG_DEFINE', '#define GST_DISABLE_GST_DEBUG 1')
174 endif
175
176 if gst_registry
177   gst_cdata.set('GST_DISABLE_REGISTRY_DEFINE', '#undef GST_DISABLE_REGISTRY')
178 else
179   gst_cdata.set('GST_DISABLE_REGISTRY_DEFINE', '#define GST_DISABLE_REGISTRY 1')
180 endif
181
182 gst_parse = get_option('gst_parse')
183 if gst_parse
184   gst_cdata.set('GST_DISABLE_PARSE_DEFINE', '#undef GST_DISABLE_PARSE')
185 else
186   gst_cdata.set('GST_DISABLE_PARSE_DEFINE', '#define GST_DISABLE_PARSE 1')
187 endif
188
189 gst_cdata.set10('GST_DISABLE_CAST_CHECKS_DEFINE', cast_checks.disabled())
190 gst_cdata.set10('GST_DISABLE_GLIB_ASSERTS_DEFINE', glib_asserts.disabled())
191 gst_cdata.set10('GST_DISABLE_GLIB_CHECKS_DEFINE', glib_checks.disabled())
192
193 # FIXME: add --disable-plugin option?
194 gst_cdata.set('GST_DISABLE_PLUGIN_DEFINE', '#undef GST_DISABLE_PLUGIN')
195
196 configure_file(input : 'gstconfig.h.in',
197   output : 'gstconfig.h',
198   install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst'),
199   configuration : gst_cdata)
200
201 version_cdata = configuration_data()
202 version_cdata.set('GST_VERSION_MAJOR', gst_version_major)
203 version_cdata.set('GST_VERSION_MINOR', gst_version_minor)
204 version_cdata.set('GST_VERSION_MICRO', gst_version_micro)
205 version_cdata.set('GST_VERSION_NANO', gst_version_nano)
206
207 gst_version_h = configure_file(input : 'gstversion.h.in',
208   output : 'gstversion.h',
209   install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst'),
210   configuration : version_cdata)
211
212 gst_enums = gnome.mkenums_simple('gstenumtypes',
213   sources : gst_headers,
214   header_prefix : '#include <gst/gstconfig.h>',
215   body_prefix : '#include "gst/gst_private.h"\n#include <gst/gst.h>',
216   decorator : 'GST_API',
217   install_header : true,
218   install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst'))
219
220 gstenum_h = gst_enums[1]
221 gstenum_c = gst_enums[0]
222
223 gst_parse_sources = []
224 if gst_parse
225   subdir('parse')
226 endif
227
228 subdir('printf')
229
230 libgst_c_args = gst_c_args + [
231   '-D_GNU_SOURCE',
232   '-DG_LOG_DOMAIN="GStreamer"',
233   '-DGST_DISABLE_DEPRECATED',
234 ]
235
236 tracer_hooks = get_option('tracer_hooks')
237 if not tracer_hooks
238   libgst_c_args += ['-DGST_DISABLE_GST_TRACER_HOOKS']
239 endif
240
241 # Make sure that subproject building gir files work
242 gst_incdirs = [configinc]
243 gst_gen_sources = [gstenum_h]
244 libgst = library('gstreamer-1.0', gst_sources,
245   gstenum_h, gstenum_c, gst_parse_sources, gst_registry_sources,
246   version : libversion,
247   soversion : soversion,
248   darwin_versions : osxversion,
249   c_args : libgst_c_args + ['-DBUILDING_GST'],
250   include_directories : [configinc,
251     # HACK, change include paths in .y and .l in final version.
252     include_directories('parse')],
253   link_with : printf_lib,
254   install : true,
255   dependencies : [gobject_dep, gmodule_dep, glib_dep, mathlib, dl_dep,
256                   backtrace_deps, platform_deps, extra_deps],
257 )
258
259 pkg_name = 'gstreamer-1.0'
260 library_def = {'lib': libgst}
261 pkgconfig.generate(libgst,
262   libraries : [glib_dep, gobject_dep],
263   variables : pkgconfig_variables,
264   uninstalled_variables: pkgconfig_uninstalled_variables,
265   subdirs : pkgconfig_subdirs,
266   name : pkg_name,
267   description : 'Streaming media framework',
268 )
269
270 if build_gir
271   gst_gir_extra_args = gir_init_section + ['--c-include=gst/gst.h']
272   if meson.is_subproject()
273     # FIXME: There must be a better way to do this
274     # Need to pass the include path to find gst/gst.h and gst/gstenumtypes.h (built)
275     gst_gir_extra_args += ['--cflags-begin',
276       '-I' + meson.current_source_dir() + '/..',
277       '-I' + meson.current_build_dir() + '/..',
278       '-DGST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS',
279       '--cflags-end']
280   endif
281
282   gst_incdirs += [configinc]
283   gir = {
284     'sources' : gst_sources + gst_headers + gst_enums + [gst_version_h],
285     'namespace' : 'Gst',
286     'nsversion' : apiversion,
287     'identifier_prefix' : 'Gst',
288     'symbol_prefix' : 'gst',
289     'export_packages' : pkg_name,
290     'includes' : ['GLib-2.0', 'GObject-2.0', 'GModule-2.0' ],
291     'install' : true,
292     'extra_args' : gst_gir_extra_args,
293   }
294   library_def += {'gir': [gir]}
295   # When building statically the information about the gir is going to be
296   # consumed by `gst-build` to generate gir files linked against
297   # `libgstreamer-full-1.0.so`. We do not build it here as it is currently
298   # broken. Once that is fixed we could build it here, even though we would keep
299   # creating another gir which links against gst-full.
300   if not static_build
301     gst_gir = gnome.generate_gir(libgst, kwargs: gir)
302     gst_gen_sources += gst_gir
303   endif
304 endif
305 libraries += [[pkg_name, library_def]]
306
307 gst_compile_args = []
308 if get_option('default_library') == 'static'
309   gst_compile_args += ['-DGST_STATIC_COMPILATION']
310 endif
311
312 gst_dep = declare_dependency(link_with : libgst,
313   compile_args : gst_compile_args,
314   include_directories : gst_incdirs,
315   dependencies : [glib_dep, gobject_dep, gmodule_dep],
316   # Everything that uses libgst needs this built to compile
317   sources : gst_gen_sources,
318 )
319
320 meson.override_dependency(pkg_name, gst_dep)